Hackers News Hackers News
  • CyberSecurity News
  • Threats
  • Attacks
  • Vulnerabilities
  • Breaches
  • Comparisons

Social Media

Hackers News Hackers News
  • CyberSecurity News
  • Threats
  • Attacks
  • Vulnerabilities
  • Breaches
  • Comparisons
Search the Site
Popular Searches:
technology Amazon AI
Recent Posts
Alibaba’s Qwen AI Said It Wouldn’t Execute Commands, Then Tried to Send Data to China
October 27, 2026
Critical HashiCorp Consul Kubernetes Flaw Allows Attackers to Gain Elevated Privileges
October 27, 2026
University of Copenhagen Data Breach Exposes 525,000 People’s Personal Data, Including Phone Numbers
October 27, 2026
Home/CyberSecurity News/Critical Flaw in OpenAI Codex, Claude Exposes Users to Code Injection
CyberSecurity News

Critical Flaw in OpenAI Codex, Claude Exposes Users to Code Injection

Key Takeaways A critical vulnerability allows malicious plain text files in the Downloads folder to manipulate AI coding agents like OpenAI Codex and Anthropic Claude. The flaw, impacting versions of...

Sarah simpson
Sarah simpson
October 26, 2026 4 Min Read
24 0

Key Takeaways

  • A critical vulnerability allows malicious plain text files in the Downloads folder to manipulate AI coding agents like OpenAI Codex and Anthropic Claude.
  • The flaw, impacting versions of Codex and Claude Code, enables attackers to inject commands, install malware, or exfiltrate sensitive data such as OAuth tokens.
  • The attack leverages the agents’ default behavior of reading configuration files (e.g., AGENTS.md, CLAUDE.md) from the current working directory, including the Downloads folder.
  • While user interaction is required to initiate the agent in the compromised directory, the vulnerability can lead to persistent compromise and remote code execution.

AI Coding Agents Vulnerable to Code Injection via Downloads Folder

Cybersecurity researchers have uncovered a critical vulnerability in leading AI coding agents, including OpenAI Codex and Anthropic Claude Code, that could allow attackers to inject malicious code, install malware, or steal sensitive user tokens. The flaw exploits the agents’ tendency to read configuration or instruction files from the user’s Downloads folder, a common location for untrusted web content.

Table Of Content

  • Key Takeaways
  • AI Coding Agents Vulnerable to Code Injection via Downloads Folder
  • The Genesis of the Attack: Malicious Markdown in Downloads
  • Codex Attack Achieves Persistence and Malware Installation
  • Claude Code Vulnerability Leads to Token Exposure
  • What You Should Do

The discovery was made by Forever Security after their systems intercepted an AI coding agent attempting to install a known malicious npm package on a customer’s machine. Subsequent investigations and controlled tests confirmed the existence of distinct attack vectors against both OpenAI Codex and Anthropic Claude Code.

The Genesis of the Attack: Malicious Markdown in Downloads

The incident began when Forever Security’s defenses blocked an AI coding agent from installing an npm package named function-color. Tracing the command, investigators found its origin in an AGENTS.md file located within the customer’s ~/Downloads directory. This file, despite appearing to be a standard set of engineering notes, contained carefully crafted instructions designed to alter the agent’s configuration and trigger the package installation.

Although the initial source of the malicious AGENTS.md file remains unconfirmed, researchers demonstrated that a similar file could be delivered to a user’s Downloads folder through typical browser download mechanisms, establishing a plausible pathway for exploitation. The danger stems from the combination of an AI agent’s trust in instruction files and the Downloads folder, where operating system security checks often overlook plain text files as non-executable threats.

AGENTS.md files function much like READMEs for AI tools, providing project rules, commands, and operational instructions that OpenAI’s documentation states Codex reads before commencing work. Similarly, Claude Code utilizes CLAUDE.md files for analogous purposes, parsing them at the start of a conversation.

It is important to note that this attack is not entirely automated. It requires the victim to either run the coding agent directly from the Downloads folder or configure it to process the malicious instruction file. Furthermore, the agent must possess sufficient permissions to modify files, execute commands, access the internet, or install software. Therefore, security measures such as approval prompts and sandboxing can significantly reduce the likelihood of a successful exploit.

Codex Attack Achieves Persistence and Malware Installation

In Forever Security’s controlled tests, OpenAI Codex was successfully manipulated in over 90% of attempts. The malicious instructions compelled Codex to add an MCP server entry to its machine-wide configuration file, ~/.codex/config.toml. This action then initiated a second Codex session with crucial security features, including approval and sandbox checks, deliberately disabled.

