igbuend/grimbard/attack-surface-xss

Claude Code and agent skill by igbuend/grimbard

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Reconnaissance skill for XSS attack surface — analyzes headers, frameworks, JS libraries, and DOM patterns at a URL to map what makes XSS possible or harder. For ethical hackers preparing for XSS testing.

Install

npx vskill@latest install igbuend/grimbard/attack-surface-xss

SKILL.md

XSS Attack Surface Reconnaissance

Map the XSS attack surface of a target URL. Analyze security headers, client-side frameworks, JavaScript patterns, and DOM structure to identify what makes XSS possible, easier, or harder.

This skill does NOT inject payloads or test for XSS. It performs passive observation only (HTTP requests + source analysis). For active XSS testing, use /xss-finder.

Target: $ARGUMENTS (URL to analyze)

When to Use This Skill

  • Before running /xss-finder — understand what defenses exist
  • Scoping an XSS engagement — identify highest-value test targets
  • Evaluating a site's XSS posture without active testing
  • Mapping client-side technology stack for exploit development
  • Identifying which XSS classes (reflected, stored, DOM) are most likely

Core Capabilities

CapabilityDescription
Header AssessmentCSP, X-Content-Type-Options, cookie flags, charset
Framework DetectionReact, Angular, Vue, jQuery + version extraction
Vulnerable Library DetectionKnown CVEs per detected library version
DOM XSS Source/Sink MappinginnerHTML, eval, location.hash, postMessage
Input Vector EnumerationForms, hidden fields, URL parameter reflection
Attack Priority RankingOrdered list of where to focus XSS testing

Workflow

Phase 1: Fetch Target

Retrieve response headers and page content from $ARGUMENTS:

bash
# Response headers (follow redirects)
curl -sI -L "$URL"
# Full page body (HTML + inline JS)
curl -sL "$URL" -o /tmp/xss-recon-body.html

Use WebFetch as fallback for JavaScript-rendered content (SPAs that return minimal HTML).

Extract script references:

  1. Parse all <script> tags — capture both inline content and external src URLs
  2. Fetch external JS files from same-origin and known CDNs (jsdelivr, cdnjs, unpkg, googleapis)
  3. Cap at 20 external files to avoid excessive fetching
  4. Store fetched JS content for Phase 4 analysis

Record metadata:

  • Final URL after redirects (HTTP → HTTPS upgrade?)
  • Response status code
  • Server header value
  • Number of redirects
Phase 2: Security Headers Assessment

Check each header and rate its XSS impact:

HeaderCheckXSS Impact
Content-Security-PolicyPresent? unsafe-inline? Wildcards? Bypass CDNs?Primary XSS defense
Content-Security-Policy-Report-OnlyNon-enforcing — intel onlyShows intended policy
X-Content-Type-Optionsnosniff present?Blocks MIME-confusion script execution
X-XSS-ProtectionDeprecated; 0 = deliberately disabledLegacy posture indicator
Referrer-PolicyData leak controlReferer-based injection intel
Permissions-PolicyFeature restrictionsLimits attack surface
Content-TypeCharset specified?Missing charset enables UTF-7/ISO-2022-JP XSS
Set-CookieHttpOnly, Secure, SameSite flagsCookie theft feasibility

CSP quick assessment (inline):

  • Missing CSP → flag as critical gap, all inline injection viable
  • unsafe-inline in script-src → inline script injection works directly
  • unsafe-eval → eval-based payloads viable
  • Wildcard * or data: in script-src → script loading from any origin
  • Known bypass CDNs allowlisted (googleapis, cdnjs, jsdelivr, unpkg) → JSONP/Angular bypasses
  • strict-dynamic present → script gadget focus, not direct injection
  • Trusted Types → DOM sink restrictions active

For deep CSP analysis, recommend running /content-security-policy $URL.

Cookie assessment:

  • Missing HttpOnly → document.cookie exfiltration works
  • Missing Secure → network MITM can steal cookies
  • Missing SameSite → CSRF + XSS chaining viable
  • All flags present → cookie theft blocked, pivot to DOM-based exfiltration
Phase 3: Framework & Library Detection

Detect client-side stack from page source, script content, and global objects.

Frameworks — detection signatures:

FrameworkDetection Patterns
Reactdata-reactroot, _reactRootContainer, __REACT_DEVTOOLS, react.production.min.js
Angularng-app, ng-version attribute, angular.js/angular.min.js in script src
Vuedata-v- attributes, __VUE__, vue.js/vue.min.js in script src
jQueryjquery.min.js in script src, jQuery or $ assignment in inline scripts
Next.js__NEXT_DATA__ script tag, _next/static paths
Nuxt__NUXT__ global, _nuxt/ paths
Sveltesvelte in script paths, __svelte
Emberember.js in script src, data-ember- attributes
Backbonebackbone.js in script src

Security libraries — detect sanitizers:

LibraryDetectionNotes
DOMPurifydompurify in script src/content, DOMPurify.sanitize callsCheck version — mXSS bypasses per version
sanitize-htmlsanitize-html in script pathsServer-side usually, may appear in bundles
Helmet.jsInfer from header patterns (X-DNS-Prefetch-Control, X-Content-Type-Options set together)Server-side only
Trusted Typesrequire-trusted-types-for in CSP, trustedTypes API usageBrowser-enforced sink protection

Vulnerable library detection — extract versions from filenames and CDN URLs:

