AI coding agents fall for malicious instructions planted in the Downloads folder
A hidden file in the Downloads folder can trick AI coding agents into installing malicious software or stealing login tokens.
Overview
A malicious text file named AGENTS.md was found in a user's Downloads folder, where it tricked an AI coding agent into installing harmful software. This file contains instructions that AI tools are designed to trust and follow, allowing a website to plant commands without needing user approval. The attack targeted OpenAI's Codex, which executed the file's orders in more than 90% of test attempts. The malicious package, called function-color, had been hidden in a public code library for about two years before being detected. Because the file is plain text, standard operating system protections that block downloaded programs do not stop it from being read. The settings changed by the agent apply to the whole computer, meaning every future sessionAn active logged-in period of communication between a user or device and a server will run the attacker's command.
Terms in this story
- session
- An active logged-in period of communication between a user or device and a server. Once you log in to a website, the server tracks your session so you can click from page to page without retyping your password on every screen.
- npm package
- A reusable web code library published to the public npm registry for developers to install. Web developers pull in dozens of npm packages when building a site, and attackers frequently publish malicious packages with lookalike names to steal developer credentials during installation. Security+ objective 2.2 lists the term
- token
- A short-lived digital pass that a server gives a logged-in user or app. After you sign in once, your browser or app presents a token on each request, and if malware steals that token the attacker can act as you without knowing your password. Security+ objective 4.6 lists the term
- malware
- Software built to steal data, spy on users, lock files, or take control of a computer. News reports use malware as the umbrella term for viruses, ransomware, spyware, and trojans that criminals install on phones, laptops, or servers without permission. Security+ objective 2.4 lists the term
- executable
- A compiled program file that an operating system can load into memory and run directly. Most mail servers block attached executable files by default because double-clicking a compiled program lets it run whatever instructions the author wrote.
- JavaScript
- The programming language that web browsers run to make web pages interactive, and that also runs on servers. Because every browser runs JavaScript automatically when loading a page, attackers use malicious JavaScript in cross-site scripting, fake browser updates, and compromised software packages.
- Operating systems
- The core software on a computer or phone that manages hardware, files, memory, and running apps. Because every application relies on the operating system, a security flaw in the operating system itself affects millions of devices until users install a system update.
- virtual machine
- A software-emulated computer that runs its own operating system inside a shared physical server. Cloud providers run dozens of customer virtual machines on one physical server, and security researchers run malware samples inside a disposable virtual machine that they can reset afterward. Security+ objective 3.1 lists the term
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Help Net Security website. Cite the article, not this page.
Read the full article on Help Net Security (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Who is affected: "...a Forever customer..."
Copied word for word from the article - Security+ 2.2 Explain common threat vectors and attack surfaces.
"......AI coding agents into installing a malicious npm package or handing over the user's login token..." Found in the opening sentences - Security+ 4.6 Given a scenario, implement and maintain identity and access management.
"......npm package or handing over the user's login token when they're opened in that folder,..." Found in the opening sentences - CYBR 101 week 10: the web, cookies, phishing, incident response and logs
"A file that a website saves to the Downloads folder without approval..." Found in the opening sentences - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"AI coding agents fall for malicious instructions planted..." Found in the headline - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of malware.
"...trick AI coding agents into installing a malicious npm package..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role
Same story at other outlets
- Hackers Can Hijack OpenAI Codex and Claude Code Using Malicious Files in Downloads Folder
- Malicious downloads can trick AI coding agents into compromising themselves
- Hackers Can Hijack AI Agents Just by Planting Malicious Files in the Downloads Folder
- Malicious File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware
- AI coding agents hijacked using AGENTS.md file in Downloads folder