Skip to content

Commit c36ad7b

Browse files
committed
Adjust untrusted checkout actions queries
1 parent a84332a commit c36ad7b

7 files changed

Lines changed: 17 additions & 7 deletions

actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Certain triggers automatically grant a workflow elevated privileges:
2727
* An attacker forks the repository and adds malicious code (e.g., in the build script)
2828
* The attacker opens a PR from the fork, and, if needed, comments on the PR
2929
* The workflow in the base repository checks out the forked code
30-
* The workflow runs, (e.g. the build script etc.), which contains the malicious code
30+
* The workflow runs the malicious code
3131

3232
Please note that not only build scripts can be malicious code vectors. There is a large number of other possibilities. Some of them are listed in the [LOTP](https://boostsecurityio.github.io/lotp/) catalog.
3333

actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ where
5252
not exists(ControlCheck check | check.protects(checkout, event, "untrusted-checkout")) and
5353
not exists(ControlCheck check | check.protects(poisonable, event, "untrusted-checkout"))
5454
select poisonable, checkout, poisonable,
55-
"Potential execution of untrusted code on a privileged workflow ($@)", event, event.getName()
55+
"Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: $@)",
56+
event, event.getName()

actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Certain triggers automatically grant a workflow elevated privileges:
2727
* An attacker forks the repository and adds malicious code (e.g., in the build script)
2828
* The attacker opens a PR from the fork, and, if needed, comments on the PR
2929
* The workflow in the base repository checks out the forked code
30-
* The workflow runs, (e.g. the build script etc.), which contains the malicious code
30+
* The workflow runs the malicious code
3131

3232
Please note that not only build scripts can be malicious code vectors. There is a large number of other possibilities. Some of them are listed in the [LOTP](https://boostsecurityio.github.io/lotp/) catalog.
3333

actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Checkout of untrusted code in privileged context without privileged context use
2+
* @name Checkout of untrusted code in trusted context
33
* @description Privileged workflows have read/write access to the base repository and access to secrets.
44
* By explicitly checking out and running the build script from a fork the untrusted code is running in an environment
55
* that is able to push to the base repository and to access secrets.
@@ -42,5 +42,6 @@ where
4242
not event.getName() = "issue_comment" and
4343
not exists(ControlCheck check | check.protects(checkout, event, "untrusted-checkout"))
4444
)
45-
select checkout, "Potential execution of untrusted code on a privileged workflow ($@)", event,
46-
event.getName()
45+
select checkout,
46+
"Checkout of untrusted code in a privileged workflow with later potential execution (event trigger: $@)",
47+
event, event.getName()

actions/ql/src/Security/CWE-829/UntrustedCheckoutMedium.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Certain triggers automatically grant a workflow elevated privileges:
2727
* An attacker forks the repository and adds malicious code (e.g., in the build script)
2828
* The attacker opens a PR from the fork, and, if needed, comments on the PR
2929
* The workflow in the base repository checks out the forked code
30-
* The workflow runs, (e.g. the build script etc.), which contains the malicious code
30+
* The workflow runs the malicious code
3131

3232
Please note that not only build scripts can be malicious code vectors. There is a large number of other possibilities. Some of them are listed in the [LOTP](https://boostsecurityio.github.io/lotp/) catalog.
3333

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: fix
3+
---
4+
* Adjusted (minor) help file descriptions for queries: `actions/untrusted-checkout/critical`, `actions/untrusted-checkout/high`, `actions/untrusted-checkout/medium`. Clarified wording on in minor point.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: queryMetadata
3+
---
4+
* Reversed adjustment of the name of `actions/untrusted-checkout/high`.

0 commit comments

Comments
 (0)