| name | wstg-clnt-01 |
| description | Testing for DOM-Based Cross Site Scripting |
| category | client-side |
| owasp_id | WSTG-CLNT-01 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["client-side","javascript","dom","cors","wstg","clnt"] |
| tech_stack | [] |
| cwe_ids | ["CWE-79"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-clnt-01
Test ID
WSTG-CLNT-01
Test Name
Testing for DOM-Based Cross Site Scripting
High-Level Description
DOM-based XSS occurs when client-side JavaScript processes data from untrusted sources and writes it to the DOM without proper sanitization. Unlike reflected or stored XSS, the payload never reaches the server - the entire attack happens in the browser. This makes DOM XSS harder to detect with server-side security tools.
What to Check
Sources (User Input)
Sinks (Dangerous Functions)
How to Test
Step 1: Identify Sources and Sinks
const sources = [
"location.hash",
"location.search",
"location.href",
"document.URL",
"document.referrer",
"window.name",
"localStorage",
"sessionStorage",
]
sinks = [
,
,
,
,
,
,
,
,
,
,
]
.()