Skip to content

Commit 4e7cf07

Browse files
committed
Actions: ArgumentInjection
1 parent d213154 commit 4e7cf07

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
@@ -3,6 +3,7 @@ private import codeql.actions.TaintTracking
33
private import codeql.actions.dataflow.ExternalFlow
44
import codeql.actions.dataflow.FlowSources
55
import codeql.actions.DataFlow
6+
import codeql.actions.security.ControlChecks
67

78
abstract class ArgumentInjectionSink extends DataFlow::Node {
89
abstract string getCommand();
@@ -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)