Threat

Malicious File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware

Page published · Page updated

Dossier

Earliest dated coverage: 26 Oct 2026 · First observed: 26 Oct 2026 · Latest dated coverage: 26 Oct 2026

Coverage timeline

26 Oct 2026thehackernews.com

Single-source incident — one report is available.

Why it matters

Malicious AGENTS.md files can turn local engineering instructions into a malware-installation path through a coding agent's configuration and package-management capabilities.

Forever Security reported an attempted attack using a malicious AGENTS.md file in a developer's Downloads folder to direct an AI coding agent to modify its configuration and install the known-malicious npm package function-color. The company observed the attempt on a customer's machine and blocked it before code execution; the file's origin remained unknown.

exploited-vuln

Summary

Forever Security reportedly detected a malicious AGENTS.md in a developer's Downloads folder on a real customer machine. Disguised as engineering documentation, the file tried to make the customer's AI coding agent configure a server and install the known-malicious npm package function-color. Forever stopped the agent before any code ran. The file's delivery route was not determined, so neither successful malware execution nor browser-based delivery is established for this incident.[0]

The attempted abuse crosses a trust boundary between externally supplied files and agent instructions. Forever demonstrated that a web page could silently place an AGENTS.md into Downloads, then separately reproduced the captured file's behavior against Codex in an isolated virtual machine. The file targeted ~/.codex/config.toml, whose machine-wide session scope would extend the malicious server configuration beyond the initial folder. Forever reported malware execution in more than 90% of Codex reproduction attempts. The requested package belongs to a separately reported MALFEX chain in which function-color pulls in function-flag, which retrieves and runs a Windows payload; this association does not attribute the instruction-file placement to a named actor.[0]

A separate Claude Code demonstration showed a different consequence of instruction-file manipulation: a planted CLAUDE.md induced an API-endpoint change that could expose a session login token and allow a researcher-controlled server to supply commands as model responses. That demonstration required approval of a settings write and succeeded about half the time under the reported engineering-document framing. These laboratory outcomes must be distinguished from the blocked customer attempt. Forever's defensive emphasis was on launch-directory hygiene, instruction-file inspection, configuration review, approval controls, and token rotation—not an announced vendor patch.[0]

Attack chain

  1. 1. Malicious instruction file encountered: In the observed customer attempt, an AGENTS.md was present in the developer's Downloads folder and attempted to direct the coding agent. Its engineering-note presentation made the malicious directions appear to be routine setup guidance. How the file reached Downloads remains unknown; the browser-download route was demonstrated separately, not established as the incident's initial delivery mechanism.[0]
  2. 2. Agent configuration change requested: The captured attacker file instructed Codex to register a server in ~/.codex/config.toml. Forever reproduced this behavior in an isolated virtual machine. Because that configuration applies to every Codex session on the machine, a successful change would cause the server to load in later sessions opened from other folders. The article does not establish that this configuration change succeeded on the customer machine.[0]
  3. 3. Malicious package installation and execution attempted: The file also directed the agent to run a command that installed function-color from npm. Forever blocked the customer attempt before code execution. In its separate Codex reproductions using the real attacker file, the firm reported that the malware ran in more than 90% of attempts.[0]
  4. 4. Downstream downloader and Windows payload: The article describes the requested package's downstream behavior: function-color pulls in function-flag, which fetches and runs a Windows payload. This is reported package behavior associated with MALFEX, not a payload sequence observed executing on the protected customer endpoint.[0]

Disclosure timeline

DateEvent
2026-10-26The Hacker News published its account of Forever Security's blocked customer incident, browser-download proof of concept, and Codex and Claude Code reproductions. The supplied article does not give an exact incident-discovery date or an exact publication date for Forever's underlying report.[0]

How it works

The central mechanism is malicious instruction-file ingestion. Coding agents such as Codex read a folder's AGENTS.md as operational directions. In this case, an attacker-controlled plain-text file used ordinary engineering-document framing to request configuration changes and malicious package installation. The file's significance comes from how the agent interprets it, rather than from the Markdown file executing by itself.[0]

Forever identified a potential delivery-to-trust transition involving Downloads: a web page can save a file with selected contents and a selected name into that directory, while an agent started there may treat the resulting instruction file as authoritative. The firm demonstrated silent AGENTS.md placement with its own proof-of-concept page. It did not establish that a malicious web page delivered the file found on the customer machine.[0]

The Codex variant sought to turn a folder-level encounter into a broader configuration change. The captured file requested a server entry in ~/.codex/config.toml and a command installing function-color. The article states that this configuration applies to every Codex session on the machine, so the server could subsequently load outside Downloads. This cross-session effect was a consequence of the targeted configuration scope, not evidence that the customer's endpoint had already acquired persistence.[0]

The Claude Code variant was a separate researcher demonstration, not a confirmed second customer incident. A planted CLAUDE.md, framed as internal gateway setup, requested an ANTHROPIC_BASE_URL value in project settings that redirected API traffic to a server controlled by Forever. The report states that this exposes the session login token and allows the server to respond as though it were the model, including returning commands the agent executes.[0]

