-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinal.ql
More file actions
28 lines (23 loc) · 834 Bytes
/
Copy pathfinal.ql
File metadata and controls
28 lines (23 loc) · 834 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
27
28
/**
* @name Cross-site scripting vulnerable plugin
* @kind path-problem
* @id js/xss-unsafe-plugin
*/
import javascript
import DataFlow::PathGraph
class Configuration extends TaintTracking::Configuration {
Configuration() { this = "XssUnsafeJQueryPlugin" }
override predicate isSource(DataFlow::Node source) {
// Fill me in from Step 9
exists(DataFlow::FunctionNode pluginFunction |
pluginFunction = jquery().getAPropertyRead("fn").getAPropertySource() and
source = pluginFunction.getLastParameter()
)
}
override predicate isSink(DataFlow::Node sink) {
sink = jquery().getACall().getArgument(0)
}
}
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
where cfg.hasFlowPath(source, sink)
select sink, source, sink, "Potential XSS vulnerability in plugin."