Slopsquatting
What is Slopsquatting?
SlopsquattingA 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code.
Slopsquatting is a software supply-chain attack discovered as LLM-driven coding assistants became mainstream. Researchers documented that models consistently invent plausible-but-nonexistent package names — for example a Python pandas helper, a Node logging library, or a Rust crate that sounds right but has never been published. Attackers register those hallucinated names on the relevant package registry (PyPI, npm, crates.io) with malicious payloads; when a developer follows the AI's suggested `pip install` or `npm install` command, the attacker's code runs in their build environment. The name 'slopsquatting' fuses 'AI slop' with typosquatting. Because the same hallucination tends to repeat across users and even across model versions, a single squatted name can harvest many victims over weeks. Defenses include human verification of every external dependency, deterministic lockfiles, allowlisted registries or proxy registries that block recently-registered packages, and IDE plugins that flag packages the assistant suggested but a curated registry hasn't seen.
● Examples
- 01
A coding assistant repeatedly suggests `pip install requests-helper`; an attacker registers that name on PyPI with a post-install hook that exfiltrates environment variables.
- 02
Internal policy requires that any dependency proposed by Copilot or Claude Code must exist on the proxy registry before it can be installed by CI.
● Frequently asked questions
What is Slopsquatting?
A 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code. It belongs to the AI & ML Security category of cybersecurity.
What does Slopsquatting mean?
A 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code.
How does Slopsquatting work?
Slopsquatting is a software supply-chain attack discovered as LLM-driven coding assistants became mainstream. Researchers documented that models consistently invent plausible-but-nonexistent package names — for example a Python pandas helper, a Node logging library, or a Rust crate that sounds right but has never been published. Attackers register those hallucinated names on the relevant package registry (PyPI, npm, crates.io) with malicious payloads; when a developer follows the AI's suggested `pip install` or `npm install` command, the attacker's code runs in their build environment. The name 'slopsquatting' fuses 'AI slop' with typosquatting. Because the same hallucination tends to repeat across users and even across model versions, a single squatted name can harvest many victims over weeks. Defenses include human verification of every external dependency, deterministic lockfiles, allowlisted registries or proxy registries that block recently-registered packages, and IDE plugins that flag packages the assistant suggested but a curated registry hasn't seen.
How do you defend against Slopsquatting?
Defences for Slopsquatting typically combine technical controls and operational practices, as detailed in the full definition above.
What are other names for Slopsquatting?
Common alternative names include: AI package hallucination attack, LLM package squatting.
● Related terms
- attacks№ 1234
Supply Chain Attack
An attack that compromises a trusted third-party software, hardware, or service provider in order to reach its downstream customers.
- attacks№ 1308
Typosquatting
Registering domain names or package names that are misspellings or visual look-alikes of legitimate ones, to catch users or developers who make typing or recognition errors.
- attacks№ 1307
Typosquatted Package
A malicious open-source package published under a name that closely resembles a popular library so that developers install it by mistake.
- attacks№ 719
Malicious npm Package
An npm package that contains hidden code designed to steal data, install malware, or compromise downstream applications when installed.
- ai-security№ 032
AI Hallucination
A failure mode in which a generative AI system outputs content that is fluent and confident but factually wrong, fabricated, or unsupported by its sources.
- appsec№ 1186
Software Supply Chain Security
The discipline of protecting every link of the software production chain - source, dependencies, build, signing, distribution, and deployment - against tampering, malicious code, and integrity loss.