Back
Ars TechnicaPolicyArs Technica2026-07-08

HalluSquatting: How LLMs Help Hackers Build Botnets

A new attack technique called HalluSquatting exploits LLMs' tendency to hallucinate package names and URLs, letting hackers register those fake dependencies and turn popular AI tools into unwitting botnet assemblers. Nine of the most widely used AI coding assistants are confirmed vulnerable.

Original source

Security researchers have documented a novel attack vector called HalluSquatting, which weaponizes a well-known LLM failure mode — hallucination — to distribute malicious code at scale. When AI coding tools confidently suggest packages or dependencies that don't exist, attackers pre-register those hallucinated names on package registries like npm and PyPI with malicious payloads. Developers who follow the AI's advice install the attacker's code without knowing the package was fabricated.

The attack is structurally different from traditional typosquatting. Typosquatting relies on human error — a mistyped keystroke. HalluSquatting relies on model error, which is deterministic and repeatable: the same prompt reliably produces the same hallucinated package name across users. That reproducibility means attackers can pre-stage malicious packages before anyone even asks the question, then wait for the LLM to route developers to them at scale.

Researchers tested nine popular AI coding tools — including widely deployed assistants used in enterprise environments — and found all nine would recommend at least one hallucinated package that had been registered with a malicious payload under the right conditions. The attack surface scales with adoption: the more developers use AI-assisted coding, the larger the potential botnet recruitment surface becomes.

The fix is non-trivial. Retrieval-augmented approaches and live package validation can reduce hallucination rates but don't eliminate them. Model providers would need to implement real-time registry lookups before surfacing any package recommendation, adding latency and infrastructure cost. Until that becomes standard, developers using AI coding assistants should treat every suggested dependency as untrusted and verify existence and authenticity independently before installation.

Panel Takes

The Builder

The Builder

Developer Perspective

This is a supply chain attack that scales because the LLM is doing the typo for you, predictably and repeatably — which means an attacker can pre-seed the registry before a single developer ever makes a request. The fix is straightforward to describe and annoying to implement: every package recommendation needs a live registry existence check before it surfaces in the UI, which means every coding assistant now needs a network call in the hot path. Until that's shipped, the correct default is treating every AI-suggested dependency like a URL in a phishing email — verify out-of-band, always.

The Skeptic

The Skeptic

Reality Check

The research is real and the mechanism is sound, but let's be precise about what 'nine popular AI tools are vulnerable' actually means — it means that under crafted prompts, all nine will sometimes hallucinate package names that an attacker could squat. The question nobody's answering clearly is the base rate: how often does this happen on organic, unprompted developer queries versus adversarially constructed ones? If the attack requires prompt engineering to trigger reliably, the threat model is narrower than the headline suggests. What kills this story in 12 months is model providers shipping registry validation natively, at which point this becomes a historical footnote rather than an ongoing crisis.

The Futurist

The Futurist

Big Picture

The thesis HalluSquatting validates is this: as AI agents write and execute more code autonomously, every hallucination failure mode becomes an active attack surface, not just a quality problem. The second-order effect here isn't botnets — it's that enterprises now have a legitimate, board-level reason to gate all AI-generated code through a dependency validation pipeline, which creates a new infrastructure category overnight. This attack is early on the trend line of AI-native supply chain compromise; the more autonomous the coding agent, the higher the blast radius, and we're actively moving toward more autonomy.

The PM

The PM

Product Strategy

The job-to-be-done for AI coding assistants is 'help me write working, safe code faster' — and this research shows that 'safe' part of the job is currently unshipped. A package suggestion without a registry existence check isn't a complete feature; it's a half-product that requires the developer to maintain the old verification workflow alongside the new AI one, which is exactly the dual-wielding problem that kills adoption trust. The product decision that would fix this is simple: never surface a package name you haven't confirmed exists on the target registry in the last 24 hours, and show that verification status inline.

Bookmarks

Loading bookmarks...

No bookmarks yet

Bookmark tools to save them for later