Browser & protocol
DOM-Based Attacks
Client-side flaws occur entirely in the browser: JavaScript reads attacker-controllable sources (location, document.referrer, window.name, postMessage, storage) and writes them to dangerous sinks (innerHTML, eval, location, document.write). This category covers DOM XSS source-to-sink patterns, postMessage abuse, DOM clobbering, client-side template injection (AngularJS and Vue), client-side prototype pollution gadgets, open-redirect-to-XSS sinks, tabnabbing and window.opener abuse. For classic HTML-context XSS strings see XSS/.
- 101 payloads
- 1 file
- README on GitHub
Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.
These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.
Payload files
Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.
dom-based-payloads.txt
101 payloads · 8.1 KBLoading payloads for DOM-Based Attacks…
Common Attack Vectors#
location.hash,location.search,document.referrer,window.nameflowing into sinksmessageevent listeners that skipevent.originchecks or trustevent.datastructure- HTML elements with
idornameattributes that overwrite global variables ordocumentproperties - AngularJS (1.x) and Vue template expressions evaluated from user input
- Client-side prototype pollution gadgets reaching script loaders or sanitiser configuration
- Links with
target="_blank"and norel="noopener", andwindow.openreferences - Sinks:
innerHTML,outerHTML,insertAdjacentHTML,document.write,eval,setTimeout(string),new Function, jQuery$()and.html(),locationassignment,postMessagewith*
Testing Approach#
Find sources and sinks with browser developer tools, the DOM Invader extension or a static scan of bundled JavaScript. Place a unique marker in each source and search the live DOM and JavaScript execution traces for where it lands. Confirm execution in the actual browser; the sink and its context decide which payload works. For postMessage, write a listener-aware test page on a separate origin and check whether the receiver validates event.origin and the message shape. Never test against users other than accounts you own.
References#
Responsible Use
All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.
- Systems and applications you own
- Authorized penetration testing engagements
- Bug bounty programs with defined scope
- Educational lab environments (DVWA, WebGoat, HackTheBox)