AI coding tools invent package names attackers can register

Why the screen mattersApril 2025

Research published at USENIX Security 2025 found that code-generating AI models referred to non-existent packages in about one in five suggestions, and often repeated the same invented names, which an attacker could register first. The tactic was named slopsquatting.

Position
Package names suggested by AI coding assistants

What happened

Researchers tested 16 code-generating language models on 576,000 code samples in Python and JavaScript. Across all models, 19.7 percent of the packages referenced did not exist, with averages of at least 5.2 percent for commercial models and 21.7 percent for open-source ones. They found 205,474 unique invented names, and when prompts were rerun, 43 percent of the invented packages recurred every time. The paper was accepted to USENIX Security 2025. In April 2025 Seth Larson of the Python Software Foundation named the attack this enables: register the names the models predictably invent, and wait.

The ATG nexus

Not an event, and no in-the-wild attack was measured. It is here because it opens a new way into position. A developer who trusts an assistant's suggestion installs whatever holds that name, and the name was chosen by a model, not by any maintainer. Code That Writes Code moves the choice of dependency from a person to a machine.

Limits of the comparison

The research measured how often models invent names. It did not observe an attack.

On this site

Sources

  1. We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs (arXiv v3, 'To appear in the 2025 USENIX Security Symposium')arXiv, 2 March 2025Primary source
  2. AI Hallucinations Create 'Slopsquatting' Supply Chain ThreatInfosecurity Magazine, 14 April 2025
  3. SlopsquattingWikipedia

Back to this event on the timeline