Skip to content

Commit 31a9346

Browse files
author
Alvaro Muñoz
committed
feat: show trigger event on query results
1 parent 0ad7f08 commit 31a9346

24 files changed

Lines changed: 326 additions & 324 deletions

ql/src/Security/CWE-077/EnvPathInjectionCritical.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ where
3535
sink.getNode() instanceof EnvPathInjectionFromFileReadSink
3636
)
3737
select sink.getNode(), source, sink,
38-
"Potential PATH environment variable injection in $@, which may be controlled by an external user.",
39-
sink, sink.getNode().toString()
38+
"Potential PATH environment variable injection in $@, which may be controlled by an external user ($@).",
39+
sink, sink.getNode().toString(), event, event.getName()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ where
4444
)
4545
)
4646
select sink.getNode(), source, sink,
47-
"Potential environment variable injection in $@, which may be controlled by an external user.",
48-
sink, sink.getNode().toString()
47+
"Potential environment variable injection in $@, which may be controlled by an external user ($@).",
48+
sink, sink.getNode().toString(), event, event.getName()

ql/src/Security/CWE-078/CommandInjectionCritical.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ where
2626
check.protects(sink.getNode().asExpr(), event, ["command-injection", "code-injection"])
2727
)
2828
select sink.getNode(), source, sink,
29-
"Potential command injection in $@, which may be controlled by an external user.", sink,
30-
sink.getNode().asExpr().(Expression).getRawExpression()
29+
"Potential command injection in $@, which may be controlled by an external user ($@).", sink,
30+
sink.getNode().asExpr().(Expression).getRawExpression(), event, event.getName()

ql/src/Security/CWE-088/ArgumentInjectionCritical.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ where
2525
check.protects(sink.getNode().asExpr(), event, "argument-injection")
2626
)
2727
select sink.getNode(), source, sink,
28-
"Potential argument injection in $@ command, which may be controlled by an external user.", sink,
29-
sink.getNode().(ArgumentInjectionSink).getCommand()
28+
"Potential argument injection in $@ command, which may be controlled by an external user ($@).",
29+
sink, sink.getNode().(ArgumentInjectionSink).getCommand(), event, event.getName()

ql/src/Security/CWE-094/CodeInjectionCritical.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ where
3333
)
3434
select sink.getNode(), source, sink,
3535
"Potential code injection in $@, which may be controlled by an external user ($@).", sink,
36-
sink.getNode().asExpr().(Expression).getRawExpression(), event,
37-
event.getLocation().getFile().toString()
36+
sink.getNode().asExpr().(Expression).getRawExpression(), event, event.getName()

ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ where
4444
)
4545
)
4646
select sink.getNode(), source, sink,
47-
"Unprivileged code injection in $@, which may lead to cache poisoning.", sink,
48-
sink.getNode().asExpr().(Expression).getRawExpression()
47+
"Unprivileged code injection in $@, which may lead to cache poisoning ($@).", sink,
48+
sink.getNode().asExpr().(Expression).getRawExpression(), event, event.getName()

ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ where
5858
// excluding privileged workflows since they can be exploited in easier circumstances
5959
not job.isPrivileged()
6060
select step, source, step,
61-
"Potential cache poisoning in the context of the default branch " + message
61+
"Potential cache poisoning in the context of the default branch " + message + " ($@).", event,
62+
event.getName()

ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ where
2828
exists(ControlCheck check1 | check1.protects(checkout, event, "untrusted-checkout")) and
2929
not exists(ControlCheck check2 | check2.protects(checkout, event, "untrusted-checkout-toctou"))
3030
select step, checkout, step,
31-
"Insufficient protection against execution of untrusted code on a privileged workflow."
31+
"Insufficient protection against execution of untrusted code on a privileged workflow ($@).",
32+
event, event.getName()

ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ where
2626
exists(ControlCheck check1 | check1.protects(checkout, event, "untrusted-checkout")) and
2727
not exists(ControlCheck check2 | check2.protects(checkout, event, "untrusted-checkout-toctou"))
2828
select checkout,
29-
"Insufficient protection against execution of untrusted code on a privileged workflow."
29+
"Insufficient protection against execution of untrusted code on a privileged workflow ($@).",
30+
event, event.getName()

ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ where
2424
check.protects(sink.getNode().asExpr(), event, "artifact-poisoning")
2525
)
2626
select sink.getNode(), source, sink,
27-
"Potential artifact poisoning in $@, which may be controlled by an external user.", sink,
28-
sink.getNode().toString()
27+
"Potential artifact poisoning in $@, which may be controlled by an external user ($@).", sink,
28+
sink.getNode().toString(), event, event.getName()

0 commit comments

Comments
 (0)