Approval behavior affected the Claude Code result: a person had to approve the settings write, and the agent often refused suspicious changes. Forever reported that lengthy engineering-document framing obtained approval about half the time. Its separate Codex result exceeded 90% malware execution in reproduction attempts. Neither percentage establishes a general success rate across deployments; the supplied article does not identify tested versions or sample sizes.[0]

Forever's assessment was that following a local instruction file is intended agent behavior, leaving nothing for OpenAI or Anthropic to patch in this scenario. That is the researcher's characterization, not a vendor patch-status confirmation. The evidence therefore supports an instruction-trust abuse narrative without establishing a CVE, a numbered vulnerable-version range, or a fixed release.[0]

Affected versions and patch status

ProductAffectedPatch status
OpenAI CodexThe captured malicious AGENTS.md was reproduced against Codex in an isolated virtual machine, targeting ~/.codex/config.toml and installation of function-color. The report gives no tested version or affected-version range.No fixed release is identified. Forever characterized the behavior as intended instruction-file processing rather than a defect requiring an OpenAI patch; the supplied evidence contains no vendor confirmation of that assessment.[0]
Anthropic Claude CodeA separate demonstration used CLAUDE.md to request an ANTHROPIC_BASE_URL change in project settings. The demonstrated write required human approval. No tested version or affected-version range is provided, and the article does not establish an observed customer attack using this variant.No fixed release is identified. Forever's stated position was that the scenario did not require an Anthropic patch; the supplied evidence contains no vendor patch announcement or confirmation.[0]

Indicators of Compromise

TypeIndicatorContext
otherfunction-colorKnown-malicious npm package requested by the captured attacker instruction file. Hunt for references in suspicious instruction files and agent-driven package installation activity; the customer attempt was blocked before code execution.[0]
otherfunction-flagDownloader package pulled in by function-color in the reported MALFEX package chain. The article states that it fetches and runs a Windows payload. Its execution was not observed on the protected customer endpoint.[0]
file-pathAGENTS.mdName of the actual malicious instruction file found in the customer's Downloads folder. Actionable when unexpectedly present there and containing server-configuration or function-color installation directions; the filename alone is legitimate and does not establish compromise.[0]

Key takeaways

  • The confirmed operational outcome was prevention: a malicious instruction file reached a customer machine, but Forever stopped the agent before any code ran. The article does not establish a successful customer compromise.[0]
  • Keep three evidence categories separate: the observed file-based attempt, the unconfirmed browser-delivery hypothesis demonstrated by proof of concept, and the laboratory results against Codex and Claude Code.[0]
  • Configuration scope determines potential impact. The Codex target could affect later sessions across folders, while the Claude Code demonstration showed that a project-level endpoint override could expose a live session token and subvert model responses.[0]
  • MALFEX is a reported association for the malicious npm package chain, not a grounded attribution of the Downloads-folder file placement to a named actor.[0]
  • Forever's telemetry suggests that the relevant workflow exists among its customers: about half reportedly run coding agents in Downloads, and roughly one quarter of agent sessions open a browser. Those figures should not be treated as industry-wide prevalence or attack-success measurements.[0]

Defensive actions

  • Do not start Codex, Claude Code, or other coding agents in ~/Downloads.: Forever's demonstrated delivery path relies on the browser's ability to place a file in Downloads and the agent subsequently trusting instructions from that folder. Avoiding this launch directory breaks that demonstrated combination, although browser delivery was not confirmed for the customer incident.[0]
  • Inspect unexpected AGENTS.md and CLAUDE.md files before allowing an agent to use the directory, including Downloads and newly cloned repositories.: The observed attack used an instruction file disguised as engineering notes, and the Claude Code reproduction used similar setup-document framing. Review should specifically identify unrequested server registration, package installation, and API-endpoint changes.[0]
  • Review ~/.codex/config.toml for server blocks or base-URL changes that the developer did not authorize.: The captured attacker file targeted this configuration, and its scope extends across Codex sessions in other folders. An unexpected entry can therefore matter beyond the directory where the malicious instructions were encountered.[0]
  • Review project .claude/settings.json files for an unexpected ANTHROPIC_BASE_URL or other API-endpoint override.: The Claude Code demonstration redirected API traffic through a project-settings change, exposing the session login token and allowing the receiving server to impersonate model responses.[0]
  • Keep approval prompts and sandboxes enabled, and scrutinize instructions that ask the agent to disable them.: Forever explicitly recommended retaining these controls. In the Claude Code demonstration, the malicious endpoint change required approval and was often refused when it appeared suspicious, making the settings-write decision a relevant defensive checkpoint.[0]
  • After discovering a planted instruction file, treat the associated login token as potentially exposed and rotate it, following Forever's advice.: The demonstrated endpoint-redirection variant can disclose a live session token, which the report describes as sufficient for account takeover. This is a precautionary response to possible exposure, not a finding that token theft occurred in the blocked customer attempt.[0]
  • Investigate and prevent agent-driven installation of function-color and its downloader dependency function-flag.: The captured file specifically requested function-color, and the reported package chain leads through function-flag to a Windows payload. These package names provide concrete investigation and prevention targets without relying on the unknown file-delivery infrastructure.[0]