Mohamed Sharaf

AI invents package names. Attackers register them

Coding assistants sometimes invent package names. Attackers publish malware under those names and wait.

· 1 min read

Ask an AI coding assistant to solve a problem and it may tell you to install a package that sounds perfect but doesn’t exist. The model made up a plausible name. Researchers noticed the same invented names come up again and again, so attackers register them on npm and PyPI with malicious code inside. The trick has a name now: slopsquatting.

The person installing it trusts the suggestion because it came from a tool they use every day.

  • Before installing a package you haven’t heard of, check it on the registry: age, downloads, maintainer, linked repository.
  • Be suspicious of packages created in the last few weeks with few downloads.
  • Use a lockfile and review dependency changes in pull requests, including ones an agent made.
  • If your AI tool can run npm install or pip install by itself, require approval for new packages.

The assistant is fast and confident. It doesn’t check whether a package is real. You have to.

ShareWhatsAppLinkedInXTelegramFacebook