Skip to content

security: fix audit findings (HIGH/MEDIUM)#20

Open
hinanohart wants to merge 1 commit into
mainfrom
security-fixes-2026-06-10
Open

security: fix audit findings (HIGH/MEDIUM)#20
hinanohart wants to merge 1 commit into
mainfrom
security-fixes-2026-06-10

Conversation

@hinanohart

Copy link
Copy Markdown
Owner

Security fix: shell injection in nightly-a100.yml

This PR addresses one verified MEDIUM finding from the security audit, plus accompanying mechanical CI hardening that the linter (zizmor) flagged on the same workflow.

Fixed

  1. [MEDIUM] Shell injection via workflow_dispatch input.github/workflows/nightly-a100.yml

    • The milestone input was interpolated by the Actions expression engine directly into the run: shell-script body (MILESTONE="${{ github.event.inputs.milestone || 'M1' }}"). An input such as "; <command>; echo " would execute arbitrary commands on the self-hosted A100 runner, which also exposes OSF_TOKEN and HF_TOKEN.
    • Fix: pass the input through env: MILESTONE: ... and reference "$MILESTONE" in the script (no inline expression expansion into the shell body), and validate it against an M1|M2|M3 allowlist via a case statement before it reaches the shell/exec sink.
  2. Accompanying mechanical hardening on the same workflow (flagged by zizmor on the edited file):

    • Added persist-credentials: false to the actions/checkout step (artipacked / credential persistence).
    • Pinned actions/setup-python to a309ff8b426b58ec0e2a45f0f869d46889d02405 (v6.2.0) and actions/upload-artifact to 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a (v7.0.1).
    • After these changes, zizmor .github/workflows/nightly-a100.yml reports no findings.

Verification

  • zizmor .github/workflows/nightly-a100.yml → No findings to report.
  • YAML parses cleanly (yaml.safe_load).

Deferred

  • zizmor reports pre-existing findings (unpinned actions, artipacked, dangerous-triggers, excessive-permissions) in other workflow files — ci.yml, claude-resume.yml, hf-deploy.yml, release.yml. These are outside the scope of this single audited finding and were intentionally not modified to avoid sweeping unrelated changes. They should be addressed in a dedicated follow-up.

Generated with Claude Code (https://claude.com/claude-code)

Pass the workflow_dispatch `milestone` input through an env var instead
of inline GitHub Actions expression expansion in the run-step body, and
validate it against an M1|M2|M3 allowlist before it reaches the shell/exec
sink. This closes a command-injection vector where an input such as
"; <command>; echo " would execute arbitrary commands on the self-hosted
A100 runner (which also exposes OSF_TOKEN/HF_TOKEN).

Also applied accompanying mechanical CI hardening flagged on the same
workflow: set persist-credentials: false on checkout, and pin
actions/setup-python and actions/upload-artifact to full commit SHAs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant