injection sink
A place in code where a string is interpreted as HTML or code, such as innerHTML, document.write or eval, and so can run an attack if the string is untrusted.
In more detail
Security reviews trace untrusted input from sources such as the URL to sinks. Trusted Types makes the browser enforce that only approved values reach them.
Related terms
- DOM-based XSS — Cross-site scripting that happens entirely in the browser, when page JavaScript copies attacker-controlled data, such as part of the URL, into a dangerous sink.
- Trusted Types — A browser security feature that makes dangerous DOM sinks such as innerHTML reject plain strings and accept only values produced by a policy you define.
- innerHTML — The DOM property that reads or replaces an element's contents as an HTML string, which the browser parses into nodes.
- eval() — The JavaScript function that runs a string as code.
Taught in
- Content Security Policy (CSP), Trusted Types And XSS Defenses — Frontend Architecture & Web Platform