Fix GitHub Actions script injection RCE in sanitize.yml#40
Draft
Fix GitHub Actions script injection RCE in sanitize.yml#40
Conversation
Move changelog-reader-action outputs from direct ${{ }} interpolation
in shell run: block to env: block, preventing shell injection via
crafted CHANGELOG.md content in pull requests.
Agent-Logs-Url: https://github.com/commial/MLA/sessions/94386c10-0fb7-460f-bcff-a5ebe81eea1a
Co-authored-by: commial <4194483+commial@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate potential RCE 0-day vulnerability in file handling
Fix GitHub Actions script injection RCE in sanitize.yml
Mar 31, 2026
The POC demonstrates: - Vulnerable version: heredoc escape in CHANGELOG.md body achieves RCE - Fixed version: env: block safely passes values as data, preventing injection Includes poc.sh (runnable demo), malicious_changelog.md, and README.md writeup. Agent-Logs-Url: https://github.com/commial/MLA/sessions/078c5afc-c9d0-493e-a78f-1d75faeb3e71 Co-authored-by: commial <4194483+commial@users.noreply.github.com>
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.
The
changelog-formatjob interpolateschangelog-reader-actionoutputs directly into a shellrun:block via${{ }}. Thechangesoutput contains arbitrary multi-line markdown fromCHANGELOG.md, which is attacker-controlled onpull_requesttriggers. An attacker can terminate thecat << 'EOF'heredoc early and inject shell commands.Vulnerability
A crafted CHANGELOG entry with
EOFon its own line breaks the heredoc, and subsequent lines execute as shell commands on the runner.Fix
.github/workflows/sanitize.yml: Move${{ }}expressions fromrun:toenv:block so values are passed as data, not codeExploitability analysis
Only the
changesoutput is exploitable.versionis constrained to/[a-zA-Z0-9.\-+]+/by the action's parser, andstatusis one of four hardcoded strings.POC
poc/poc.sh— simulates the vulnerable and fixed workflow steps locally, confirming RCE in the original and safe handling in the fixpoc/malicious_changelog.md— example payloadpoc/README.md— full writeup