Hallucination Exploitation
Hallucination exploitation is an attack technique where adversaries take advantage of the tendency of AI models to fabricate information, such as inventing nonexistent software package names, by registering those fabricated names as real malicious packages. When developers follow AI-generated code suggestions that reference these hallucinated packages, they may unknowingly install attacker-controlled software. This represents a novel software supply chain threat that leverages the predictable nature of AI-generated errors.
Hallucination exploitation refers to a class of supply chain attacks in which threat actors identify software package names that large language models (LLMs) consistently hallucinate (fabricate with apparent confidence) and then register those names on public package registries with malicious payloads. Because LLMs can generate plausible but nonexistent package references across multiple programming languages, attackers can anticipate these hallucinated names through systematic analysis of model outputs and pre-register corresponding packages. The attack surface is shaped by the reproducibility and frequency of specific hallucinated package names across different models, prompt configurations, and language ecosystems. This technique, sometimes called slopsquatting, differs from traditional typosquatting in that it exploits AI-generated fabrications rather than human typographic errors, and its effectiveness depends on developer trust in AI-assisted code generation without independent verification of package provenance.
Why it matters
Hallucination exploitation represents a fundamentally new category of software supply chain attack that emerges directly from the widespread adoption of AI-assisted code generation. As developers increasingly rely on large language models to suggest code snippets, dependency lists, and package references, the fabricated but plausible-sounding package names these models produce become a predictable and exploitable attack surface. Unlike traditional typosquatting, which depends on developers making manual typing errors, hallucination exploitation leverages systematic patterns in AI model outputs, meaning the same fictitious package names may be suggested to thousands of developers independently.
The threat is amplified by the reproducibility of hallucinated package names. Research, including work published through USENIX, has demonstrated that LLMs can consistently hallucinate specific package names across repeated queries, different prompt configurations, and multiple programming language ecosystems. This reproducibility allows attackers to systematically identify high-frequency hallucinated names and pre-register them on public package registries (such as npm, PyPI, or RubyGems) with malicious payloads. When developers follow AI-generated recommendations without independently verifying package provenance, they risk installing attacker-controlled code into their projects.
This matters because it erodes a trust assumption that many development workflows now depend on: that AI-generated code suggestions reference real, legitimate software components. Organizations that lack verification controls for AI-suggested dependencies face exposure to malware injection, credential theft, and other supply chain compromises through a vector that did not exist before the era of LLM-assisted development.
Who it's relevant to
Inside Hallucination Exploitation
Common questions
Answers to the questions practitioners most commonly ask about Hallucination Exploitation.