Skip to content

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ private module EnvPathInjectionConfig implements DataFlow::ConfigSig {
108108
exists(run.getScript().getAFileReadCommand())
109109
)
110110
}
111+
112+
predicate observeDiffInformedIncrementalMode() { any() }
113+
114+
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
115+
116+
Location getASelectedSinkLocation(DataFlow::Node sink) {
117+
result = sink.getLocation()
118+
or
119+
// where clause from EnvPathInjectionCritical.ql
120+
exists(Event event, RemoteFlowSource source | result = event.getLocation() |
121+
inPrivilegedContext(sink.asExpr(), event) and
122+
isSource(source) and
123+
(
124+
not source.getSourceType() = "artifact" and
125+
not exists(ControlCheck check | check.protects(sink.asExpr(), event, "code-injection"))
126+
or
127+
source.getSourceType() = "artifact" and
128+
not exists(ControlCheck check |
129+
check.protects(sink.asExpr(), event, ["untrusted-checkout", "artifact-poisoning"])
130+
) and
131+
sink instanceof EnvPathInjectionFromFileReadSink
132+
)
133+
)
134+
}
111135
}
112136

113137
/** Tracks flow of unsafe user input that is used to construct and evaluate the PATH environment variable. */

0 commit comments

Comments
 (0)