Caught in the Hook RCE and API Token Exfiltration Through Cl...#1946
Merged
carlospolop merged 1 commit intomasterfrom Mar 4, 2026
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/ Content Categories: Based on the analysis, this content was categorized under "🤖 AI Security (add a page on AI CLI/agent supply-chain attacks via repo-controlled config: hooks/MCP consent bypass + endpoint/env var secret exfiltration) or 🤩 Generic Methodologies & Resources -> External Recon/Source Code Review (repo configuration poisoning / workspace trust model)". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
Collaborator
Author
|
merge |
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
Title/Context: Check Point Research analyzed Anthropic’s Claude Code (AI CLI dev agent) and found that repository-embedded configuration files can be weaponized as a supply-chain attack: a victim only needs to clone/open an untrusted repo and run
claude. Because Claude Code supports project-level config in.claude/settings.json(inside the repo) and MCP server config in.mcp.json🔧 Technical DetailsRepo-defined lifecycle hooks → silent shell execution: If a developer tool supports lifecycle Hooks defined in a repository file (e.g.,.claude/settings.json) and those Hooks execute shell commands (e.g., onSessionStart) without a per-command approval gate, an attacker can land supply-chain RCE by committing a hook that runs arbitrary OS commands when collaborators start the tool (e.g., swapping a benignopen -na Calculatorwith a payload download-and-exec / reverse shell).Consent bypass by making “auto-approval” settings repo-controlled (MCP): If a tool executes project-defined integration/server initialization commands (e.g., MCP servers from
.mcp.json), any setting that auto-enables/whitelists those integrations (e.g.,enableAllProjectMcpServers,enabledMcpjsonServers) must not be controllable by untrusted repository config. If it is, an attacker can forc...🤖 Agent Actions
Updated HackTricks with a new section covering Claude Code repo-controlled configuration poisoning and added the blog reference.
Changes
File modified
src/generic-methodologies-and-resources/phishing-methodology/ai-agent-abuse-local-ai-cli-tools-and-mcp.mdTests
If you want, I can also cross-link this section from
src/AI/AI-MCP-Servers.mdor tighten the defensive controls further.This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.