Skip to content

Commit fcd53a8

Browse files
committed
Deprecate old predicate
1 parent e7bad4c commit fcd53a8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

java/ql/lib/semmle/code/java/security/SqlInjectionQuery.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,17 @@ module QueryInjectionFlow = TaintTracking::Global<QueryInjectionFlowConfig>;
5959
* Implementation of `SqlTainted.ql`. This is extracted to a QLL so that it
6060
* can be excluded from `SqlConcatenated.ql` to avoid overlapping results.
6161
*/
62-
predicate queryTaintedBy(
62+
deprecated predicate queryTaintedBy(
63+
QueryInjectionSink query, DataFlow::PathNode source, DataFlow::PathNode sink
64+
) {
65+
any(QueryInjectionFlowConfig c).hasFlowPath(source, sink) and sink.getNode() = query
66+
}
67+
68+
/**
69+
* Implementation of `SqlTainted.ql`. This is extracted to a QLL so that it
70+
* can be excluded from `SqlConcatenated.ql` to avoid overlapping results.
71+
*/
72+
predicate queryIsTaintedBy(
6373
QueryInjectionSink query, QueryInjectionFlow::PathNode source, QueryInjectionFlow::PathNode sink
6474
) {
6575
QueryInjectionFlow::flowPath(source, sink) and sink.getNode() = query

java/ql/src/Security/CWE/CWE-089/SqlTainted.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import QueryInjectionFlow::PathGraph
1919

2020
from
2121
QueryInjectionSink query, QueryInjectionFlow::PathNode source, QueryInjectionFlow::PathNode sink
22-
where queryTaintedBy(query, source, sink)
22+
where queryIsTaintedBy(query, source, sink)
2323
select query, source, sink, "This query depends on a $@.", source.getNode(), "user-provided value"

0 commit comments

Comments
 (0)