Software Securityhome
Fix a findingSearch
Glossary

DOM-based XSS

Cross-site scripting in which client-side script takes attacker-controlled data from a source such as location.hash or a postMessage event and writes it to a dangerous sink such as innerHTML or eval, so the payload may never reach the server. Use safe sinks such as textContent and enforce them with Trusted Types.

Also called
DOM XSS · DOM-based cross-site scripting

Covered in

Practice: HTML sanitization lab: Configure a sanitizer for user comments

Find your next answer

Type to search. Search runs in your browser.

Searches run in your browser, but the host can infer them from the index files they load. The address shows your search so you can bookmark or share it.