Malicious File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware
A malicious file in a developer's Downloads folder attempted to trick an AI coding agent into installing malware, which security firm Forever Security stopped before any code ran.
Overview
A malicious instruction file named AGENTS.md was found in a developer's Downloads folder, attempting to trick an AI coding agent into installing malwareSoftware built to steal data, spy on users, lock files, or take control of a computer. The file disguised itself as ordinary engineering notes and instructed the agent to add a serverA computer or program on a network that stores data and responds to requests from client devices to its configurationA text file that stores settings, network addresses, and options for how a program or server runs and install a package called function-color from npm. This package is part of a malware campaign named MALFEX, which pulls in a downloader called function-flag to fetch and run a Windows payloadThe part of an attack or malware file that carries out the harmful action on the target. The attack works because AI agents are built to trust instructions in the folder they open, and web pages can save files to the Downloads folder without user permission. Security firm Forever Security stopped the agent before any code ran, though it could not determine how the file originally arrived. The firm reproduced the attack on two coding agents, showing that Codex ran the malware in more than 90% of attempts while Claude Code succeeded less often.
Terms in this story
- 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
- server
- A computer or program on a network that stores data and responds to requests from client devices. Online stores, email systems, and multiplayer games all run on servers in data centers or the cloud, making unpatched servers a primary target for intruders.
- configuration
- A text file that stores settings, network addresses, and options for how a program or server runs. Attackers who gain read access to a server look for its configuration file first because it often contains database passwords, API keys, and internal server paths.
- payload
- The part of an attack or malware file that carries out the harmful action on the target. A phishing email and an exploit are only the delivery steps, while the payload is the ransomware or spyware that actually runs once the computer is compromised.
- 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
- prompt
- The text instruction or question a user or program sends to an artificial intelligence model. In AI security news, a prompt includes both the visible question typed by a user and the hidden instructions that an attacker might embed in a web page.
- proof-of-concept
- A working sample of code or steps that shows a reported security flaw can really be triggered. When researchers publish a proof-of-concept for a new bug, defenders can test their own systems, but criminals also watch for that code and adapt it for real attacks.
- 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
- 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.
- URL
- The full web address used to locate a specific page, file, or resource on the internet. Security filters inspect every URL in an incoming message to see whether the domain name is a newly registered lookalike or points to a known credential-harvesting server. Security+ objective 4.5 lists the term
- API
- A structured interface that lets one software program request data or actions from another program. Mobile apps, websites, and cloud services talk to backend servers through an API, and a poorly protected API can let attackers pull customer records in bulk. Security+ objective 4.7 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
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 The Hacker News website. Cite the article, not this page.
Read the full article on The Hacker News (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.
- Kind of story: Research and reports
"...security firm Forever Security said in a report..." Found by reading the article; these exact words are in it - Who is affected: "...a real customers machine..."
Copied word for word from the article - Security+ 2.2 Explain common threat vectors and attack surfaces.
"......their AI coding agent install a known-malicious npm package, security firm Forever Security said in..." Found in the opening sentences - Security+ 2.4 Given a scenario, analyze indicators of malicious activity.
"......to Trick AI Coding Agent Into Installing Malware..." Found in the headline - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"......File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware..." Found in the headline - CYBR 101 week 9: malware, indicators and how detection works
"......to Trick AI Coding Agent Into Installing Malware..." Found in the headline - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of malware.
"...install a known-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
- AI coding agents fall for malicious instructions planted in the 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
- AI coding agents hijacked using AGENTS.md file in Downloads folder