Skip to content

Commit 2c85353

Browse files
committed
Merge branch 'main' into http
2 parents f9f5d2c + 0b2e307 commit 2c85353

File tree

220 files changed

+32193
-31265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+32193
-31265
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* The "Unpinned tag for a non-immutable Action in workflow" query (`actions/unpinned-tag`) now supports expanding the trusted action owner list using data extensions (`extensible: trustedActionsOwnerDataModel`). If you trust an Action publisher, you can include the owner name/organization in a model pack to add it to the allow list for this query. This addition will prevent security alerts when using unpinned tags for Actions published by that owner. For more information on creating a model pack, see [Creating a CodeQL Model Pack](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/creating-and-working-with-codeql-packs#creating-a-codeql-model-pack).

actions/ql/lib/codeql/actions/Bash.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class BashShellScript extends ShellScript {
8181
"qstr:" + k + ":" + i + ":" + j + ":" + quotedStr.length() + ":" +
8282
quotedStr.regexpReplaceAll("[^a-zA-Z0-9]", "")
8383
)
84-
)
84+
) and
85+
// Only do this for strings that might otherwise disrupt subsequent parsing
86+
quotedStr.regexpMatch("[\"'].*[$\n\r'\"" + Bash::separator() + "].*[\"']")
8587
}
8688

8789
private predicate rankedQuotedStringReplacements(int i, string old, string new) {

actions/ql/lib/codeql/actions/config/Config.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ predicate vulnerableActionsDataModel(
126126
*/
127127
predicate immutableActionsDataModel(string action) { Extensions::immutableActionsDataModel(action) }
128128

129+
/**
130+
* MaD models for trusted actions owners
131+
* Fields:
132+
* - owner: owner name
133+
*/
134+
predicate trustedActionsOwnerDataModel(string owner) {
135+
Extensions::trustedActionsOwnerDataModel(owner)
136+
}
137+
129138
/**
130139
* MaD models for untrusted git commands
131140
* Fields:

actions/ql/lib/codeql/actions/config/ConfigExtensions.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ extensible predicate vulnerableActionsDataModel(
6363
*/
6464
extensible predicate immutableActionsDataModel(string action);
6565

66+
/**
67+
* Holds for trusted Actions owners.
68+
*/
69+
extensible predicate trustedActionsOwnerDataModel(string owner);
70+
6671
/**
6772
* Holds for git commands that may introduce untrusted data when called on an attacker controlled branch.
6873
*/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/actions-all
4+
extensible: trustedActionsOwnerDataModel
5+
data:
6+
- ["actions"]
7+
- ["github"]
8+
- ["advanced-security"]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @name PATH Enviroment Variable built from user-controlled sources
33
* @description Building the PATH environment variable from user-controlled sources may alter the execution of following system commands
44
* @kind path-problem
5-
* @problem.severity warning
5+
* @problem.severity error
66
* @security-severity 5.0
7-
* @precision high
7+
* @precision medium
88
* @id actions/envpath-injection/medium
99
* @tags actions
1010
* security

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @name Enviroment Variable built from user-controlled sources
33
* @description Building an environment variable from user-controlled sources may alter the execution of following system commands
44
* @kind path-problem
5-
* @problem.severity warning
5+
* @problem.severity error
66
* @security-severity 5.0
7-
* @precision high
7+
* @precision medium
88
* @id actions/envvar-injection/medium
99
* @tags actions
1010
* security

actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
* @description Workflows should contain permissions to provide a clear understanding has permissions to run the workflow.
44
* @kind problem
55
* @security-severity 5.0
6-
* @problem.severity recommendation
6+
* @problem.severity warning
77
* @precision high
88
* @id actions/missing-workflow-permissions
99
* @tags actions
1010
* maintainability
11+
* security
1112
* external/cwe/cwe-275
1213
*/
1314

actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* @name Excessive Secrets Exposure
33
* @description All organization and repository secrets are passed to the workflow runner.
44
* @kind problem
5-
* @problem.severity recommendation
5+
* @precision high
6+
* @problem.severity warning
67
* @id actions/excessive-secrets-exposure
78
* @tags actions
89
* security

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @name Artifact poisoning
33
* @description An attacker may be able to poison the workflow's artifacts and influence on consequent steps.
44
* @kind path-problem
5-
* @problem.severity warning
6-
* @precision high
5+
* @problem.severity error
6+
* @precision medium
77
* @security-severity 5.0
88
* @id actions/artifact-poisoning/medium
99
* @tags actions

0 commit comments

Comments
 (0)