Malicious downloads can trick AI coding agents into compromising themselves
Researchers found that malicious files in a Downloads folder can trick AI coding agents into installing malware and exposing authentication tokens.
Overview
Security researchers found that malicious instruction files can trick AI coding agents into installing malwareSoftware built to steal data, spy on users, lock files, or take control of a computer and weakening their built-in safeguards. These files, such as AGENTS.md or CLAUDE.md, are designed to guide AI assistants but can be abused to execute harmful code or expose authentication tokensA short-lived digital pass that a server gives a logged-in user or app. The attack works when an AI agent processes these files in a trusted directory, allowing it to bypass approval promptsThe text instruction or question a user or program sends to an artificial intelligence model and sandboxAn isolated test environment where a program can run without touching the rest of the computer restrictions. In tests, Codex followed the malicious instructions in more than 90% of cases, while Claude Code had its APIA structured interface that lets one software program request data or actions from another program traffic redirected in about half of the tests. This manipulation can lead to the exposure of sensitive data and the compromise of user accounts. Developers using these AI coding assistants are affected because their tools can be manipulated to perform unauthorized actions without their knowledge.
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
- authentication tokens
- 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
- authentication
- Verifying that a user, device, or program really is who it claims to be before allowing access. When you enter a password, scan a fingerprint, or present a key, authentication checks your identity before a server decides what your account is allowed to do.
- 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.
- sandbox
- An isolated test environment where a program can run without touching the rest of the computer. Web browsers run each tab inside a sandbox so a malicious page cannot read your personal files, and analysts detonate suspicious attachments in a sandbox to watch what they do. Security+ objective 4.1 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
- redirect
- A web flaw where a trusted site accepts an outside URL parameter and forwards visitors there. Attackers abuse an open redirect on a well-known website so the link in their email starts with a trusted domain name before forwarding the victim to a fake login page.
- 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
- MCP server
- A connector program that gives an AI assistant access to a specific database, file system, or web API. When a developer connects an AI agent to an MCP server, a bug or malicious prompt in that connector can let the agent run unintended shell commands or read private files.
- 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.
- 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.
- 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.
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 CSO Online website. Cite the article, not this page.
Read the full article on CSO Online (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 researchers found that trusted instruction files..." Found by reading the article; these exact words are in it - Who is affected: "...a customers machine..."
Copied word for word from the article - CYBR 101 week 2: the CIA triad, threat actors, risk and CVEs
"......agents into executing harmful code or exposing authentication tokens, Forever Security said after blocking an..." Found in the opening sentences - CYBR 101 week 6: AI, how it is attacked, and what it does for attackers and defenders
"Malicious downloads can trick AI coding agents into compromising themselves..." Found in the headline - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Skill in analyzing anomalous code as malicious or benign.
"...trick AI coding agents into executing harmful code..." Found by reading the article; these exact words are in it - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of malware.
"...install malware, redirect API traffic..." 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
- 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