genai
SECURITY LAB
IncidentsMisinformation

Slopsquatting: When AI Invents Package Names Attackers Register

High severity2024–2025LLM07: MisinformationLLM04: Supply Chain
Status: Quantified at scale (USENIX Security 2025) and proven exploitable via a benign PoC
On this page

The model's confident wrong answer isn't just embarrassing — attackers can register it and ship malware.

When2024–2025
TargetSoftware supply chain (PyPI / npm)
ResearchersSpracklen et al. (USENIX '25); Lanyado (Lasso) PoC
Finding~19.7% of recommended packages hallucinated; predictable + repeatable
ImpactAttacker-registerable names → malware (a benign PoC drew 15k+ installs)
Attack flow
  1. 1A code assistant recommends installing a plausible-sounding package
  2. 2The package doesn't exist — but the hallucinated name is predictable and recurs
  3. 3An attacker registers that name with malware; developers install it

What happened

Code-generating LLMs frequently recommend software packages that don't exist. A USENIX Security 2025 study of 576,000 samples across 16 models found 19.7% of recommended packages were hallucinated — 205,474 unique non-existent names, many plausible look-alikes of real packages. Separately, Lasso's Bar Lanyado registered one name LLMs repeatedly hallucinated (“huggingface-cli”), which drew 15,000+ downloads and was even referenced in a real project's install instructions.

How it becomes an attack

Because the hallucinated names are predictable and recur across prompts, an attacker can pre-register them with malicious code — “slopsquatting.” A developer who trusts the assistant's install command pulls the attacker's package.

Root cause

Overreliance on confident model output for dependencies, combined with a supply chain where anyone can register a name.

What a control would catch

Verifying that a recommended package actually exists and is the intended, reputable one — before install — defeats the attack, as do lockfiles and allowlists.

How to prevent it

  • Verify every dependency exists and is the right one before installing.
  • Use lockfiles, allowlists, and private mirrors.
  • Don't blindly run an assistant's install commands.

Feel it yourselfThe replay lab gets an assistant to recommend a hallucinated package name — the slopsquatting class.

FAQ

What is package hallucination?

When a code assistant confidently tells you to install a package that doesn't exist. A USENIX Security 2025 study of 576,000 samples found 19.7% of recommended packages were hallucinated — 205,474 unique fake names.

How does it become an attack?

The hallucinated names are predictable and recur, so an attacker registers them with malicious code. A researcher registered one repeatedly-hallucinated name (“huggingface-cli”) as a benign PoC and it drew 15,000+ downloads.

How do developers defend?

Verify every dependency exists and is the intended one before installing; use lockfiles and allowlists; don't blindly run an assistant's install commands.

Replay this attack
Get an assistant to recommend a hallucinated package name an attacker could register — the slopsquatting class.
Open the live lab
Runs as a live, sandboxed lab. Sign-in required — this replay is a Pro lab. Recreates the attack class, not this exact branded bot.