VibeSecurity

AI coding risks

What is Slopsquatting?

Slopsquatting is an attack where someone registers a package name that AI coding tools tend to invent, so that when you install the suggested but nonexistent dependency, you actually install attacker-controlled code.

AI assistants sometimes suggest packages that do not exist. The name sounds plausible, the import looks right, and the install command is confident. If an attacker notices which fake names get suggested and publishes a real package under one of them, the next person who follows the suggestion installs malware.

It is a cousin of typosquatting, which relies on human typos, but here the mistake comes from the model. Install scripts run with your permissions, so a bad package can read environment variables, steal keys from your machine, or plant code that ships into production.

Treat every dependency an AI suggests as unverified. Before installing, check that the package exists on the official registry, has a real history, sensible download numbers, a linked repository, and a maintainer you can identify. Prefer well-known libraries, pin exact versions with a lockfile, and review new entries in package.json during code review. Do not paste install commands from a chat without looking up the name first.

Related terms

Sources

  1. 1.OWASP GenAI: LLM03 Supply Chain