JS: Port XssThroughDom

This commit is contained in:
Asger F
2023-10-04 21:32:04 +02:00
parent 5f05232e02
commit cf5450dbd5
5 changed files with 160 additions and 247 deletions

View File

@@ -14,9 +14,11 @@
import javascript
import semmle.javascript.security.dataflow.XssThroughDomQuery
import DataFlow::PathGraph
import XssThroughDomFlow::PathGraph
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where cfg.hasFlowPath(source, sink)
from XssThroughDomFlow::PathNode source, XssThroughDomFlow::PathNode sink
where
XssThroughDomFlow::flowPath(source, sink) and
not isIgnoredSourceSinkPair(source.getNode(), sink.getNode())
select sink.getNode(), source, sink,
"$@ is reinterpreted as HTML without escaping meta-characters.", source.getNode(), "DOM text"