Back to the blog

Slopsquatting: when AI recommends packages that don't exist

Code5 min read · 27 September 2026

The GetPack team

You ask an AI coding tool to add a feature. It tells you to install some library, you copy the command, you run it. Except that library doesn’t exist. Or worse: it does exist, because an attacker saw the same suggestion before you did and registered that exact name on purpose. This has a name, a scientific study behind it, and a simple way to protect yourself.

Where the problem comes from: a precise scientific study

In 2025, six researchers (Joseph Spracklen, Raveen Wijewickrama, A H M Nazmus Sakib, Anindya Maiti, Bimal Viswanath, and Murtuza Jadliwala) published a study on this at the 34th USENIX Security Symposium, one of the reference conferences in computer security, titled “We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs.”

Their method: generate 576,000 code samples with 16 different AI models (both commercial and open-source), in Python and JavaScript, then check whether every package mentioned actually exists in the official registries (npm, PyPI). The result: 19.7% of recommended packages didn’t exist. That rate climbs to 21.7% for open-source models, versus 5.2% for commercial ones. In total, the researchers counted 205,474 distinct package names, all invented.

The most important detail for understanding what comes next: these invented names aren’t random each time. The same model, asked again with a similar prompt, tends to reinvent the same fictional name. That’s exactly what makes the attack possible.

How an attacker exploits this: slopsquatting

Seth Larson, developer-in-residence at the Python Software Foundation, gave this attack technique a name in April 2025: “slopsquatting,” a blend of “AI slop” (low-quality AI-generated output) and “typosquatting” (registering a name close to a known one to catch a typo).

The mechanism is direct: an attacker queries the same AI models everyone else uses and notices which fictional package names come up repeatedly. They then register that name for real, on npm or PyPI, with malicious code inside. All that’s left is to wait for a developer (or an autonomous AI agent running commands without supervision) to type npm install invented-name or pip install invented-name, blindly following the suggestion. The flaw isn’t in an existing package anymore; it’s in the trust placed in a name that never existed before the attacker created it.

The OWASP Top 10:2025, the world’s reference list of web security risks, created a dedicated category for exactly this kind of risk in 2025: “Software Supply Chain Failures,” which expands the old category for vulnerable components. Where your dependencies come from and how they’re distributed is now recognized as a risk in its own right, not just a technical footnote.

Why this hits vibe coding especially hard

When you don’t code day-to-day yourself, you don’t necessarily have the reflex to check that a package actually exists before installing it: the AI tells you to, so you do it. That’s exactly the terrain where slopsquatting works best. Researchers found that a hallucinated package name can reappear across different models and different queries, which means the same fake name can circulate widely before an attacker even exploits it.

What if the AI itself types the command?

The most recent vibe-coding tools (Claude Code, Replit Agent, and similar agents) don’t just suggest a command anymore: they can run it themselves, with no human reading it before it fires. That’s exactly what makes slopsquatting more dangerous in this setting: installing dependencies declared in a lockfile or manifest is, by nature, treated as a routine action by these tools, not as a risky one that automatically triggers a second look. A hallucinated name no longer even needs to convince a human to type npm install; it only needs to convince the AI to suggest it once, and it ends up running.

That doesn’t mean you should avoid these tools, but it does mean the manual checks described below matter even more once you hand them the keyboard: review the list of packages an AI is about to install before approving it, exactly the way you’d review a code change.

How to check a package before installing it

Before running npm install or pip install on a name an AI just suggested, take thirty seconds for these checks:

  1. Confirm the package actually exists, on the registry’s official site (npmjs.com or pypi.org), not just in the terminal. You can also pull up its details from the command line without installing it yet:
npm view package-name
  1. Look at its history. According to OWASP’s npm security guide, a trustworthy package usually has “thousands, or even millions of downloads” and “a real GitHub repository, with genuine code, commits, and contributors.” A package published yesterday, with zero downloads and no repository, should raise a flag, especially if an AI just suggested it to you.
  2. Run a security audit on what you’ve already installed:
npm audit

Per npm’s official documentation, this command “submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities.”

  1. Keep a lockfile (package-lock.json or equivalent) and avoid installing a version that isn’t in it yet without checking it first.
  2. Double-check the exact spelling. A name that’s almost right, one letter swapped or a hyphen moved, is a classic sign of a package that’s impersonating a popular one, whether or not an AI was involved in suggesting it.
  3. To go further, automated tools exist to flag recently published or suspicious packages before they enter your project, as a complement to your own vigilance.

None of this takes long once it’s a habit. The point isn’t to distrust every suggestion an AI coding tool makes; it’s to treat a package name the same way you’d treat a link in an email you weren’t expecting: worth a second look before you click, or in this case, before you install.

