Package hallucination occurs when a language model invents a plausible-sounding software package name that does not exist. Coding assistants may suggest names such as “easydatax” or “datastreamlite,” especially for niche tasks where legitimate libraries are less familiar. section 5.3
The risk develops through a recognizable supply-chain pathway:
- A developer trusts an AI-generated dependency suggestion without verifying the package. section 5.3
- An attacker registers the fabricated name on a public repository with malicious contents. section 5.3
- Installing the package can compromise the developer’s system or project. section 5.3
Package hallucination versus slopsquatting
Slopsquatting imitates a legitimate package name; package hallucination fabricates an entirely new, plausible name. Attackers therefore may exploit AI-generated names without mimicking existing libraries. section 5.3