This configuration change established persistence, allowing subsequent Codex sessions to load the rogue server even if the user moved to a different project directory. While most tests used benign programs, the real malicious package was executed once within an isolated virtual machine. The package, function-color, is associated with MALFEX, an ongoing npm malware campaign targeting Windows developers. This campaign is known for delivering remote-access malware and exfiltrating sensitive data from browsers, Discord, Telegram, and cryptocurrency wallets.

Claude Code Vulnerability Leads to Token Exposure

Anthropic Claude Code required a different exploit method. Researchers crafted a malicious CLAUDE.md file instructing Claude to write an ANTHROPIC_BASE_URL value into its .claude/settings.json configuration. This redirection rerouted Claude’s API traffic to a server controlled by the researchers, thereby exposing OAuth tokens transmitted with the requests.

Forever Security reported that Claude made this critical configuration change in approximately half of their tests. By replaying a captured token against Anthropic’s service, the research team successfully gained unauthorized access as the victim. In some instances, the fake server also returned tool commands that resulted in code execution, with same-session execution via a helper agent succeeding in about 20% of cases.

This research underscores a growing concern regarding instruction files and add-ons as potential software supply-chain risks. Previous studies have demonstrated how malicious agent skills targeting Claude Code and Codex could evade automated scanning tools, highlighting the evolving threat landscape for AI-powered development environments.

What You Should Do

  • Avoid Running Agents in Downloads: Developers should never initiate Codex, Claude Code, or any other coding agent from within the Downloads directory.
  • Review Unknown Instruction Files: Before allowing an agent to access any folder, carefully review unknown AGENTS.md or CLAUDE.md files for suspicious content.
  • Maintain Security Controls: Keep approval checks and sandboxing features enabled for all AI agents. Limit agent network access to only necessary resources and avoid instructions that request unsafe bypass options.
  • Inspect Configuration Files: Security teams should regularly inspect ~/.codex/config.toml for unknown MCP server entries and review .claude/settings.json for any unfamiliar ANTHROPIC_BASE_URL or proxy settings.
  • Respond to Compromise: The discovery of function-color, unexpected agent settings, or redirected API traffic should be treated as a potential compromise. Immediately revoke affected tokens and connected credentials from a clean device. Isolate the compromised system and conduct a thorough malware scan.

Disclaimer: HackersRadar reports on cybersecurity threats and incidents for informational and awareness purposes only. We do not engage in hacking activities, data exfiltration, or the hosting or distribution of stolen or leaked information. All content is based on publicly available sources.

Tags:

AttackMalwareSecurity

Share Article

Sarah simpson

Sarah simpson

Sarah is a cybersecurity journalist specializing in threat intelligence and malware analysis. With over 8 years of experience covering APT groups, zero-day exploits, and advanced persistent threats, Sarah brings deep technical expertise to breaking cybersecurity news. Previously, she worked as a security researcher at leading threat intelligence firms, where she analyzed malware samples and tracked cybercriminal operations. Sarah holds a Master's degree in Computer Science with a focus on cybersecurity and is a regular contributor to major security conferences.

Previous Post

PHP patches critical CVE-2023-44487 HTTP/2 vulnerability

Next Post

PHP2Shell exploit code weaponized by hackers to target universities, businesses

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts
Apple iOS 27.2 Released With Fixes for 163 Vulnerabilities, Including Fix for Critical WebKit RCE
October 27, 2026
Top 10 Confidential Computing Platforms for 2026
October 27, 2026
OpenAI unveils GPT-6.1 Terra, an AI model with critical cybersecurity features
October 27, 2026
Top Authors
David kimber
David kimber
Marcus Rodriguez
Marcus Rodriguez
Jennifer sherman
Jennifer sherman
Let's Connect
156k
2.25m
285k

Related Posts

Jennifer sherman
By Jennifer sherman
Threats

GlassWorm Attacks macOS via Malicious VS Code…

January 1, 2026
Emy Elsamnoudy
By Emy Elsamnoudy
Attacks

ClickFix Attack Hides Malicious Code via Stegan Security

January 1, 2026
Sarah simpson
By Sarah simpson
Vulnerabilities

MongoBleed Detector Tool Released to Detect MongoDB Vulnerability(CVE-2025-14847)

January 1, 2026
Emy Elsamnoudy
By Emy Elsamnoudy
Breaches

Conti Ransomware Gang Leaders & Infrastructure Exposed

January 1, 2026
Hackers News Hackers News
  • [email protected]

Quick Links

  • Contact Us
  • Privacy Policy
  • Terms of service

Categories

Attacks
Breaches
Comparisons
CyberSecurity News
Threats
Vulnerabilities

Let's keep in touch

receive fresh updates and breaking cyber news every day and week!

All Rights Reserved by HackersRadar ©2026

Follow Us