-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathExceptionXss.ql
More file actions
26 lines (24 loc) · 883 Bytes
/
ExceptionXss.ql
File metadata and controls
26 lines (24 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* @name Client-side cross-site scripting through exception
* @description User input being part of an exception allows for
* cross-site scripting if that exception ends as input
* to the DOM.
* @kind path-problem
* @problem.severity error
* @precision low
* @id js/xss-through-exception
* @tags security
* external/cwe/cwe-079
* external/cwe/cwe-116
*/
import javascript
import semmle.javascript.security.dataflow.ExceptionXss::ExceptionXss
import DataFlow::PathGraph
from
Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where
cfg.hasFlowPath(source, sink) and
not any(ConfigurationNoException c).hasFlow(source.getNode(), sink.getNode())
select sink.getNode(), source, sink,
sink.getNode().(Sink).getVulnerabilityKind() + " vulnerability due to $@.", source.getNode(),
"user-provided value"