PortSwigger
portswigger.net › web-security › cross-site-scripting › dom-based
What is DOM-based XSS (cross-site scripting)? Tutorial & Examples | Web Security Academy
In this section, we'll describe DOM-based cross-site scripting (DOM XSS), explain how to find DOM XSS vulnerabilities, and talk about how to exploit DOM XSS with different sources and sinks.
OWASP Foundation
owasp.org › www-community › attacks › DOM_Based_XSS
DOM Based XSS | OWASP Foundation
[1] “DOM Based Cross Site Scripting or XSS of the Third Kind” (WASC writeup), Amit Klein, July 2005
Videos
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
02:46
DOM XSS in jQuery anchor href attribute sink using location search ...
05:00
Cross-Site Scripting Explained - Part 2: DOM-Based XSS - YouTube
58:21
Finding & Exploiting DOM XSS Vulnerabilities For BugBountys - 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 avoid DOM-based XSS vulnerabilities?
To avoid DOM-based XSS, you should avoid using data received from the client for client-side sensitive actions and sanitize client-side code by inspecting references to DOM objects that pose a threat, for example, URL, location, and referrer.
Read about DOM-based XSS vulnerabilities in popular websites and web applications.
acunetix.com
acunetix.com › blog › articles › dom-xss-explained
DOM XSS: An Explanation of DOM-based Cross-site Scripting | Acunetix
What are DOM-based XSS vulnerabilities?
DOM-based XSS vulnerabilities are a type of Cross-site Scripting (XSS) vulnerabilities. A DOM-based XSS attack is possible if the web application writes data to the Document Object Model (DOM) without proper sanitization. The attacker can manipulate this data to include, for example, malicious JavaScript code.
Learn more about all types of Cross-site scripting attacks.
acunetix.com
acunetix.com › blog › articles › dom-xss-explained
DOM XSS: An Explanation of DOM-based Cross-site Scripting | Acunetix
GitHub
github.com › Sudistark › xss-writeups › blob › main › figma.com-xss.md
xss-writeups/figma.com-xss.md at main · Sudistark/xss-writeups
Recently I was able to find a DOM based xss in www.figma.com in collaboration with @huli (an awesome ctf player).
Author Sudistark
GitHub
github.com › frank-leitner › portswigger-websecurity-academy › blob › main › 15_DOM_based_vulnerabilities › DOM_XSS_using_web_messages › README.md
portswigger-websecurity-academy/15_DOM_based_vulnerabilities/DOM_XSS_using_web_messages/README.md at main · frank-leitner/portswigger-websecurity-academy
This write-up for the lab DOM XSS using web messages is part of my walk-through series for PortSwigger's Web Security Academy.
Author frank-leitner
OWASP Cheat Sheet Series
cheatsheetseries.owasp.org › cheatsheets › DOM_based_XSS_Prevention_Cheat_Sheet.html
DOM based XSS Prevention - OWASP Cheat Sheet Series
This is because the rule to HTML attribute encode in an HTML attribute rendering context is necessary in order to mitigate attacks which try to exit out of an HTML attributes or try to add additional attributes which could lead to XSS. When you are in a DOM execution context you only need to JavaScript encode HTML attributes which do not execute code (attributes other than event handler, CSS, and URL attributes).
writeups
svennergr.github.io › writeups › google › ads_dom_xss
Stumbling across a DOM XSS on google.com | writeups
This is a short writeup about a DOM XSS on google.com which I accidentally discovered.
Invicti
invicti.com › learn › dom-based-cross-site-scripting-dom-xss
DOM-Based Cross-Site Scripting (DOM XSS)
The best way to completely avoid DOM-based XSS vulnerabilities in your JavaScript code is to use the correct output method (a safe sink). For example, if you want to write into a <div> element, don’t use innerHtml.
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 - DOM XSS is a web application vulnerability that allows attackers to manipulate the DOM environment in a user's browser by injecting malicious client-side code. DOM XSS vulnerabilities are mainly attributed to situations where user-controllable ...
Acunetix
acunetix.com › blog › articles › dom-xss-explained
DOM XSS: An Explanation of DOM-based Cross-site Scripting | Acunetix
February 19, 2025 - An attacker may use several DOM objects to create a Cross-site Scripting attack. The most popular objects from this perspective are document.url, document.location, and document.referrer. Potential consequences of DOM-based XSS vulnerabilities are classified in the OWASP Top 10 2017 document as moderate.
PortSwigger
portswigger.net › web-security › cross-site-scripting › dom-based › lab-document-write-sink
Lab: DOM XSS in document.write sink using source location.search | Web Security Academy
This lab contains a DOM-based cross-site scripting vulnerability in the search query tracking functionality. It uses the JavaScript document.write function, which writes data out to the page.
GitHub
github.com › Crypto-Cat › CTF › blob › main › web › WebSecurityAcademy › xss › dom_xss_jquery_hashchange › writeup.md
CTF/web/WebSecurityAcademy/xss/dom_xss_jquery_hashchange/writeup.md at main · Crypto-Cat/CTF
As discussed earlier, this is because jQuery patched the vulnerability but exploitation is still viable. In the example below, the src attribute points to the vulnerable page with an empty hash value. When the iframe is loaded, an XSS vector is appended to the hash, causing the hashchange event to fire
Author Crypto-Cat
GitHub
github.com › frank-leitner › portswigger-websecurity-academy › blob › main › 11_cross_site_scripting_XSS › Reflected_DOM_XSS › README.md
portswigger-websecurity-academy/11_cross_site_scripting_XSS/Reflected_DOM_XSS/README.md at main · frank-leitner/portswigger-websecurity-academy
So in order to execute my payload, I can terminate the string and json structure, append a function call and finish off with ignoring what comes next: \"}+alert(document.domain);//. This results in the following response
Author frank-leitner
HackTricks
book.hacktricks.xyz › home › pentesting web › xss cross site scripting › dom xss
DOM XSS - HackTricks
This kind of XSS is probably the hardest to find, as you need to look inside the JS code, see if it’s using any object whose value you control, and in that case, see if there is any way to abuse it to execute arbitrary JS. https://github.com/mozilla/eslint-plugin-no-unsanitized · Browser extension to check every data taht reaches a potential sink: https://github.com/kevin-mizu/domloggerpp