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
- Whitepaper, Chapter 10: AI in the Client Runtime
- Whitepaper, Chapter 9: Open Source and the Path to the Client Runtime
- Concept: The Open-Source Open Door
- Concept: Code That Writes Code