Skip to content

Commit 02b0156

Browse files
committed
Actions: ArgumentInjection
1 parent cecb2df commit 02b0156

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

actions/ql/lib/codeql/actions/security/ArgumentInjectionQuery.qll

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
private import actions
22
private import codeql.actions.TaintTracking
33
private import codeql.actions.dataflow.ExternalFlow
4+
private import codeql.actions.security.ControlChecks
45
import codeql.actions.dataflow.FlowSources
56
import codeql.actions.DataFlow
67

@@ -89,8 +90,17 @@ private module ArgumentInjectionConfig implements DataFlow::ConfigSig {
8990
)
9091
}
9192

92-
predicate observeDiffInformedIncrementalMode() {
93-
any() // TODO: Make sure that the location overrides match the query's select clause: Column 7 does not select a source or sink originating from the flow call on line 22 (/Users/d10c/src/semmle-code/ql/actions/ql/src/experimental/Security/CWE-088/ArgumentInjectionCritical.ql@29:62:29:66)
93+
predicate observeDiffInformedIncrementalMode() { any() }
94+
95+
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
96+
97+
Location getASelectedSinkLocation(DataFlow::Node sink) {
98+
result = sink.getLocation()
99+
or
100+
exists(Event event | result = event.getLocation() |
101+
inPrivilegedContext(sink.asExpr(), event) and
102+
not exists(ControlCheck check | check.protects(sink.asExpr(), event, "argument-injection"))
103+
)
94104
}
95105
}
96106

0 commit comments

Comments
 (0)