Skip to content

HIGH: Third-Party GitHub Action Not SHA-Pinned with Write Permissions #578

Closed

Description

@ReterAI

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: auto

Why 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:

  1. The attacker pushes malicious code to the repo
  2. The attacker moves the v1 tag to the malicious commit
  3. Every workflow run in NemoClaw now executes the attacker's code with contents: write and pull-requests: write permissions

Why this action is higher risk

  • Individual contributor repo — rossjrw is 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, including main.
  • Trigger on PRs — The workflow runs on pull_request events targeting main, triggered by changes to docs/**, 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 org
  • actions/setup-python@v5 — GitHub's official org
  • astral-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: auto

To 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: write

This 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 rossjrw GitHub account or the pr-preview-action repository. 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 including main.
  • Mitigating factors: The workflow only triggers on PRs targeting main that modify docs/**, 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

  1. added a commit that references this issue on Mar 25, 2026
    9c875c5
  2. added a commit that references this issue on Mar 25, 2026
    66b9f55
  3. added a commit that references this issue on Apr 4, 2026
    99fed04
  4. added
    needs: triage
    and removed on Jun 3, 2026
  5. added theissue type on Jun 8, 2026
  6. added
    area: ci
    area: security
    and removed
    needs: triage
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciarea: security

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions