Repository navigation
Description
Description
HIGH: Third-Party GitHub Action Not SHA-Pinned with Write Permissions
| Field | Value |
|---|---|
| Severity | High |
| CWE | CWE-1357 (Reliance on Insufficiently Trustworthy Component) |
| File | .github/workflows/docs-preview-pr.yaml |
| Line | 59 |
| Status | Active |
Description
The rossjrw/pr-preview-action@v1 GitHub Action is referenced by a mutable tag (v1) rather than a pinned commit SHA. This action runs in a workflow with contents: write and pull-requests: write permissions. If the action's repository is compromised (or the maintainer's account is taken over), the attacker gains write access to the NemoClaw repository contents and pull requests.
Vulnerable Code
# .github/workflows/docs-preview-pr.yaml
permissions:
contents: write # ← can push commits, create/delete branches
pull-requests: write # ← can comment on and modify PRs
jobs:
preview:
runs-on: ubuntu-latest
steps:
# ... build steps ...
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1 # ← mutable tag, individual contributor
with:
source-dir: ./docs/_build/html/
preview-branch: gh-pages
umbrella-dir: pr-preview
action: autoWhy mutable tags are dangerous
The @v1 tag can be moved to point at any commit at any time. Unlike commit SHAs, tags are mutable references. If rossjrw/pr-preview-action is compromised:
- The attacker pushes malicious code to the repo
- The attacker moves the
v1tag to the malicious commit - Every workflow run in NemoClaw now executes the attacker's code with
contents: writeandpull-requests: writepermissions
Why this action is higher risk
- Individual contributor repo —
rossjrwis a personal GitHub account, not a verified organization. A single compromised password or token exposes all downstream users. - Write permissions — The workflow grants
contents: write, which allows the action to push arbitrary commits to any branch, includingmain. - Trigger on PRs — The workflow runs on
pull_requestevents targetingmain, triggered by changes todocs/**,README.md,pyproject.toml,uv.lock, or.github/workflows/docs-preview-pr.yaml.
Contrast with other actions in the same file
The other actions are from verified organizations:
actions/checkout@v4— GitHub's official orgactions/setup-python@v5— GitHub's official orgastral-sh/setup-uv@v4— Astral (well-known, large user base)
These are still technically vulnerable to the same mutable-tag issue, but the risk is lower due to the organizations' security practices and larger blast radius (making compromise more visible).
Recommended Fix
Step 1: Pin to a specific commit SHA
- name: Deploy preview
uses: rossjrw/pr-preview-action@6b124108e79e9703b62e36741be77b55c3032a57 # v1.4.8
with:
source-dir: ./docs/_build/html/
preview-branch: gh-pages
umbrella-dir: pr-preview
action: autoTo find the current SHA:
gh api repos/rossjrw/pr-preview-action/git/refs/tags/v1 --jq '.object.sha'Step 2: Use Dependabot or Renovate for automated updates
Add to .github/dependabot.yml:
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"This will create PRs when new versions of pinned actions are available, so you get updates without the supply chain risk.
Step 3 (defense-in-depth): Scope permissions to the job
permissions: {} # no default permissions
jobs:
preview:
permissions:
contents: write
pull-requests: writeThis limits the blast radius to just the preview job rather than all jobs in the workflow (already the case here since there's only one job, but good practice).
Risk Assessment
- Impact: Full repository write access — an attacker could push malicious commits, modify CI/CD pipelines, alter release artifacts, or inject backdoors into the codebase
- Exploitability: Requires compromise of the
rossjrwGitHub account or thepr-preview-actionrepository. This is outside NVIDIA's control. - Blast radius: Affects the NemoClaw GitHub repository directly. Since the workflow has
contents: write, the attacker could modify any branch includingmain. - Mitigating factors: The workflow only triggers on PRs targeting
mainthat modifydocs/**,README.md,pyproject.toml,uv.lock, or the workflow file itself. GitHub's audit log would show unauthorized pushes. The action itself is relatively popular and open-source, making malicious changes more visible.
Reproduction Steps
Environment
Debug Output
-Logs
-Checklist
- I confirmed this bug is reproducible
- I searched existing issues and this is not a duplicate
Activity
fix: sha-pin all GitHub Actions to prevent supply chain attacks (NVID…
fix: sha-pin all GitHub Actions to prevent supply chain attacks (NVID…
fix: pin third-party GitHub Actions to commit SHAs
fix: pin third-party GitHub Actions to commit SHAs (#921)
fix: pin third-party GitHub Actions to commit SHAs (NVIDIA#921)