A developer asks an AI coding tool which software package to install. The suggested name looks credible, but the package may not be what it seems. In slopsquatting, an attacker registers a malicious package under a name likely to be suggested by a language model. A developer who installs it without checking its origin may compromise a project or system. section 5.3 section 5.2
Package hallucination creates a related opening: a model invents a plausible-sounding dependency that does not exist. An attacker can register that invented name on a public repository such as PyPI or npm, so a later suggestion leads to a real—but malicious—package. This differs from relying only on a name that resembles an existing legitimate package. section 5.3
The risk grows when people accept AI-generated code and dependencies without review. Checking a suggested package’s origin before installing it is important; vendor checks against official registries and platform warnings about suspicious new packages may also help, but safeguards are not consistent. section 5.3 section 5.2
