> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/web/xss.md).

# Cross-Site Scripting (XSS)

Cross-site scripting, reflected XSS, stored XSS, DOM XSS, CSP bypass, AngularJS sandbox escape, cookie theft, and credential capture.

XSS notes for PortSwigger Web Security Academy labs, focused on practical testing steps, Burp Suite validation, payload behavior, and exploitation workflow.

## Testing Workflow

1. Identify the vulnerable feature and the relevant request, parameter, header, cookie, or browser-side sink.
2. Reproduce the behavior in Burp Suite with a minimal payload before escalating the attack.
3. Validate impact with a clear proof of concept, such as account access, data disclosure, code execution, SSRF, or state change.
4. Keep payloads, URLs, tokens, and lab credentials unchanged while documenting the exploitation path.

## Labs

<table><thead><tr><th data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/web/xss/angularjs-sandbox-escape-with-csp.md">AngularJS Sandbox Escape with CSP</a></td></tr><tr><td><a href="/web/xss/angularjs-sandbox-escape-without-strings.md">AngularJS Sandbox Escape without Strings</a></td></tr><tr><td><a href="/web/xss/cookie-theft-via-xss.md">Cookie Theft via XSS</a></td></tr><tr><td><a href="/web/xss/dom-xss-in-href-attribute-with-jquery-location-search.md">DOM XSS in an href Attribute with jQuery and location.search</a></td></tr><tr><td><a href="/web/xss/dom-xss-in-angularjs-with-encoded-angle-brackets-and-quotes.md">DOM XSS in AngularJS with Encoded Angle Brackets and Quotes</a></td></tr><tr><td><a href="/web/xss/dom-xss-with-innerhtml-and-location-search.md">DOM XSS with innerHTML and location.search</a></td></tr><tr><td><a href="/web/xss/dom-xss-with-jquery-hashchange-event.md">DOM XSS with jQuery and hashchange</a></td></tr><tr><td><a href="/web/xss/password-capture-via-xss.md">Password Capture via XSS</a></td></tr><tr><td><a href="/web/xss/reflected-xss-in-a-javascript-string-with-html-encoded-angle-brackets.md">Reflected XSS in a JavaScript String with HTML-Encoded Angle Brackets</a></td></tr><tr><td><a href="/web/xss/reflected-xss-protected-by-strict-csp-with-dangling-markup.md">Reflected XSS Protected by a Very Strict CSP Attack by Dangling Markup</a></td></tr><tr><td><a href="/web/xss/reflected-xss-with-svg-tags-allowed.md">Reflected XSS with Allowed SVG Tags</a></td></tr><tr><td><a href="/web/xss/stored-xss-in-anchor-href-with-encoded-quotes.md">Stored XSS in an Anchor href with Encoded Quotes</a></td></tr><tr><td><a href="/web/xss/stored-xss-in-html-context-without-encoding.md">Stored XSS in HTML Context without Encoding</a></td></tr><tr><td><a href="/web/xss/stored-xss-in-onclick-with-full-encoding.md">Stored XSS in onclick with Full Encoding</a></td></tr><tr><td><a href="/web/xss/dom-xss-document-write-with-location-search.md">XSS DOM document.write with location.search</a></td></tr><tr><td><a href="/web/xss/reflected-dom-xss.md">XSS DOM Reflected</a></td></tr><tr><td><a href="/web/xss/stored-dom-xss.md">XSS DOM Stored</a></td></tr><tr><td><a href="/web/xss/xss-dom-with-document-write-inside-a-select.md">XSS DOM with document.write Inside a Select</a></td></tr><tr><td><a href="/web/xss/xss-in-a-javascript-string-with-apostrophe-and-backslash-escaped.md">XSS in a JavaScript String with Apostrophe and Backslash Escaped</a></td></tr><tr><td><a href="/web/xss/xss-in-a-javascript-string-with-encoded-angle-brackets-encoded-double-quotes-and-escaped-apostrophe.md">XSS in a JavaScript String with Encoded Angle Brackets, Encoded Double Quotes, and Escaped Apostroph</a></td></tr><tr><td><a href="/web/xss/xss-in-javascript-url-with-limited-characters.md">XSS in a JavaScript URL with Limited Characters</a></td></tr><tr><td><a href="/web/xss/xss-in-template-literal-with-escaped-unicode.md">XSS in a Literal Template with Escaped Unicode Characters</a></td></tr><tr><td><a href="/web/xss/xss-reflected-in-an-attribute-with-encoded-angle-brackets.md">XSS Reflected in an Attribute with Encoded Angle Brackets</a></td></tr><tr><td><a href="/web/xss/reflected-xss-in-html-with-blocked-tags.md">XSS Reflected in HTML with Blocked Tags</a></td></tr><tr><td><a href="/web/xss/reflected-xss-in-html-without-encoding.md">XSS Reflected in HTML without Encoding</a></td></tr><tr><td><a href="/web/xss/reflected-xss-in-canonical-link-tag.md">XSS Reflected in the Canonical Tag</a></td></tr><tr><td><a href="/web/xss/reflected-xss-with-custom-tags-only.md">XSS Reflected with Only Custom Tags</a></td></tr><tr><td><a href="/web/xss/xss-to-bypass-csrf-defenses.md">XSS to Bypass CSRF Defenses</a></td></tr><tr><td><a href="/web/xss/xss-with-blocked-events-and-href-attributes.md">XSS with Blocked Events and href Attributes</a></td></tr><tr><td><a href="/web/xss/xss-with-csp-bypass.md">XSS with CSP and Bypass Technique</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/web/xss.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
