Xss through DOM

This commit is contained in:
Erik Krogh Kristensen
2020-04-03 11:48:25 +02:00
parent 55edfed1ee
commit 14b551f887
6 changed files with 294 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/**
* @name Cross-site scripting through DOM
* @description Writing user controlled DOM to HTML can allow for
* a cross-site scripting vulnerability.
* @kind path-problem
* @problem.severity error
* @precision medium
* @id js/xss-through-dom
* @tags security
* external/cwe/cwe-079
* external/cwe/cwe-116
*/
import javascript
import semmle.javascript.security.dataflow.XssThroughDom::XssThroughDom
import DataFlow::PathGraph
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "Cross-site scripting vulnerability due to $@.",
source.getNode(), "DOM text"