Repository navigation
B6n/console me - #223
B6n/console me#223mqarty wants to merge 76 commits into
Conversation
fix local build
Release to my npm
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
The release workflow trusts the mutable actions/setup-node@v4 tag. A repointed tag could execute attacker-controlled code before dependency installation and tamper with the repository or package release.
More details about this
actions/setup-node@v4 uses the mutable v4 tag rather than an immutable commit. If the actions/setup-node owner—or an attacker who compromises that repository—moves v4 to a malicious commit, the next push to main runs that code in the release job with contents: write permission.
A plausible attack is:
- An attacker repoints
actions/setup-node'sv4tag to a malicious implementation. - A maintainer pushes to
main, starting thisReleaseworkflow. - The malicious action runs before
npm ci, can alter the checked-out workspace or runner state, and can tamper withpackage.json, the lockfile, or scripts used bynpm ci. - Those changes execute during dependency installation or later release commands such as
npx changeset version; the job can then commit attacker-controlled changes through the workflow'scontents: writepermission. - The compromised release process can publish altered packages or persist malicious code in the repository. The workflow also validates and later uses
NPM_TOKEN, increasing the impact if the injected code runs in a step where that secret is available.
To resolve this comment:
✨ Commit fix suggestion
| uses: actions/setup-node@v4 | |
| uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
| - name: Setup Node | |
| # Replace with the verified 40-character commit SHA for actions/setup-node v4. | |
| uses: actions/setup-node@<VERIFIED_VALUE_REQUIRED> # v4 |
View step-by-step instructions
- Replace the mutable
setup-nodetag with the verified 40-character commit SHA for the intendedactions/setup-noderelease:uses: actions/setup-node@<40-character-commit-sha>. - Keep a version comment next to the SHA so the selected release remains clear, for example:
uses: actions/setup-node@<40-character-commit-sha> # v4.x.x. - Pin the
actions/checkout@v4step in the same workflow to its verified 40-character commit SHA as well, since it uses the same mutable-reference pattern. - Confirm that every external
uses:reference in this workflow either uses a full 40-character commit SHA or is a local action such as./...; do not use branch names or tags such as@v4.
💬 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 reasons
Alternatively, 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.
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
The release workflow trusts the mutable actions/checkout@v4 tag. If that tag is repointed, attacker-controlled action code runs in a job with repository write access and can alter the release process or repository contents.
More details about this
actions/checkout@v4 is a mutable tag in the Release workflow. The release job runs on pushes to main with contents: write, so the action owner could silently move v4 to a malicious commit without changing this repository.
A plausible attack is:
- An attacker compromises the
actions/checkoutrelease process and repointsv4to malicious code. - The next push to
mainstarts theVersion and Publishjob, and the malicious checkout code runs beforenpm ciand the later release steps. - Because this job has write access through its GitHub Actions token, the malicious action can read repository contents, alter files in the workspace, or push unauthorized changes back to the repository.
- It could also modify package or release configuration so that
npm ci,npx changeset version, or subsequent publishing steps execute attacker-controlled behavior. The compromise would affect every workflow run until the tag is moved back, with no change to this workflow file.
To resolve this comment:
✨ Commit fix suggestion
| uses: actions/checkout@v4 | |
| uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
View step-by-step instructions
- Replace the mutable checkout tag with the full 40-character commit SHA for the intended
actions/checkoutrelease:
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 - Pin
actions/setup-node@v4to the full 40-character commit SHA for the approved release as well, keeping a version comment for readability, for example:uses: actions/setup-node@<40-character-commit-sha> # v4. - Verify that each SHA comes from the action’s trusted upstream release or tag. Full commit SHAs prevent an action reference from changing silently when a tag or branch is repointed.
💬 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 reasons
Alternatively, 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.
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
Semgrep identified an issue in your code:
The workflow runs actions/checkout from the mutable v4 tag. If that tag is repointed, a pull request can execute attacker-controlled code with this job’s repository access and available credentials.
More details about this
actions/checkout@v4 uses the mutable v4 tag rather than an immutable commit SHA. GitHub resolves that tag when this workflow starts, so the action owner—or an attacker who compromises the action repository—could repoint v4 to a malicious commit. On a pull request targeting main, the changeset-required job would then execute the attacker-controlled checkout code before Validate changeset presence runs; that code could read workflow tokens, repository contents, or secrets available to the job and exfiltrate them.
A plausible attack is:
- An attacker gains control of the
actions/checkoutrepository or its release tag and changesv4to a malicious commit. - A pull request triggers
changeset-requiredonubuntu-latest. - The
uses: actions/checkout@v4step downloads and runs the malicious action. - The action abuses the job's permissions or tokens to send repository data or credentials to an attacker-controlled server, even though the shell commands in
Validate changeset presenceappear harmless.
To resolve this comment:
✨ Commit fix suggestion
| uses: actions/checkout@v4 | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 |
View step-by-step instructions
- Replace the mutable
v4reference with the full 40-character commit SHA for the reviewedactions/checkoutrelease:
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - Keep the existing
withconfiguration unchanged. Pinning the action to a commit prevents the action owner from silently changing the code selected by the workflow.
💬 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 reasons
Alternatively, 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.
Contributing to Twilio