Skip to content

Commit 853fdf0

Browse files
author
Alvaro Muñoz
authored
Merge pull request #97 from github/rasmuswl/avoid-duplicate-code-injection-alerts
Suppress `actions/cache-poisoning/code-injection` alerts covered by `actions/code-injection/critical`
2 parents 4274673 + 726392c commit 853fdf0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ where
3030
check.protects(source.getNode().asExpr(), event, "code-injection")
3131
) and
3232
// excluding privileged workflows since they can be exploited in easier circumstances
33-
not job.isPrivileged() and
33+
// which is covered by `actions/code-injection/critical`
34+
not job.isPrivilegedExternallyTriggerable(event) and
3435
(
3536
// the workflow runs in the context of the default branch
3637
runsOnDefaultBranch(event)

ql/test/query-tests/Security/CWE-349/CachePoisoningViaCodeInjection.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ nodes
88
subpaths
99
#select
1010
| .github/workflows/code_injection1.yml:11:17:11:48 | github.event.comment.body | .github/workflows/code_injection1.yml:11:17:11:48 | github.event.comment.body | .github/workflows/code_injection1.yml:11:17:11:48 | github.event.comment.body | Unprivileged code injection in $@, which may lead to cache poisoning. | .github/workflows/code_injection1.yml:11:17:11:48 | github.event.comment.body | ${{ github.event.comment.body }} |
11-
| .github/workflows/code_injection2.yml:16:21:16:70 | steps.modified_files.outputs.files_modified | .github/workflows/code_injection2.yml:12:9:16:6 | Uses Step: modified_files | .github/workflows/code_injection2.yml:16:21:16:70 | steps.modified_files.outputs.files_modified | Unprivileged code injection in $@, which may lead to cache poisoning. | .github/workflows/code_injection2.yml:16:21:16:70 | steps.modified_files.outputs.files_modified | ${{ steps.modified_files.outputs.files_modified }} |

0 commit comments

Comments
 (0)