{"id":3770,"date":"2026-10-26T07:58:53","date_gmt":"2026-10-26T07:58:53","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=3770"},"modified":"2026-10-26T07:58:53","modified_gmt":"2026-10-26T07:58:53","slug":"malicious-file-in-downloads-folder-tries-to-trick-ai-coding-agent-into-installing-malware","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=3770","title":{"rendered":"Malicious File in Downloads Folder Tries to Trick AI Coding Agent Into Installing Malware"},"content":{"rendered":"<div>\n<p><span class=\"p-author\"><i class=\"icon-font icon-user\">\ue804<\/i><span class=\"author\">Swati Khandelwal<\/span><i class=\"icon-font icon-calendar\">\ue802<\/i><span class=\"author\">Oct 26, 2026<\/span><\/span><span class=\"p-tags\">Artificial Intelligence \/ Endpoint Security<\/span><\/p>\n<\/div>\n<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEg6cUQufM8zcABLKEfGt5xpGX34mUnThXvptS6o1GfAv8Ak_FO__f-rsT0GPf1Nro1NSRQuUsEGJl1boXq5Rt-IMFOnHunESsqj4sfJ_ypu9qhRgva3V0OqPN04FAKvOw0Y0KeKUvgG_RzWvA7u6piuPvLIaTJG2mbeWRRgFJB2vziZdJbkU1dN2nfwBf8\/s1700-nu-rw-lo-l85-e365\/codex.png\" style=\"clear: left; display: block; float: left;  text-align: center;\"><\/a><\/div>\n<p>A malicious instruction file sitting in a developer&#8217;s Downloads folder tried to make their AI coding agent install a known-malicious npm package, security firm Forever Security said in a report published last week.<\/p>\n<p>The company caught the attempt on a real customer&#8217;s machine and stopped the agent before any code ran. It could not determine how the file got into the folder.<\/p>\n<p>The file was  AGENTS.md, a plain-text instructions file that a coding agent, such as OpenAI&#8217;s Codex, reads when it starts in a folder and follows as directions.<\/p>\n<p>It was dressed up as ordinary engineering notes. One section told the agent to add a server to its own configuration and install a package called function-color from npm.<\/p>\n<p>That package is part of a malware campaign that other researchers have documented separately: function-color pulls in a downloader called function-flag, which fetches and runs a Windows payload. Researchers at CloudSEK and Checkmarx, who <a href=\"https:\/\/checkmarx.com\/zero-post\/malfex-npm-malware-campaign-three-payloads-and-an-adversary-that-signs-their-work\/\" target=\"_blank\">analyzed the campaign<\/a>, named it MALFEX.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/ai-governance-platform-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhyu3ExJi2vbls3Z9aCvSrcqvhtsSOqXMOIxESfkx7uurTZb7rN3a2eQxwzgZ-j1ioplnCvQFTCYr8w3IUlYx0FrQzDaqQsBsUi885UYvHF3MjAObvO6ptvKBeX6zhQvzAi_KjmVno6a8bYI3Wozti5mHavNFGrekT_gC6JDVY8G3N-aV44-OZJGX9rlLng\/s728-nu-rw-lo-l85-e365\/nudge-1-d.png\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>Two things, each harmless on its own, make this work, Forever <a href=\"https:\/\/forever.security\/blog\/hijacking-ai-agents-via-downloads-folder\" rel=\"nofollow\" target=\"_blank\">said<\/a>. An agent is built to trust and obey the instructions file in the folder it opens. And a web page can save a file to the Downloads folder on its own, without a click or a permission prompt, choosing the name and contents. Put together, a web page can drop a file the agent will treat as orders into a folder the agent trusts.<\/p>\n<p><a name=\"more\"\/><\/p>\n<p>Researchers did not establish that this is how the file was caught. To test whether the full path was possible, it built its own proof-of-concept page: visit it, and an AGENTS.md downloads silently into Downloads. Whether a real attacker used that route against the customer is not known.<\/p>\n<p>The firm then reproduced the attack on two coding agents to show that it was not specific to a single product. Against Codex, it ran the real attacker file inside an isolated virtual machine. The file, framed as routine project setup, told Codex to register a server in ~\/.codex\/config.toml and run a command that installed the package.<\/p>\n<p><iframe loading=\"lazy\" title=\"Markdown is the new executable\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/FEHcJbTz16M?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Because that config file applies to every Codex session on the machine, the change would load the attacker&#8217;s server in any folder afterward, not just Downloads. Codex ran the malware in more than 90% of attempts, Forever said.<\/p>\n<p>Against Claude Code, the working attack looked different and succeeded less often. A planted CLAUDE.md, framed as internal gateway setup, tried to make Claude write an ANTHROPIC_BASE_URL into a project settings file, pointing its API traffic at a server Forever controlled. That one change leaks the session&#8217;s login token, which is account takeover on its own, and lets the server reply as if it were the model and hand back commands the agent runs.<\/p>\n<p>Claude needs a person to approve a write like that and often refuses one that looks wrong; the long engineering-doc framing got the write approved about half the time, researchers said.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/network-defense-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjVV2rRkX8tRMF6gCzemvQNpwFwGxRWxY1cJEYfoLLSj1EZYJOlj5WTR77t0i6kELXujYcaHTpRDqTjCbVHH5Pnh7wzxUiKP5j4dsDkWIMlp2bmpZsL0jeAsA_19pHH5UPtyBvNkZdyGEULOAsXPcraMP5CYjQRFefhXRSdEjYkrdcpUnc4ILcvcdEfAauE\/s728-nu-rw-lo-l85-e365\/tl-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>There is nothing for OpenAI or Anthropic to patch, in Forever&#8217;s view, because an agent following the instructions file in its folder is doing what it was built to do. The company compared it to a browser rendering a phishing page: the browser worked as designed, and the attack lies in the page. \u00abThere is nothing here for OpenAI or Anthropic to patch,\u00bb Forever said.<\/p>\n<h3>What to do<\/h3>\n<p>Forever&#8217;s advice is practical and needs no product:<\/p>\n<ul>\n<li>Do not start Codex, Claude Code, or any agent in ~\/Downloads. It is the one folder the web can write to on its own.<\/li>\n<li>Look for instructions files you did not write. A stray AGENTS.md or CLAUDE.md, in Downloads or in a repository you just cloned, is the whole attack. Read it before you let an agent near it.<\/li>\n<li>Check the agent&#8217;s own config. In ~\/.codex\/config.toml, watch for a server block or a changed base URL you did not add. In a project&#8217;s .claude\/settings.json, watch for an ANTHROPIC_BASE_URL or other API endpoint you did not set.<\/li>\n<li>Leave approval prompts and sandboxes on, and be wary of anything that tells the agent to switch them off.<\/li>\n<li>If you find a planted file, assume the login token leaked and rotate it. A stolen token is a live session, not just one caught request.<\/li>\n<\/ul>\n<p>In its own telemetry, Forever said that about half of its customers run a coding agent in their Downloads folder, and roughly a quarter of agent sessions open a browser.<\/p>\n<p>Those are the conditions the attack needs: an agent starts where the web can write, and, in many cases, an agent does the browsing itself, so no person is watching when a file arrives.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\ue804Swati Khandelwal\ue802Oct 26, 2026Artificial Intelligence \/ Endpoint Security A malicious instruction file sitting in a developer&#8217;s Downloads folder tried to make their AI coding agent install a known-malicious npm package,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3771,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[683,2025,1180,537,3932,2421,33,42,606],"class_list":["post-3770","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-agent","tag-coding","tag-downloads","tag-file","tag-folder","tag-installing","tag-malicious","tag-malware","tag-trick"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/3770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3770"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/3770\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/3771"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}