mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
24 lines
817 B
Plaintext
24 lines
817 B
Plaintext
/**
|
|
* @name Client-side cross-site scripting
|
|
* @description Writing user input directly to the DOM allows for
|
|
* a cross-site scripting vulnerability.
|
|
* @kind path-problem
|
|
* @problem.severity error
|
|
* @precision high
|
|
* @id js/xss
|
|
* @tags security
|
|
* external/cwe/cwe-079
|
|
* external/cwe/cwe-116
|
|
*/
|
|
|
|
import javascript
|
|
import semmle.javascript.security.dataflow.DomBasedXssQuery
|
|
import DataFlow::PathGraph
|
|
import semmle.javascript.heuristics.AdditionalSources
|
|
|
|
from DataFlow::Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
|
|
where cfg.hasFlowPath(source, sink) and source.getNode() instanceof HeuristicSource
|
|
select sink.getNode(), source, sink,
|
|
sink.getNode().(Sink).getVulnerabilityKind() + " vulnerability due to $@.", source.getNode(),
|
|
"user-provided value"
|