mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
Refactor taintedString.ql test
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
import semmle.code.java.dataflow.FlowSources
|
import semmle.code.java.dataflow.FlowSources
|
||||||
|
|
||||||
class Conf extends TaintTracking::Configuration {
|
module Config implements DataFlow::ConfigSig {
|
||||||
Conf() { this = "qltest:cwe-089:taintedString" }
|
predicate isSource(DataFlow::Node source) { source instanceof UserInput }
|
||||||
|
|
||||||
override predicate isSource(DataFlow::Node source) { source instanceof UserInput }
|
predicate isSink(DataFlow::Node sink) { any() }
|
||||||
|
|
||||||
override predicate isSink(DataFlow::Node sink) { any() }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
from Conf conf, Expr tainted, Method method
|
module Flow = TaintTracking::Global<Config>;
|
||||||
|
|
||||||
|
from Expr tainted, Method method
|
||||||
where
|
where
|
||||||
conf.hasFlowToExpr(tainted) and
|
Flow::flowToExpr(tainted) and
|
||||||
tainted.getEnclosingCallable() = method and
|
tainted.getEnclosingCallable() = method and
|
||||||
tainted.getFile().getStem() = ["Test", "Validation"]
|
tainted.getFile().getStem() = ["Test", "Validation"]
|
||||||
select method, tainted.getLocation().getStartLine() - method.getLocation().getStartLine(), tainted
|
select method, tainted.getLocation().getStartLine() - method.getLocation().getStartLine(), tainted
|
||||||
|
|||||||
Reference in New Issue
Block a user