Skip to content

fix(ci): prevent auth bypass and command injection in Claude workflows#17560

Merged
wackerow merged 1 commit into
devfrom
patch-review-translations
Feb 14, 2026
Merged

fix(ci): prevent auth bypass and command injection in Claude workflows#17560
wackerow merged 1 commit into
devfrom
patch-review-translations

Conversation

@wackerow
Copy link
Copy Markdown
Member

Summary

Fixes two security vulnerabilities in the Claude workflow files (claude.yml and claude-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 like wacke, sm, or ip would 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's env: 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 dev branch has restrictions configured limiting pushes to the team. github-actions[bot] is not in this team, so direct writes to dev were 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.

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>
@wackerow wackerow merged commit fbf6482 into dev Feb 14, 2026
3 checks passed
@wackerow wackerow deleted the patch-review-translations branch February 14, 2026 23:54
@github-actions github-actions Bot added the tooling 🔧 Changes related to tooling of the project label Feb 14, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 15, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit fae3da7
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/69910b481310a900087e804d
😎 Deploy Preview https://deploy-preview-17560.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 60 (🟢 up 5 from production)
Accessibility: 94 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@wackerow wackerow restored the patch-review-translations branch February 15, 2026 16:11
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.
@pettinarip pettinarip mentioned this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant