PortSwigger
portswigger.net › web-security › cross-site-scripting › dom-based
What is DOM-based XSS (cross-site scripting)? Tutorial & Examples | Web Security Academy
The most common source for DOM XSS is the URL, which is typically accessed with the window.location object. An attacker can construct a link to send a victim to a vulnerable page with a payload in the query string and fragment portions of the URL.
OWASP Foundation
owasp.org › www-community › attacks › DOM_Based_XSS
DOM Based XSS | OWASP Foundation
DOM Based XSS (or as it is called in some texts, “type-0 XSS”) is an XSS attack wherein the attack payload is executed as a result of modifying the DOM “environment” in the victim’s browser used by the original client side script, so that the client side code runs in an “unexpected” manner.
Videos
06:59
DOM Based XSS Attack Demonstration - YouTube
07:49
DOM-Based Cross-Site Scripting (DOM XSS) Explained - YouTube
04:16
Cross-Site Scripting: Part 2 - What is DOM-based XSS? - YouTube
09:37
How To Search For DOM-Based XSS! - YouTube
05:18
DOM XSS for Beginners | Cross Site Scripting Basics - YouTube
08:05
How to exploit DOM XSS | DOM XSS - YouTube
What is DOM-based XSS?
DOM-based cross-site scripting is a type of cross-site scripting (XSS) attack executed within the Document Object Model (DOM) of a page loaded into the browser. A DOM-based XSS attack is possible if the web application writes data to the DOM without proper sanitization. · Learn more about types of cross-site scripting attacks
invicti.com
invicti.com › learn › dom-based-cross-site-scripting-dom-xss
DOM-Based Cross-Site Scripting (DOM XSS)
How to prevent DOM-based XSS vulnerabilities?
To prevent DOM XSS, you can use general XSS protection techniques: filtering and escaping, but there are no universal JavaScript libraries to help you filter and escape data, so developers need to write and maintain such functionality themselves. · Access the OWASP cheat sheet on preventing DOM XSS.
invicti.com
invicti.com › learn › dom-based-cross-site-scripting-dom-xss
DOM-Based Cross-Site Scripting (DOM XSS)
How dangerous is DOM-based XSS?
DOM-based XSS is only possible in specific cases but it is considered especially dangerous because it is difficult to detect and mitigate against. Since DOM-based XSS does not involve the server side of the application, web application firewalls cannot protect against it at all so there is no easy way to avoid zero-day DOM XSS attacks. · Find out how to use web application firewalls effectively.
invicti.com
invicti.com › learn › dom-based-cross-site-scripting-dom-xss
DOM-Based Cross-Site Scripting (DOM XSS)
GitHub
github.com › swisskyrepo › PayloadsAllTheThings › blob › master › XSS Injection › README.md
PayloadsAllTheThings/XSS Injection/README.md at master · swisskyrepo/PayloadsAllTheThings
This can happen, for example, when a user input is used to update the page's HTML or JavaScript code in some way. In a DOM-based XSS attack, the malicious code is not sent to the server, but is instead executed directly in the user's browser.
Author swisskyrepo
Intigriti
intigriti.com › blog › hacking tools
Hunting for DOM-based XSS vulnerabilities: A complete guide
November 11, 2025 - On line 10, we can see that the vulnerable application reads data from the firstName query parameter and passes it to the DOM sink, specifically innerHTML. Since we fully control the firstName query parameter, we can essentially pass the following payload as its value and render any HTML tag, including XSS payloads:
Invicti
invicti.com › learn › dom-based-cross-site-scripting-dom-xss
DOM-Based Cross-Site Scripting (DOM XSS)
Unlike other cross-site scripting vulnerabilities, you cannot mitigate DOM-based XSS using a web application firewall (WAF) or generic framework protection like request validation in ASP.NET. Such mechanisms are completely useless against DOM-based XSS attacks because the payload never reaches the server.
Snyk Learn
learn.snyk.io › home › security education › dom based xss | tutorial & examples | snyk learn
DOM Based XSS | Tutorial & Examples | Snyk Learn | Snyk Learn
July 18, 2022 - Document Object Model (DOM) cross-site ... or stored XSS, where the vulnerability is caused by server-side flaws and the payload is reflected in the response, ......
GitHub
github.com › OWASP › wstg › blob › master › document › 4-Web_Application_Security_Testing › 11-Client-side_Testing › 01-Testing_for_DOM-based_Cross_Site_Scripting.md
wstg/document/4-Web_Application_Security_Testing/11-Client-side_Testing/01-Testing_for_DOM-based_Cross_Site_Scripting.md at master · OWASP/wstg
The consequences of DOM-based XSS flaws are as wide ranging as those seen in more well known forms of XSS, including cookie retrieval, further malicious script injection, etc., and should therefore be treated with the same severity. Identify DOM sinks. Build payloads that pertain to every sink type.
Author OWASP
GitHub
github.com › OWASP › www-community › blob › master › pages › attacks › DOM_Based_XSS.md
www-community/pages/attacks/DOM_Based_XSS.md at master · OWASP/www-community
That is, the page itself (the HTTP response that is) does not change, but the client side code contained in the page executes differently due to the malicious modifications that have occurred in the DOM environment. This is in contrast to other XSS attacks (stored or reflected), wherein the attack payload is placed in the response page (due to a server side flaw).
Author OWASP
GitHub
github.com › yogsec › XSS-Payloads
GitHub - yogsec/XSS-Payloads: This repository is a comprehensive collection of Cross-Site Scripting (XSS) Payloads designed for educational, research, and testing purposes. It includes payloads for various XSS attack types such as Reflected XSS, Stored XSS, DOM-Based XSS, and WAF Bypass Techniques. · GitHub
This repository is a comprehensive collection of Cross-Site Scripting (XSS) Payloads designed for educational, research, and testing purposes. It includes payloads for various XSS attack types such as Reflected XSS, Stored XSS, DOM-Based XSS, and WAF Bypass Techniques. - yogsec/XSS-Payloads
Starred by 28 users
Forked by 11 users
Legit Security
legitsecurity.com › aspm-knowledge-base › dom-based-xss
What DOM-Based XSS Is and How to Prevent It
April 15, 2025 - User interaction: The attacker tricks a user into clicking a malicious link that contains an injected payload in the query string or fragment identifier. JavaScript processing: The web application’s client-side script extracts data from an attacker-controlled source and writes it into the DOM.
web.dev
web.dev › articles › prevent dom-based cross-site scripting vulnerabilities with trusted types
Prevent DOM-based cross-site scripting vulnerabilities with Trusted Types | Articles | web.dev
March 25, 2020 - Some libraries already generate Trusted Types that you can pass to the sink functions. For example, you can use DOMPurify to sanitize an HTML snippet, removing XSS payloads.
HackTricks
book.hacktricks.xyz › home › pentesting web › xss cross site scripting › dom xss
DOM XSS - HackTricks
If the un-sanitized field is stored server-side (e.g., bug report “details”), the payload becomes stored DOM XSS for any privileged viewer of the list.
Payatu
payatu.com › home › how dom-based cross-site scripting (xss) attack works
How DOM-based Cross-Site Scripting (XSS) Attack Works
April 19, 2024 - 4) Here you can see that our query is directly gets appended to the document.write function (sink) without any sanitization, and this function writes data out to the page because of this our payload gets triggered. ... If a Javascript library such as jQuery is being used, you can lookout for sinks as ${}(selector function) which you can use to inject malicious objects into the DOM. JQuery used to be extremely popular, and a classic DOM XSS vulnerability was caused by websites using this selector in conjunction with the location.hash source for animations or auto-scrolling to a particular element on the page.