Skip to content

Trusting Claude With a Knife Unauthorized Prompt Injection t...#256

Open
carlospolop wants to merge 1 commit intomasterfrom
update_Trusting_Claude_With_a_Knife__Unauthorized_Prompt__20260206_184722
Open

Trusting Claude With a Knife Unauthorized Prompt Injection t...#256
carlospolop wants to merge 1 commit intomasterfrom
update_Trusting_Claude_With_a_Knife__Unauthorized_Prompt__20260206_184722

Conversation

@carlospolop
Copy link
Collaborator

🤖 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:

  • Added a new subsection detailing Claude Code Action TOCTOU prompt injection leading to RCE via writable executable overwrite and prompt-format mimicry in the “AI Agent Prompt Injection” section of Abusing GitHub Actions.
  • Highlighted attacker workflow, payload example, privilege nuances, and resulting secret exfiltration/role-assumption impacts.

Tests:

  • Not run (not applicable).

This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.

@carlospolop
Copy link
Collaborator Author

🔗 Additional Context

Original 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:

  • MD Files Formatting: 575 files processed

Review Notes:

  • This content was automatically processed and may require human review for accuracy
  • Check that the placement within the repository structure is appropriate
  • Verify that all technical details are correct and up-to-date
  • All .md files have been checked for proper formatting (headers, includes, etc.)

Bot Version: HackTricks News Bot v1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant