Skip to content

Commit de68881

Browse files
committed
Delay envvar event-name correlation
1 parent 26da3e7 commit de68881

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ import codeql.actions.dataflow.FlowSources
1919
import EnvVarInjectionFlow::PathGraph
2020
import codeql.actions.security.ControlChecks
2121

22+
bindingset[source, event]
23+
pragma[inline_late]
24+
private predicate hasSameEventName(RemoteFlowSource source, Event event) {
25+
source.getEventName() = event.getName()
26+
}
27+
2228
from EnvVarInjectionFlow::PathNode source, EnvVarInjectionFlow::PathNode sink, Event event
2329
where
2430
EnvVarInjectionFlow::flowPath(source, sink) and
25-
source.getNode().(RemoteFlowSource).getEventName() = event.getName() and
31+
hasSameEventName(source.getNode(), event) and
2632
// exclude paths to file read sinks from non-artifact sources
2733
(
2834
// source is text

0 commit comments

Comments
 (0)