Documented Exercise · OBS.EX0131
576,000-Sample Package Hallucination & Slopsquatting Study Across 16 LLMs
Spracklen et al. (2024/USENIX Security 2025) generated and analyzed 576,000 Python and JavaScript code samples across 16 popular commercial and open-source code LLMs to measure systemic package hallucination ("slopsquatting") exposure. Hallucinated package recommendations averaged at least 5.2% for commercial models and 21.7% for open-source models, totaling 205,474 unique non-existent package names that adversaries could register on PyPI or npm to deliver malware. Because hallucinated names repeat consistently across prompts, package confusion becomes a predictable software supply-chain vector. Engineering teams should enforce private package registries, lockfile allowlists, and automated dependency existence checks in CI.
Exercise dossier metadata
- Case ID
OBS.EX0131- Classification
- Exercise
- Date
- Evaluation scope
- 16 Commercial & Open-Source Code LLMs · Python & JavaScript Supply-Chain Audit
- Reference URI
https://arxiv.org/abs/2406.10279
Mapped AI security techniques
- User Execution: Malicious Package AML.T0011.001
- Publish Hallucinated Entities AML.T0060
- Discover LLM Hallucinations AML.T0062
Mapped defensive controls
- Restrict Library Loading AML.M0011
- Vulnerability Scanning AML.M0016
- Maintain an AI Bill of Materials AML.M0023
Source citation records
- We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs · arXiv (author preprint; peer-review status not inferred) ·