Key takeaways

  • A USENIX Security 2025 study, covering 576,000 code samples and 16 AI models, measured that 19.7% of packages recommended by these AIs didn’t exist.
  • Slopsquatting (a term coined by Seth Larson in April 2025) is when an attacker registers these invented names before a developer installs them by mistake.
  • This risk now has its own category in the OWASP Top 10:2025, dedicated to the software supply chain.
  • Before installing a package an AI suggested: check that it exists on the official registry, look at its download history and repository, then run a security audit.
  • Never trust a package name just because an AI gave it to you.

To automate this check on every install, the verif-paquets connector runs this lookup for you before you type the command.

Sources

  1. We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs — USENIX Security 25 · accessed 27 September 2026
  2. GitHub - Spracks/PackageHallucination (study data and code) · accessed 27 September 2026
  3. Slopsquatting explained: When AI code turns malicious — TechTarget · accessed 27 September 2026
  4. The Rise of Slopsquatting: How AI Hallucinations Are Fueling a New Class of Supply Chain Attacks — Socket · accessed 27 September 2026
  5. npm-audit — npm Docs · accessed 27 September 2026
  6. OWASP Top 10:2025 — OWASP Foundation · accessed 27 September 2026

Read the next article

Weekly brief27 September 2026

AI news roundup: the week of September 21–27, 2026

Code27 September 2026

Vibe coding: what it actually means (and how not to mess it up)

AI news27 September 2026

Why Yann LeCun wants AMI: AI beyond LLMs

Tutorial26 September 2026

Connect an MCP connector to Claude without writing a line of code

Degrees26 September 2026

Choosing your program with real MonMaster and InserSup data

Method26 September 2026

APA 7, ISO 690, Vancouver: how to cite your sources properly

Explainer26 September 2026

ChatGPT's 'hidden codes' on TikTok: fact vs. fiction

Health26 September 2026

Medicine: revise for the EDN with France's public drug database

Career26 September 2026

Internship pay and apprentice wages in 2026: the rules

Explainer26 September 2026

AI and academic integrity: what universities actually say

Tutorial26 September 2026

Installing a skill in Claude in 2 minutes

Thesis26 September 2026

Thesis: building your research question and outline with AI

Method26 September 2026

Building your exam study schedule with AI, the right way

Method26 September 2026

Revising with AI, honestly: active recall, Feynman, quizzes

Career26 September 2026

Choosing your apprenticeship with real employment data

Code27 September 2026

Learning to code in the age of AI: what you still need to know how to do yourself

Code27 September 2026

The one-page spec to write before you prompt an AI to code

Thesis27 September 2026

How to cite ChatGPT or Claude in a thesis: APA, MLA, ISO 690

Code27 September 2026

Claude Code for beginners: install, first launch, CLAUDE.md

AI news27 September 2026

Claude Opus 5.5: what really changes (and how to use it to study)

Analysis27 September 2026

The AI race: why some people are scared and others aren't

Code27 September 2026

Building your first MCP server, step by step

Code27 September 2026

Deploying your first site for free: Vercel, Netlify, Cloudflare Pages, or GitHub Pages

Explainer27 September 2026

AI detectors: are Turnitin, GPTZero and Compilatio reliable?

Code27 September 2026

Writing your own Claude skill: structure, SKILL.md, and a description that triggers

Career27 September 2026

France's national student-entrepreneur status (SNEE) and the PEPITE network, explained

Analysis27 September 2026

France in the AI race: Mistral, energy and talent

AI news27 September 2026

French Tech and AI: the French startups to know in 2026

Code27 September 2026

Git without fear: commit, branch, remote explained, then the commands that save you

Explainer27 September 2026

Chinese AI: DeepSeek, Qwen, Kimi… why Europe is wary

Health27 September 2026

AI in medical school: study for PASS, LAS and the EDN safely

Tools27 September 2026

Free AI for students: every offer and discount (2026)

Career27 September 2026

AI on an internship or apprenticeship: what’s allowed, what isn’t

Code27 September 2026

From IDE to ADE: coding with AI agents in 2026

Code27 September 2026

Reading an error without panicking: the anatomy of a stack trace (Python and JavaScript)

Tools27 September 2026

Best AI for students in 2026: the honest comparison

Tools27 September 2026

New AI models in 2026: which one should you study with?

Tools27 September 2026

French AI tools you’ve never heard of: Noota, Moshi, Vibe…

Analysis27 September 2026

Why AI is so expensive (and American AI even more so)

Code27 September 2026

How to prompt an AI coding tool well: the method that changes everything

Code27 September 2026

Securing a vibe-coded app: 7 mistakes to fix before you publish

Join GetPack

Already have an account? Sign in