AI Coding Agents Vulnerable to 'HalluSquatting' Attacks
A new class of AI-driven attacks, dubbed HalluSquatting, Slopsquatting, and Phantom Squatting, exploits the tendency of AI coding agents to trust hallucinated package, repository, or domain names.

Security researchers have identified a significant vulnerability affecting AI coding agents, manifesting as a new class of attacks that have been given several names: Slopsquatting, Phantom Squatting, and HalluSquatting. At their core, these attacks exploit a fundamental flaw where AI agents, when prompted to fetch software components or access resources, can be tricked into trusting and acting upon hallucinated or non-existent names. This trust is then leveraged by attackers to inject malicious code into development pipelines, bypassing traditional security measures that rely on human verification or known malicious indicators.
The mechanism behind these attacks hinges on the probabilistic nature of Large Language Models (LLMs) used in AI coding agents. These models can generate predictable, albeit incorrect, names for software packages, repositories, or domains. Attackers can anticipate these hallucinations, register the predicted names, and set up malicious infrastructure. When an AI agent generates such a name and an automated process is given permission to fetch the associated resource, it can inadvertently download and execute malware. This bypasses the need for social engineering tactics like phishing or credential theft, as the attack relies on the AI's inherent trust in its own generated output.
Research presented by a team from Tel Aviv University, Technion, and Intuit demonstrated the predictability of these hallucinations across various AI coding tools, including Cursor, Windsurf, GitHub Copilot, and Gemini CLI. The study found that models hallucinated identical repository names up to 85% of the time and skill installation names 100% of the time. This high degree of predictability makes it a fertile ground for attackers seeking to compromise development workflows at scale.
While Slopsquatting and Phantom Squatting previously highlighted similar issues with fake package names and domains, HalluSquatting specifically targets the broader ecosystem of AI agents, including repositories and skills. The implications are significant, as these attacks can lead to the widespread compromise of development environments. Unlike traditional malware that might spread through specific exploits or worms, HalluSquatting leverages the AI agent itself as the delivery mechanism, potentially infecting numerous machines that rely on the compromised agent.
The vulnerability stems from a design principle often referred to as 'late binding,' where decisions about resources or code are made at runtime rather than compile time. In the context of AI coding agents, this means that generated names are often acted upon before their validity or source is thoroughly vetted. Developers, in their haste to accelerate product delivery, may grant these agents extensive permissions to download and execute code, creating a dangerous gap between text generation and code execution. This gap is exacerbated by the dynamic nature of software dependencies, where even legitimate top-level packages can pull in compromised transitive dependencies.
Traditional security backstops, such as SSL certificates and DNSSEC, offer little protection against these types of attacks. An attacker can easily obtain a valid SSL certificate for a maliciously registered domain, making it appear legitimate to automated systems. Furthermore, security scanners that examine stated claims rather than hidden payloads can be easily bypassed. The researchers emphasize that the demonstrated risks represent a minimum, as these attacks are expected to become more sophisticated and accurate over time.
To mitigate these risks, ActiveState, a provider of developer toolchains, suggests implementing robust defenses such as pre-fetch verification and governed dependency management. These strategies aim to introduce critical checkpoints where generated names and sources are rigorously validated before any code is fetched or executed. By enforcing stricter controls over the dependency resolution process, organizations can build more resilient development pipelines that are less susceptible to AI-driven supply chain attacks.
The proliferation of AI in software development presents immense opportunities for efficiency and innovation. However, as demonstrated by HalluSquatting and its predecessors, it also introduces novel attack vectors that require a re-evaluation of existing security paradigms. The industry must adapt by developing and implementing security measures that account for the unique vulnerabilities introduced by AI-powered coding assistants, ensuring that the pursuit of speed and automation does not compromise the integrity and security of software supply chains.