fix(ci): prevent auth bypass and command injection in Claude workflows#17560
Merged
Conversation
Replace substring-matching contains() with array-based exact matching in both claude.yml and claude-review-translations.yml to prevent unauthorized users with partial username matches from triggering workflows. Move github.event.comment.body from direct shell interpolation to env variable to prevent command injection via crafted PR comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
pettinarip
added a commit
that referenced
this pull request
Feb 16, 2026
Move remaining GitHub context values to env blocks to prevent potential shell injection. Add numeric validation for PR numbers before downstream usage. Extends the security fixes from #17560 to cover the "Get PR number" and "Post acknowledgment" steps that were not addressed in the original PR.
This was referenced Feb 16, 2026
Merged
Merged
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 two security vulnerabilities in the Claude workflow files (
claude.ymlandclaude-review-translations.yml) reported via responsible disclosure.1. Auth bypass via substring matching
contains('minimalsm,pettinarip,wackerow,nloureiro,konopkja', github.event.comment.user.login)performs string substring matching, meaning a GitHub user with a login likewacke,sm, oripwould pass the authorization check.Fix: Replaced with
contains(fromJSON('["minimalsm","pettinarip","wackerow","nloureiro","konopkja"]'), ...)which performs exact array element matching.claude-review-translations.yml: 3 locations (issue_comment, PR review comment, pull_request triggers)claude.yml: 4 locations (issue_comment, PR review comment, PR review, issues triggers)2. Command injection via shell interpolation
COMMENT_BODY="${{ github.event.comment.body }}"directly interpolated user-controlled comment content into a bash script. An attacker passing the (broken) auth check could execute arbitrary commands via$(malicious_command)in their comment body, enabling secret exfiltration.Fix: Moved all user-controlled values (
comment.body,event_name, workflow dispatch inputs) into the step'senv:block. Environment variables are not subject to shell expansion, preventing injection. Added input validation regex for the language parameter as defense-in-depth.Branch impact assessment
The
devbranch hasrestrictionsconfigured limiting pushes to the team.github-actions[bot]is not in this team, so direct writes todevwere not possible via this vector. Prior to thix fix, the command injection could have been used to exfiltrate repository secrets (ANTHROPIC_API_KEY, NETLIFY_TOKEN, etc.) and modify PR branch content. Both vectors are now closed.