Safety & privacy
What is slopsquatting? Fake AI packages explained
Slopsquatting is when attackers publish malicious packages under names AI coding tools invent. Learn why it happens and six checks before installing a package.
By the GenKid team · · Updated · Facts checked · 4 min read
Key takeaways
- Slopsquatting is when attackers publish malicious packages under names that AI coding tools invent, so that people who install the AI's suggestion get the attacker's code.
- A dependency (or package) is someone else's code your app uses, installed from a public registry.
- In one study, about a fifth of the packages suggested by the AI models tested didn't exist, though the rate varied a lot: about 5% for commercial models and about 22% for open-source ones.
- Software supply chain failures are now third in OWASP's 2025 list of top web security risks.
- Before installing anything, check it's real, popular, maintained and spelled correctly — and ask an adult if unsure.
What is slopsquatting?
Slopsquatting is a software supply chain attack. AI coding tools sometimes suggest installing a package that doesn't exist; an attacker publishes a malicious package under that invented name, and anyone who follows the AI's suggestion installs the attacker's code. The term is credited to Seth Larson, a developer at the Python Software Foundation, and was coined as a play on "typosquatting", where attackers register misspellings of popular packages.
What dependencies are
Almost no app is built entirely from scratch. Developers reuse code written by others — libraries for dates, charts, animations and much more. These reusable pieces are called packages or dependencies, and they're downloaded from public registries with a single command.
That's hugely useful. But it means your app includes code you didn't write and probably haven't read. If one of those packages is malicious, your app — and anyone using it — can be harmed.
This chain of other people's code is called the software supply chain. In OWASP's 2025 Top 10 list of web application security risks, "software supply chain failures" ranks third.
How AI makes this riskier
AI coding tools sometimes suggest installing packages. Usually they suggest real, popular ones. But sometimes they invent a name that sounds right but doesn't exist.
A study published at USENIX Security 2025 (first shared in 2024) tested 16 code-generating AI models. Of the 2.23 million packages they suggested, 440,445 — about a fifth (19.7%) — didn't exist. The rate was much lower for commercial models (at least 5.2% on average) than for open-source ones (21.7%), and the models tested date from early 2024, so today's rates may differ. Worse, the same invented names often came up again and again: when the same prompt was repeated ten times, 43% of invented names appeared every time.
That creates an opportunity for attackers:
- They notice which fake names AI tools tend to suggest.
- They register packages with those exact names on public registries.
- They fill them with malicious code.
- A developer follows the AI's suggestion and installs it.
That is slopsquatting: predictable invented names make the attack worth trying.
What malicious packages can do
A malicious package might:
- steal secrets like API keys or passwords — see API keys and secrets;
- add hidden code to your app;
- send data from your computer to someone else;
- use your computer's resources for the attacker's benefit.
Six checks before installing a package
- Does it really exist? Search the official registry and documentation, not just the AI's word.
- Is it spelled exactly right? One letter off can be a different, malicious package.
- Is it widely used? Look at downloads and how many projects depend on it.
- Is it maintained? Check when it was last updated and whether there's an active Git repository.
- Do you actually need it? Many small tasks can be done with a few lines of your own code.
- Ask an adult if you're unsure — especially before installing anything on a family computer.
Fewer dependencies, fewer risks
For beginners, the simplest protection is to avoid unnecessary packages. Many first apps can be built with plain HTML, CSS and JavaScript and no dependencies at all. When you write a prompt, you can say so: "Use plain JavaScript with no external libraries." See how to write a prompt that builds the app you want.
When an AI does suggest a package, treat it like any AI output: something to check, not something to trust. See why AI makes things up.
Learning dependency safety
GenKid's sandbox runs code without network access, so learner projects can't install packages at all in the early levels. Dependency safety — checking packages are real, keeping secrets safe and reviewing changes — is taught in the Developer Safety Basics course at the start of Level 3 (Maker, 13+). At that level, packages on GenKid's approved list install freely; anything else needs the learner's approval and a parent or guardian's permission, only versions at least two weeks old are installed, and install scripts are switched off. See the pathway.
Frequently asked questions
Is slopsquatting the same as typosquatting?
They're related. Typosquatting relies on people mistyping a real package's name; slopsquatting relies on an AI tool inventing a name that doesn't exist yet. The defence is similar: check that a package is real, correctly spelled and widely used before installing it.
What is a software supply chain attack?
An attack that targets the code, tools or services a piece of software depends on, rather than the software itself — for example, a malicious package that many apps install.
How do I know if a package is safe?
No check is perfect, but signs of a safer package include being well known, widely used, actively maintained, correctly spelled and recommended in official documentation.
Should beginners use packages at all?
They can, with an adult's help, but many beginner projects don't need any. Starting with plain HTML, CSS and JavaScript keeps things simpler and safer.
Sources
- We have a package for you! A comprehensive analysis of package hallucinations by code generating LLMs (opens in a new tab) — Spracklen et al., USENIX Security 2025
- OWASP Top 10:2025 (opens in a new tab) — OWASP Foundation
- AI hallucinations create "slopsquatting" supply chain threat (opens in a new tab) — Infosecurity Magazine, April 2025
How we write: GenKid articles are researched and drafted with the help of AI tools, then checked in a separate review step against the sources listed above before they are published, and re-checked when they are updated. Rules and products change, so check official pages for your country before acting on anything here. This article is general information, not legal advice. Spotted a mistake? Email hello@genkid.app.