Skip to content

Commit 5d1da86

Browse files
author
Alvaro Muñoz
committed
fix: Use YamlScalar for booleans
1 parent 5df3af2 commit 5d1da86

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

javascript/ql/src/Security/CWE-312/ActionsArtifactLeak.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ActionsCheckoutStep extends Actions::Step {
2626
/**
2727
* A `with:`/`persist-credentials` field sibling to `uses: actions/checkout`.
2828
*/
29-
class ActionsCheckoutWithPersistCredentials extends YamlNode, YamlString {
29+
class ActionsCheckoutWithPersistCredentials extends YamlNode, YamlScalar {
3030
ActionsCheckoutStep step;
3131

3232
ActionsCheckoutWithPersistCredentials() {

javascript/ql/test/query-tests/Security/CWE-312/.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,26 @@ jobs:
6262
with:
6363
name: file
6464
path: foo
65+
test7: # NOT VULNERABLE
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
with:
70+
persist-credentials: false
71+
- name: "Upload artifact"
72+
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
73+
with:
74+
name: file
75+
path: .
76+
test8: # VULNERABLE
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
with:
81+
persist-credentials: true
82+
- name: "Upload artifact"
83+
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4.3.2
84+
with:
85+
name: file
86+
path: .
6587

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
| .github/workflows/test.yml:9:9:14:2 | name: " ... tifact" | A secret is exposed in an artifact uploaded by $@ | .github/workflows/test.yml:9:9:14:2 | name: " ... tifact" | actions/upload-artifact |
2-
| .github/workflows/test.yml:27:9:32:2 | name: " ... tifact" | A secret is exposed in an artifact uploaded by $@ | .github/workflows/test.yml:27:9:32:2 | name: " ... tifact" | actions/upload-artifact |
3-
| .github/workflows/test.yml:38:9:43:2 | name: " ... tifact" | A secret is exposed in an artifact uploaded by $@ | .github/workflows/test.yml:38:9:43:2 | name: " ... tifact" | actions/upload-artifact |
4-
| .github/workflows/test.yml:49:9:54:2 | name: " ... tifact" | A secret is exposed in an artifact uploaded by $@ | .github/workflows/test.yml:49:9:54:2 | name: " ... tifact" | actions/upload-artifact |
1+
| .github/workflows/test.yml:9:9:14:2 | name: " ... tifact" | A secret may be exposed in an artifact. |
2+
| .github/workflows/test.yml:27:9:32:2 | name: " ... tifact" | A secret may be exposed in an artifact. |
3+
| .github/workflows/test.yml:38:9:43:2 | name: " ... tifact" | A secret may be exposed in an artifact. |
4+
| .github/workflows/test.yml:49:9:54:2 | name: " ... tifact" | A secret may be exposed in an artifact. |
5+
| .github/workflows/test.yml:82:9:86:18 | name: " ... tifact" | A secret may be exposed in an artifact. |

0 commit comments

Comments
 (0)