Open
Description
Description of the false positive
CodeQL considers DOMParser().parseFromString
as XSS sink but I think it is no longer XSS sink.
Though there was a bug in Safari some years ago, but the method is designed not to execute JavaScript as far as I read the discussions in GoogleChrome/web.dev#6890 and the spec.
Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8.
Code samples or links to source code
codeql/javascript/ql/test/query-tests/Security/CWE-079/DomBasedXss/tst.js
Lines 177 to 180 in b6a7661
URL to the alert on GitHub code scanning (optional)
Activity