# 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. 1. **Harvest** — prompt models with common coding tasks at scale. 2. **Collect** — record non-existent names that recur. 3. **Publish** — register them on npm/PyPI with install-time or import-time payloads. 4. **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 in `huggingface_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 of `jscodeshift` and `react-codemod`, hallucinated into vibe-coded agent skills (`react-modernization`, `dependency-upgrade`) that ran it via `npx`; 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 real `huggingface-cli`. - **~800-package npm RAT campaign** — OpenSourceMalware describes "AI slop squatted" names delivering WEL1DROPPER. - Caveat: the documented `huggingface-cli`/`react-codeshift` registrations 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 and Provenance|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 - [[raw/medium.com/slopsquatting-when-your-ai-assistant-invents-a-package-name-someone-el-12528|Slopsquatting: When Your AI Assistant Invents a Package Name, Someone Else Registers It]] - [[raw/ratnadeepdeyroy.medium.com/slopsquatting-when-ai-invents-a-package-name-and-attackers-register-it-15545|Slopsquatting: When AI Invents a Package Name and Attackers Register It]] - [[raw/okoone.com/why-slopsquatting-is-becoming-the-next-big-ai-software-supply-chain-ri-11015|Why slopsquatting is becoming the next big AI software supply chain risk]] - [[raw/unit42.paloaltonetworks.com/phantom-squatting-ai-hallucinated-domains-as-a-software-supply-chain-v-9992|Phantom Squatting: AI-Hallucinated Domains as a Software Supply Chain Vector (Unit 42)]] - [[raw/csoonline.com/supply-chain-attacks-take-aim-at-your-ai-coding-agents-7644|Supply chain attacks take aim at your AI coding agents]] - [[raw/snyk.io/the-89-problem-how-llms-are-resurrecting-the-dormant-majority-of-open-8809|The 89% Problem: How LLMs are resurrecting the dormant majority of open source]] - [[raw/a16z.com/et-tu-agent-did-you-install-the-backdoor-6897|Et Tu Agent? Did You Install the Backdoor?]] - [[raw/aquasec.com/what-is-a-dependency-confusion-attack-aqua-security-4469|What Is a Dependency Confusion Attack? (Aqua Security)]] - [[raw/thehackernews.com/nearly-800-malicious-npm-packages-deliver-cross-platform-rat-and-infos-11183|Nearly 800 malicious npm packages deliver cross-platform RAT and infostealer]] - [[raw/slsa.dev/defender-s-perspective-dep-confusion-and-typosquatting-slsa-4470|Defender's Perspective: Dep Confusion and Typosquatting (SLSA)]]