Claude Code Repo Attack Exposes a Bigger Agent Trust Problem
- Aisha Washington

- Jun 29
- 4 min read
Claude Code executed code from an unseen setup script inside a normal GitHub repository.
Security researchers Jordan Hale and Priya Singh, reporting through Mozilla's 0DIN bounty platform, discovered the path; the script pulled commands from a DNS record at runtime. No malicious file stayed inside the repository itself. Scanners and code reviews missed it. AI coding agents missed it too. As noted by The Verge in coverage of emerging agent threats, the dynamic payload evaded static detection.
Developers who opened the repository in Claude Code triggered the chain. The agent hit an expected error message during setup. It then ran the hidden script. That action opened a reverse shell. Attackers gained access to API keys, credentials, and persistent control.
The incident shows a trust gap that grows as agents handle more setup tasks without explicit checks.
Hidden Commands Reach Agents Through Normal Workflows
The attack relied on a standard setup instruction that many repositories already use. The malicious entry pointed to a DNS record that returned fresh commands each time the script ran. Because the payload never lived in the repo, static tools found nothing to flag.
Claude Code followed its normal pattern after seeing a setup error. It treated the script as part of the expected workflow. The agent did not surface the script contents for review. The reverse shell started inside the developer's environment. A comparable hypothetical scenario involves an anonymized developer who cloned a promising open-source utility, encountered a standard “npm install” failure in the terminal, and watched the agent fetch and execute an external bootstrap script from a DNS TXT record without first printing its contents for review - silently opening a reverse shell before any human noticed the anomaly.
Researchers from the 0DIN platform reproduced the flow and reported it through the bounty program. They noted that any agent given permission to run terminal commands faces the same exposure when it encounters similar setup files.
Agents Now Hold Direct Access to Developer Machines
Teams adopted Claude Code to speed up onboarding and reduce manual setup steps. The same agent that now edits code and installs dependencies also runs commands on the host machine. That scope makes the trust decision more consequential than earlier autocomplete tools.
When the agent acts without showing intermediate files or confirming intent, an attacker only needs one plausible error message. The payload arrives after that confirmation is already granted by the workflow.
Security teams track similar patterns in other agents. The common element is default execution rights paired with limited visibility into what the agent actually runs.
The Core Gap Is Missing Verification Steps Before Execution
Current agents receive repository context through file lists and error logs. They do not receive a required step to display setup scripts or DNS-sourced commands. Without that step, the distinction between trusted and untrusted input disappears at the moment of execution.
Some AI developers argue the risks remain manageable through existing sandbox configurations, yet researchers from 0DIN maintain that visibility gaps persist. Researchers recommended that agents surface every script marked for setup before running it. Developers were advised to treat any third-party repository setup instructions as untrusted code until manually reviewed.
The change requires both sides. Agents must add explicit display and confirmation rules. Developers must adjust workflows so that agent actions remain visible rather than automatic.
Similar Risks Appear Across Other Coding Agents
Other tools that combine repository access with terminal execution share the exposure. The attack vector does not depend on Claude Code specific code. It depends on any system that runs setup commands without first showing the full content and source.
Enterprise environments already maintain allow lists for dependencies and scripts. Agent workflows often bypass those lists because the agent operates inside the developer's local shell. The result is a gap between existing policy and actual agent behavior.
Teams that add agents to their stack need to map which actions remain visible to the human and which actions run without review.
Future Agent Designs Must Separate Context From Execution Rights
The reported incident points to a design choice that future agents will need to revisit. Context retrieval and command execution were combined under the same permission set. That combination worked for single-file edits but creates new risk once setup scripts and external data sources enter the flow.
A clearer separation would require agents to request permission categories. One category would cover reading files and suggesting edits. Another category would cover running terminal commands that touch network sources or install packages. Developers could then grant the second category only after manual checks.
No timeline exists yet for such changes in current products. The practical step today is to keep command execution behind an explicit confirmation layer that displays every script the agent plans to run.
What Teams Can Do While Tool Changes Are Pending
Developers can insert a manual review gate before any agent runs setup instructions from external repositories. The gate can be as simple as requiring the agent to print the full script and wait for an approval command.
Security teams can add monitoring for unexpected reverse shell or credential access patterns on developer machines that use coding agents. The same monitoring already exists for other local tooling.
Repositories themselves can move away from setup scripts that fetch external commands. When that pattern is required, the commands can be pinned to explicit values inside the repository rather than pulled at runtime.
These steps reduce the surface until agents themselves adopt display and confirmation requirements.


