Slopsquatting
Registering package names (or domains — “phantom squatting”) that LLMs predictably hallucinate, so developers and coding agents that trust the model’s suggestion install or fetch attacker-controlled code.
How it works
Term coined by Seth Larson (PSF) in 2025. An LLM predicts a plausible-sounding dependency that does not exist; because hallucinations are repeatable, the attacker only needs to register the name once.
- Harvest — prompt models with common coding tasks at scale.
- Collect — record non-existent names that recur.
- Publish — register them on npm/PyPI with install-time or import-time payloads.
- Wait — a developer pastes
pip install <name>, or an agent runs it unattended.
Key numbers (UTSA / Virginia Tech / U. Oklahoma study, 16 code-gen models, 576,000 Python/JS samples, 2.23M package references):
- 19.7% of recommended packages did not exist — 205,474 unique fake names.
- Open-source models averaged 21.7%; commercial 5.2% (GPT-4 Turbo 3.59%).
- 43% of hallucinated names repeated across similar prompts; 38% resembled real libraries, 13% were typos of real names, 51% fully invented.
- ~8.7% of hallucinated Python names were real npm packages — cross-ecosystem confusion.
- Lower temperature reduced hallucination.
Coding agents amplify it: they install in seconds, often without surfacing the name, across many projects and inside CI. Hallucinated names also propagate through artifacts — READMEs, tutorials, and agent skills that invoke npx <name> — so a wrong name starts to look like consensus. See AI Coding Assistant Risks.
Phantom squatting (domains)
Unit 42 extended the pattern to web infrastructure: LLMs hallucinate brand portals, API endpoints and webhook URLs (e.g. hxxps://api.build-notifier[.]io/v1/pipeline/events) that attackers pre-register. Across 913 brands and 685,339 prompts (2.1M URLs) they found 13,229+ confirmed malicious URLs and ~250,000 still-unregistered hallucinated domains. Newly registered phantom domains have zero reputation, so blocklist/reputation URL filtering misses them; Unit 42 predicted attacker registrations 18–51 days in advance (e.g. the “Montana Empire” phishing kit, flagged 23 days before registration).
Adjacent: LLMO / knowledge injection
North Korea’s Famous Chollima (PromptMink, ReversingLabs) published bait packages with legit functionality and persuasive README text tuned to be chosen by agents — @solana-launchpad/sdk depending on infostealer @hash-validator/v2; later @validate-sdk/v2 with Node SEA payloads, then Rust NAPI-RS add-ons. A hackathon repo added the bait dependency in a commit co-authored by Claude Opus.
Notable cases
huggingface-cli(PyPI) — real tool ships inhuggingface_hub[cli]; Bar Lanyado (Lasso Security) registered the hallucinated name as an empty package and got 30,000+ downloads in three months; an Alibaba-linked README copied the bad install command.react-codeshift(npm, Jan 2026) — blend ofjscodeshiftandreact-codemod, hallucinated into vibe-coded agent skills (react-modernization,dependency-upgrade) that ran it vianpx; spread to 237 repos before Aikido’s Charlie Eriksen claimed it and saw immediate downloads.huggingface-cli-tool— Snyk’s example of a predicted hallucination near the realhuggingface-cli.- ~800-package npm RAT campaign — OpenSourceMalware describes “AI slop squatted” names delivering WEL1DROPPER.
- Caveat: the documented
huggingface-cli/react-codeshiftregistrations were benign researcher claims; one source notes no confirmed in-the-wild package slopsquatting attack as of mid-2026, though phantom-domain squatting is confirmed active.
Defenses
- Treat every assistant-written install line as unreviewed code; verify name, publisher, creation date, repo link and release history on the registry.
- Route agent and CI installs through an allowlisting proxy registry; unknown package → install fails and the agent must ask a human.
- Block brand-new packages (hold <30 days, or a shorter release-age gate).
--ignore-scripts, sandboxed installs without secrets, exact pins + hashed lockfiles; fail CI on new unapproved deps; diff the build SBOM against the previous build.- Pre-install gates such as Aikido SafeChain; combine name distance, package age and maintainer changes rather than any single signal.
- Maintainers: ask assistants how to install your tool; if they invent a name, register a clearly labeled placeholder pointing to the real package. Publish exact, tested install commands in docs.
- For phantom domains: don’t trust LLM-generated endpoints in code/config; verify domain ownership and age.
Related
- Software Supply Chain Security
- Typosquatting · Dependency Confusion · Malicious Packages
- AI Coding Assistant Risks · Agentic AI Risks · MCP Security
Sources
- Slopsquatting: When Your AI Assistant Invents a Package Name, Someone Else Registers It · original
- Slopsquatting: When AI Invents a Package Name and Attackers Register It · original
- Why slopsquatting is becoming the next big AI software supply chain risk · original
- Phantom Squatting: AI-Hallucinated Domains as a Software Supply Chain Vector (Unit 42) · original
- Supply chain attacks take aim at your AI coding agents · original
- The 89% Problem: How LLMs are resurrecting the dormant majority of open source · original
- Et Tu Agent? Did You Install the Backdoor? · original
- What Is a Dependency Confusion Attack? (Aqua Security) · original
- Nearly 800 malicious npm packages deliver cross-platform RAT and infostealer · original
- Defender's Perspective: Dep Confusion and Typosquatting (SLSA) · original