mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
Xss through DOM
This commit is contained in:
21
javascript/ql/src/Security/CWE-079/XssThroughDom.ql
Normal file
21
javascript/ql/src/Security/CWE-079/XssThroughDom.ql
Normal 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"
|
||||
Reference in New Issue
Block a user