LibraryVulnerable VersionsXSS-Relevant Issue
jQuery < 3.5.0jquery-3.2.1.min.js, CDN path version$.htmlPrefilter XSS (CVE-2020-11022, CVE-2020-11023)
Angular < 1.6.xangular.js/1.5.8/ in CDN URLTemplate sandbox escape: {{$on.constructor('alert(1)')()}}
DOMPurify < 2.4.0dompurify/2.3.x/ in CDN URLmXSS via SVG+style namespace confusion
lodash < 4.17.21lodash/4.17.x/ in CDN URLPrototype pollution gadgets → XSS chain
Handlebars < 4.7.7handlebars/4.7.x/ in CDN URLPrototype pollution → template injection
Moment.jsAny versionReDoS, often bundled with vulnerable deps

For each detected library: report version, known XSS-relevant CVEs, and specific exploitation notes.

Phase 4: JavaScript Pattern Analysis

Analyze inline scripts and fetched JS files for dangerous patterns.

DOM XSS Sinks (code that writes to DOM unsafely):

SinkPatternRisk Level
innerHTMLel.innerHTML = ...High — direct HTML injection
outerHTMLel.outerHTML = ...High — replaces entire element
document.write()document.write(...)High — writes to document stream
document.writeln()document.writeln(...)High — same as write with newline
insertAdjacentHTML()el.insertAdjacentHTML(...)High — injects HTML at position
eval()eval(...)Critical — arbitrary code execution
Function()new Function(...)Critical — creates function from string
setTimeout(string)setTimeout("...", ...)High — eval equivalent
setInterval(string)setInterval("...", ...)High — eval equivalent
$.html()$(sel).html(...)High — jQuery innerHTML wrapper
$(user_input)$(location.hash)Critical — jQuery selector injection
v-htmlv-html="..." directiveHigh — Vue raw HTML binding
dangerouslySetInnerHTMLdangerouslySetInnerHTML={{...}}High — React raw HTML
location.href =location.href = ...Medium — open redirect → XSS chain
location.assign()location.assign(...)Medium — redirect sink
location.replace()location.replace(...)Medium — redirect sink
window.open()window.open(...)Medium — navigation sink
navigation.navigate()navigation.navigate(...)Medium — Chrome navigation API
Dynamic import()import(...)High — module loading sink

DOM XSS Sources (where attacker input enters):

SourcePatternNotes
location.hashlocation.hash, window.location.hashFragment — not sent to server
location.searchlocation.search, URLSearchParamsQuery string
location.hreflocation.href (read)Full URL including fragment
document.referrerdocument.referrerAttacker-controlled via link
window.namewindow.namePersists across navigations
document.cookiedocument.cookie (read)If attacker can set cookies
postMessageaddEventListener('message', ...)Check origin validation
localStoragelocalStorage.getItem(...)Persistent, attacker-settable
sessionStoragesessionStorage.getItem(...)Session-scoped
URL() constructornew URL(...), url.searchParamsParameter parsing

Source-to-sink tracing (static approximation): For each detected source, trace whether it flows into a sink without sanitization. Flag direct connections (e.g., el.innerHTML = location.hash). Note: full taint analysis requires browser DevTools or dynamic instrumentation — this is a best-effort static scan.

Dangerous constructs:

ConstructPatternXSS Relevance
Global variable declarationsvar config = ... on windowDOM clobbering targets (see dom-clobbering anti-pattern)
Prototype pollution gadgetsObject.assign, $.extend, _.merge with user inputGadget chain → XSS
JSONP endpointscallback= parameter in script srcArbitrary JS execution via callback
postMessage without origin checkaddEventListener('message', fn) without event.origin validationAny origin can inject data
Template literal injection` ...${userInput}... ` in dangerous contextsString interpolation into sinks
with statementswith(obj) { ... }Scope confusion, clobbering
Relative script loading<script src="./app.js">RPO vulnerability — path confusion
Phase 5: DOM & HTML Analysis

Analyze page structure for XSS-relevant features.

Input vectors:

  • Enumerate all <input>, <textarea>, <select> elements (visible + hidden)
  • Record name, type, id, maxlength, pattern attributes
  • Map forms to their action URLs and method (GET/POST)
  • Flag hidden fields — often unsanitized server-side (reference xss-finder hidden field methodology)
  • Flag file upload forms — SVG upload → stored XSS potential

URL parameter reflection test: For each URL parameter in $ARGUMENTS, check if value appears in response body. If reflected, note the reflection context (HTML body, attribute, script, comment).

Meta tags:

TagCheckXSS Impact
<meta charset>Missing?Enables charset-based XSS (ISO-2022-JP, UTF-7)
<meta http-equiv="Content-Security-Policy">Present?Meta CSP — limited (no frame-ancestors, no report-uri)
<meta http-equiv="refresh">User-controllable URL?Redirect vector

Embedding elements:

  • <iframe> — sandboxed? Is src user-controllable?
  • <object>, <embed> — plugin execution vectors
  • Inline <svg> — enables advanced XSS vectors (onbegin, SMIL <animate>)
  • <math> — MathML namespace confusion for mXSS (reference mutation-xss anti-pattern)

Inline event handlers: Count existing inline event handlers (onclick, onerror, onload, etc.) in page source. High count indicates the framework does not prohibit inline handlers — weak or absent CSP likely.

Third-party embeds:

  • Google Tag Manager (gtm.js) — tag injection surface
  • Analytics scripts (Google Analytics, Mixpanel, Segment) — config manipulation
  • Ad network scripts — additional injection surface
  • Social widgets — cross-origin messaging
Phase 6: Report Generation

Generate a structured report organized for ethical hacker workflow:

markdown
# XSS Attack Surface Report
**Target:** {URL}
**Date:** {date}
**Overall XSS Resistance:** {Strong | Moderate | Weak | Minimal}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4
Repository forks
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/igbuend/grimbard/attack-surface-xss/badge)](https://verified-skill.com/skills/igbuend/grimbard/attack-surface-xss)

Something wrong with this skill or its page? Tell us.