AI coding assistants tricked into installing malware
AI coding assistants can be tricked into installing malicious code by attackers who exploit the AI's tendency to invent fake names for popular tools. This happens when the AI suggests a fake package or repository name instead of the real one, and the developer follows the suggestion without checking.
- Report priority
- High
- Targets
- Python
How it works
- Attackers register fake package or repository names that an AI coding assistant is likely to invent when it does not know the correct name.
- When a developer asks the AI to fetch or install a popular tool, the AI may suggest the fake name instead, leading the developer to install the attacker's malicious version.
What to do
Check if you use AI coding assistants like GitHub Copilot, TabNine, or Amazon CodeWhisperer to install Python packages or repositories without manually verifying the names.
Only install packages or repositories by typing their names yourself or verifying them on official platforms like PyPI or GitHub before trusting an AI suggestion.
Technical details
Affected software: Python
A developer asks an AI coding assistant to install a popular Python package. The AI, unsure of the exact name, invents a fake name like 'requests-123' instead of the real 'requests'. The attacker has already registered this fake name on PyPI and uploaded a malicious version. The developer follows the AI's suggestion and installs the fake package, unknowingly running attacker-controlled code on their system.
Researchers disclosed HalluSquatting, a supply chain attack that exploits AI coding assistants' tendency to hallucinate incorrect resource names. By analyzing which fake identifiers an AI repeatedly generates when asked about popular repositories, plugins, or packages, attackers register those names in platforms like package registries or skill marketplaces. When developers request a legitimate tool, the AI may fetch the attacker's version instead, leading to remote tool execution or remote code execution (RCE).
The technique was detailed in the paper Beware of Agentic Botnets by Aya Spira, Stav Cohen, Elad Feldman, Ron Bitton, Avishai Wool, and Ben Nassi. Unlike traditional typosquatting or Slopsquatting, HalluSquatting targets AI-generated hallucinations rather than human errors.
References
- arxiv.org · 2607.07433 (2607.07433) VPNCentral
- thehackernews.com · new-hallusquatting-attack-could-trick.html VPNCentral
- trendaisecurity.com · slopsquatting-when-ai-agents-hallucinate-malicious-packages VPNCentral
- owasp.org · www-project-top-10-for-large-language-model-applications VPNCentral
- zerodayinitiative.com · ZDI-26-402 Zero Day Initiative
- exploit-db.com · 52615 Exploit-DB
- scworld.com · gitlost-prompt-injection-leaks-private-repos-via-github-agentic-workflows SC World
- snyk.io · agentic-development-security-ai-coding-risk Snyk
- stepsecurity.io · prevent-npm-and-python-supply-chain-attacks-on-developer-machines-with-package-configs StepSecurity
- cisecurity.org · multiple-vulnerabilities-in-adobe-products-could-allow-for-arbitrary-code-execution_2026-066 MS-ISAC
- cisecurity.org · multiple-vulnerabilities-in-mozilla-products-could-allow-for-arbitrary-code-execution_2026-065 MS-ISAC
- cisecurity.org · multiple-vulnerabilities-in-google-chrome-could-allow-for-arbitrary-code-execution_2026-064 MS-ISAC
- cisecurity.org · multiple-vulnerabilities-in-google-chrome-could-allow-for-arbitrary-code-execution_2026-063 MS-ISAC
- fortra.com · gentlemen-ransomware-what-you-need-know Graham Cluley
- thecyberexpress.com · rbi-says-ai-cyber-attacks-top-threat-to-banks The Cyber Express
- rbi.org.in · BS_PressReleaseDisplay.aspx The Cyber Express
- cyble.com · what-is-incident-response The Cyber Express
- cyble.com · different-types-of-threat-intelligence The Cyber Express
- thecyberexpress.com · ukraine-transfers-seized-crypto-assets The Cyber Express
- dbr.gov.ua · dbr-zabezpechilo-peredachu-v-upravlinnya-arma-areshtovanih-kriptoaktiviv-na-ponad-372-mln-griven The Cyber Express
- arma.gov.ua · arma-vpershe-priynyalo-v-upravlinnya-areshtovani-kriptoaktivi-na-gamanets-agentstva-nadiyshlo-ponad-83-mln-usdt The Cyber Express
- cyble.com · cybercrime The Cyber Express
- neuracybintel.com · claude-code-prompt-injection-poc-shows-how-clean-repos-can-hijack-developer-machines NeuraCybIntel
- securityweek.com · new-attack-abuses-claude-code-and-harmless-looking-repositories-to-hijack-developer-machines NeuraCybIntel
- tomshardware.com · ai-coding-agents-can-be-tricked-into-installing-malware-via-clean-github-repositories-mozillas-0din-team-shows-how-claude-code-can-be-exploited-by-its-own-helpfulness NeuraCybIntel
- anthropic.com · prompt-injection-defenses NeuraCybIntel
- openwall.com · 11 Openwall oss-security
- safedep.io · marketfront-dependency-confusion-campaign SafeDep
- thehackernews.com · npm-12-disables-install-scripts-by.html TheHackerNews
- wid.cert-bund.de · securityadvisory CERT-Bund Advisories
- infosecurity-magazine.com · researchers-first-agentic Infosecurity Magazine