-
Notifications
You must be signed in to change notification settings - Fork 5
Upgrade actions/checkout and related actions to v7 #253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ jobs: | |||||
| MAYHEM_TOKEN: ${{ secrets.MAYHEM_TOKEN }} | ||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these should be pinned to a SHA, not a tag. Tags are not guaranteed to be immutable.
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
@@ -28,7 +28,7 @@ jobs: | |||||
| # make sure the action works on a clean machine without building | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too:
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
@@ -44,7 +44,7 @@ jobs: | |||||
| args: --image forallsecure/lighttpd:vulnerable --duration 60 | ||||||
|
|
||||||
| - name: Upload SARIF file(s) | ||||||
| uses: github/codeql-action/upload-sarif@v3 | ||||||
| uses: github/codeql-action/upload-sarif@v4 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't have a proper release outside of the bundle, so giving this one a pass |
||||||
| with: | ||||||
| sarif_file: out/sarif | ||||||
|
|
||||||
|
|
@@ -57,7 +57,7 @@ jobs: | |||||
| # make sure the action works on a clean machine without building | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too:
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
@@ -75,21 +75,21 @@ jobs: | |||||
| args: --image forallsecure/lighttpd:vulnerable --duration 60 | ||||||
|
|
||||||
| - name: Archive Coverage report | ||||||
| uses: actions/upload-artifact@v4 | ||||||
| uses: actions/upload-artifact@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| name: coverage-report | ||||||
| path: out/coverage/ | ||||||
| if-no-files-found: error | ||||||
|
|
||||||
| - name: Archive JUnit results | ||||||
| uses: actions/upload-artifact@v4 | ||||||
| uses: actions/upload-artifact@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| name: mcode-junit | ||||||
| path: out/junit/ | ||||||
| if-no-files-found: error | ||||||
|
|
||||||
| - name: Upload SARIF file(s) | ||||||
| uses: github/codeql-action/upload-sarif@v3 | ||||||
| uses: github/codeql-action/upload-sarif@v4 | ||||||
| with: | ||||||
| sarif_file: out/sarif | ||||||
|
|
||||||
|
|
@@ -102,7 +102,7 @@ jobs: | |||||
| # make sure the action works on a clean machine without building | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
@@ -125,7 +125,7 @@ jobs: | |||||
| test-override-inputs: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
@@ -154,7 +154,7 @@ jobs: | |||||
| # make sure the action works on a clean machine without building | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
| - uses: actions/checkout@v7 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| with: | ||||||
| # fetch entire history to compute diffs between jobs | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified an issue in your code:
GitHub Actions step uses mutable version tag
v1.17.3instead of a pinned commit SHA, allowing the action owner to silently redirect your workflow to malicious code via tag reassignment.More details about this
The step references
kunalnagarco/action-cve@v1.17.3using a version tag (v1.17.3) instead of a pinned commit SHA. Version tags are mutable—the owner can re-tagv1.17.3to point to different code at any time without any warning or notification to users. This creates a supply-chain attack vector where an attacker could compromise the repository, re-tag an older version to malicious code, and silently inject that code into your workflow on the next run.Here's how an attack could happen:
kunalnagarco/action-cverepository (through compromised credentials or social engineering)secrets.PERSONAL_ACCESS_TOKENorsecrets.SLACK_WEBHOOK)v1.17.3to point to their malicious commit instead of the original codeThe fix is to replace the version tag with the full 40-character commit SHA (e.g.,
uses: kunalnagarco/action-cve@<commit-sha>) so the action always runs the exact code you've audited, regardless of any tag changes.To resolve this comment:
✨ Commit fix suggestion
View step-by-step instructions
Replace the mutable action tag with a full 40-character commit SHA in the
usesline. Changekunalnagarco/action-cve@v1.17.3tokunalnagarco/action-cve@<full-40-character-commit-sha>.Keep the current version visible by adding the tag as a comment after the SHA, for example:
uses: kunalnagarco/action-cve@<full-40-character-commit-sha> # v1.17.3.Get the correct SHA from the action's
v1.17.3release or tag in thekunalnagarco/action-cverepository, and use the commit that the tag currently points to. Pinning to a commit SHA prevents the action owner from silently changing what code runs later.Leave the
with:values unchanged unless the pinned commit's release notes say the inputs changed.💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsAlternatively, triage in Semgrep AppSec Platform to ignore the finding created by github-actions-mutable-action-tag.
You can view more details about this finding in the Semgrep AppSec Platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on this one.