Skip to content
NewA calmer, faster ZeroHour

Malicious AGENTS.md files in Downloads hijack Codex and Claude Code

Original title: AI coding agents hijacked using AGENTS.md file in Downloads folder

BleepingComputerby Bill Toulas ()4 min read
AI summary · x-ai/grok-4.7Summaries by Vani AI

A customer agent tried to install npm package function-color; tests also stole Claude Code OAuth tokens in about half of runs.

Forever Security found an AGENTS.md file in a customer’s Downloads folder, which was the coding agent’s working directory, directing it to install the npm package function-color. Reconstructed tests made OpenAI Codex run a harmless calculator payload in 90% of attempts. A CLAUDE.md file redirected Claude Code API traffic and exposed OAuth tokens in roughly half of tests. Researchers say OpenAI and Anthropic have nothing to patch because the agents are following their instruction files as designed.

Unconfirmed: How the malicious AGENTS.md reached the customer’s Downloads folder was not determined.

Key facts
  • Claude Code OAuth theft succeeded in roughly 50% of tests.
  • Codex opened a calculator in 90% of reconstructed tests.
  • Claude Code logged more than 1,300 sessions from Downloads among their customers.
  • Chrome, Edge, and Firefox save web downloads to Downloads without a save prompt.
  • Researchers could not determine how the customer’s AGENTS.md arrived.
Security assessment · AI, from the article

Impact: Rogue package install or theft of agent OAuth tokens

ProductAffected
OpenAI Codex—
Anthropic Claude Code—
What to do
  1. 1.Do not use ~/Downloads as an AI coding agent’s working directory.
  2. 2.Start agents in the specific project root rather than a broad directory.
  3. 3.Review unfamiliar AGENTS.md and CLAUDE.md files and keep approval prompts and sandboxing enabled.
Explain this AI news with Vani AIWhat was announced, what is new and why it matters, in a new chat

From the original article

4 min read at bleepingcomputer.com

Researchers found a malicious AGENTS markdown instruction file in a customer's Downloads folder that tricked an AI coding agent into installing a rogue npm package. [...]

BleepingComputer

By Bill Toulas · bleepingcomputer.com

Read the full article at BleepingComputer

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.