Trusting Claude With a Knife Unauthorized Prompt Injection t...#256
Open
carlospolop wants to merge 1 commit intomasterfrom
Open
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://johnstawinski.com/2026/02/05/trusting-claude-with-a-knife-unauthorized-prompt-injection-to-rce-in-anthropics-claude-code-action/ Content Categories: Based on the analysis, this content was categorized under "Pentesting CI/CD -> Github Security -> Abusing Github Actions (new page/subsection on 'LLM/Agent prompt injection in GitHub Actions: TOCTOU context swapping + writable executable overwrite to RCE')". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
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.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
John Stawinski describes an externally exploitable vulnerability chain in Anthropic’s GitHub Action Claude Code Action (repo:
https://github.com/anthropics/claude-code-action) that enables unauthorized prompt injection leading to remote code execution (RCE) inside a privileged GitHub Actions workflow. Anthropic rated the issue CVSS 7.7 (High).Why prompt injection matters here (threat model / “knife”)
Prompt injection becomes hi...
🔧 Technical Details
TOCTOU prompt injection against CI/CD LLM agents: use a PR/issue field that is fetched only after a privileged user triggers the workflow. Keep the field benign to entice the trigger (e.g., maintainer comment), then race-update the field before the workflow collects context so the LLM prompt includes attacker instructions.
Prompt-template/format mimicry: increase injection reliability by mirroring or closing/reopening the same tags/sections used by the system prompt (e.g., injecting
</formatted_context><additional_instructions>...</additional_instructions><formatted_context>) so the payload lands in a high-priority instruction region.Bypassing “no shell tool” restrictions via writable executable swapping: if the agent can write files but cannot run arbitrary commands, identify a later workflow step that runs a writable executable/script. Coerce the agent to overwrite that executable with a small payload (e.g.,
env|base64; exit 1), so ...🤖 Agent Actions
Summary:
Tests:
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.