Skip to content

Commit 8114071

Browse files
authored
Merge branch 'main' into models1
2 parents a25330e + 8d16d02 commit 8114071

File tree

499 files changed

+109391
-24453
lines changed

Some content is hidden

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

499 files changed

+109391
-24453
lines changed

.github/workflows/go-tests-other-os.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/go-tests-rtjo.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/go-tests.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
name: "Go: Run Tests"
22
on:
3-
push:
4-
paths:
5-
- "go/**"
6-
- "!go/documentation/**"
7-
- "shared/**"
8-
- .github/workflows/go-tests.yml
9-
- .github/actions/**
10-
- codeql-workspace.yml
11-
branches:
12-
- main
13-
- "rc/*"
143
pull_request:
154
paths:
165
- "go/**"
17-
- "!go/documentation/**"
6+
- "!go/documentation/**"
187
- "shared/**"
198
- .github/workflows/go-tests.yml
209
- .github/actions/**

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Environment Path Injection
2-
3-
## Description
1+
## Overview
42

53
GitHub Actions allow to define the system PATH variable by writing to a file pointed to by the `GITHUB_PATH` environment variable. Writing to this file appends a directory to the system PATH variable and automatically makes it available to all subsequent actions in the current job.
64

@@ -12,11 +10,11 @@ echo "$HOME/.local/bin" >> $GITHUB_PATH
1210

1311
If an attacker can control the contents of the system PATH, they are able to influence what commands are run in subsequent steps of the same job.
1412

15-
## Recommendations
13+
## Recommendation
1614

1715
Do not allow untrusted data to influence the system PATH: Avoid using untrusted data sources (e.g., artifact content) to define the system PATH.
1816

19-
## Examples
17+
## Example
2018

2119
### Incorrect Usage
2220

@@ -36,4 +34,4 @@ If an attacker can manipulate the value being set, such as through artifact down
3634
3735
## References
3836
39-
- [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions)
37+
- GitHub Docs: [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions).

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Environment Path Injection
2-
3-
## Description
1+
## Overview
42

53
GitHub Actions allow to define the system PATH variable by writing to a file pointed to by the `GITHUB_PATH` environment variable. Writing to this file appends a directory to the system PATH variable and automatically makes it available to all subsequent actions in the current job.
64

@@ -12,11 +10,11 @@ echo "$HOME/.local/bin" >> $GITHUB_PATH
1210

1311
If an attacker can control the contents of the system PATH, they are able to influence what commands are run in subsequent steps of the same job.
1412

15-
## Recommendations
13+
## Recommendation
1614

1715
Do not allow untrusted data to influence the system PATH: Avoid using untrusted data sources (e.g., artifact content) to define the system PATH.
1816

19-
## Examples
17+
## Example
2018

2119
### Incorrect Usage
2220

@@ -36,4 +34,4 @@ If an attacker can manipulate the value being set, such as through artifact down
3634
3735
## References
3836
39-
- [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions)
37+
- GitHub Docs: [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions).

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Environment Variable Injection
2-
3-
## Description
1+
## Overview
42

53
GitHub Actions allow to define environment variables by writing to a file pointed to by the `GITHUB_ENV` environment variable:
64

@@ -37,7 +35,7 @@ steps:
3735

3836
If an attacker can control the values assigned to environment variables and there is no sanitization in place, the attacker will be able to inject additional variables by injecting new lines or `{delimiters}`.
3937

40-
## Recommendations
38+
## Recommendation
4139

4240
1. **Do not allow untrusted data to influence environment variables**:
4341

@@ -64,7 +62,7 @@ If an attacker can control the values assigned to environment variables and ther
6462
} >> "$GITHUB_ENV"
6563
```
6664

67-
## Examples
65+
## Example
6866

6967
### Example of Vulnerability
7068

@@ -113,5 +111,5 @@ An attacker is be able to run arbitrary code by injecting environment variables
113111
114112
## References
115113
116-
- [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions)
117-
- [GitHub Actions Exploitation: Repo Jacking and Environment Manipulation](https://www.synacktiv.com/publications/github-actions-exploitation-repo-jacking-and-environment-manipulation)
114+
- GitHub Docs: [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions).
115+
- Synacktiv: [GitHub Actions Exploitation: Repo Jacking and Environment Manipulation](https://www.synacktiv.com/publications/github-actions-exploitation-repo-jacking-and-environment-manipulation).

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Environment Variable Injection
2-
3-
## Description
1+
## Overview
42

53
GitHub Actions allow to define environment variables by writing to a file pointed to by the `GITHUB_ENV` environment variable:
64

@@ -37,7 +35,7 @@ steps:
3735

3836
If an attacker can control the values assigned to environment variables and there is no sanitization in place, the attacker will be able to inject additional variables by injecting new lines or `{delimiters}`.
3937

40-
## Recommendations
38+
## Recommendation
4139

4240
1. **Do not allow untrusted data to influence environment variables**:
4341

@@ -64,7 +62,7 @@ If an attacker can control the values assigned to environment variables and ther
6462
} >> "$GITHUB_ENV"
6563
```
6664

67-
## Examples
65+
## Example
6866

6967
### Example of Vulnerability
7068

@@ -113,5 +111,5 @@ An attacker would be able to run arbitrary code by injecting environment variabl
113111
114112
## References
115113
116-
- [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions)
117-
- [GitHub Actions Exploitation: Repo Jacking and Environment Manipulation](https://www.synacktiv.com/publications/github-actions-exploitation-repo-jacking-and-environment-manipulation)
114+
- GitHub Docs: [Workflow commands for GitHub Actions](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions).
115+
- Synacktiv: [GitHub Actions Exploitation: Repo Jacking and Environment Manipulation](https://www.synacktiv.com/publications/github-actions-exploitation-repo-jacking-and-environment-manipulation).

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
# Code Injection in GitHub Actions
2-
3-
## Description
1+
## Overview
42

53
Using user-controlled input in GitHub Actions may lead to code injection in contexts like _run:_ or _script:_.
64

75
Code injection in GitHub Actions may allow an attacker to exfiltrate any secrets used in the workflow and the temporary GitHub repository authorization token. The token may have write access to the repository, allowing an attacker to make changes to the repository.
86

9-
## Recommendations
7+
## Recommendation
108

119
The best practice to avoid code injection vulnerabilities in GitHub workflows is to set the untrusted input value of the expression to an intermediate environment variable and then use the environment variable using the native syntax of the shell/script interpreter (that is, not _${{ env.VAR }}_).
1210

1311
It is also recommended to limit the permissions of any tokens used by a workflow such as the GITHUB_TOKEN.
1412

15-
## Examples
13+
## Example
1614

1715
### Incorrect Usage
1816

actions/ql/src/Security/CWE-094/CodeInjectionMedium.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
# Code Injection in GitHub Actions
2-
3-
## Description
1+
## Overview
42

53
Using user-controlled input in GitHub Actions may lead to code injection in contexts like _run:_ or _script:_.
64

75
Code injection in GitHub Actions may allow an attacker to exfiltrate any secrets used in the workflow and the temporary GitHub repository authorization token. The token may have write access to the repository, allowing an attacker to make changes to the repository.
86

9-
## Recommendations
7+
## Recommendation
108

119
The best practice to avoid code injection vulnerabilities in GitHub workflows is to set the untrusted input value of the expression to an intermediate environment variable and then use the environment variable using the native syntax of the shell/script interpreter (that is, not _${{ env.VAR }}_).
1210

1311
It is also recommended to limit the permissions of any tokens used by a workflow such as the GITHUB_TOKEN.
1412

15-
## Examples
13+
## Example
1614

1715
### Incorrect Usage
1816

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# Use of Actions with known vulnerabilities
2-
3-
## Description
1+
## Overview
42

53
The security of the workflow and the repository could be compromised by GitHub Actions workflows that utilize GitHub Actions with known vulnerabilities.
64

7-
## Recommendations
5+
## Recommendation
86

97
Either remove the component from the workflow or upgrade it to a version that is not vulnerable.
108

119
## References
1210

13-
- [GitHub Docs: Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)
11+
- GitHub Docs: [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot).

0 commit comments

Comments
 (0)