# Slopsquatting: an invented dependency becomes installable

> USENIX package-hallucination research explains slopsquatting. Distinguish existence, provenance, integrity and dependency selection.

Published: 2026-11-17  
Canonical: https://rootzero.eu/en/research/slopsquatting-hallucinated-packages/

A dependency name generated by a model can become the target of malicious registration. Risk arises when a recommendation becomes an installation without establishing the expected project’s identity.

[We Have a Package for You!, presented at USENIX Security 2025](https://www.usenix.org/conference/usenixsecurity25/presentation/spracklen), examines 16 models and 576,000 code samples in two languages. It reports average hallucinated-package rates of at least 5.2% for the commercial models and 21.7% for the open models studied. These rates concern that experiment, its models and methodology; they do not measure arbitrary assistants in November 2026.

![Generated name → Available name → Published package → Installation. Registry existence does not establish provenance.](../../../assets/editorial/orca/a16-en.png)

*Registry existence does not establish provenance.*

## The name crosses several decisions

A model can generate a plausible import without verifying package existence. An attacker controlling that registry name can subsequently make installation possible.

```text
generated name -> registry lookup -> package found
               -> version selection -> download -> possible execution
```

“Package found” does not complete verification. Existence is a registry property at a particular time. Provenance requires connecting the package to an expected project and producer.

Unlike a simple typo, the user can copy the recommendation exactly. The error chain begins with name generation.

## Examine before installing

Ask why the task needs a new library and which project documentation describes the proposed API. A name and example unsupported by project documentation should remain unvalidated.

[npm view](https://docs.npmjs.com/cli/v11/commands/npm-view/) reads metadata without installing the package. This example uses a fictional name to replace with the package under review:

```sh
npm view @example/package-fixture name version time repository maintainers dist.integrity --json
```

Recent publication or unfamiliar ownership warrants examination, not an automatic malware verdict. Conversely, an old package may have changed maintainers or suffered compromise. Combine observations.

## Understand available provenance

[npm documents provenance attestations](https://docs.npmjs.com/viewing-package-provenance/) as verifiable links to source and build. Examine the referenced repository and workflow. Consistency establishes neither defect absence nor legitimate code intent.

Tarball integrity verifies expected bytes against received bytes. It does not explain why those bytes should execute. A lockfile retains the selection for future installations and can reproduce a bad selection.

## Preserve evaluation denominators

An internal evaluation can ask the model to implement known tasks and collect proposed package names before installation. Compare names against a dated registry snapshot, retaining model, prompt, parameters and time.

Separate packages nonexistent at generation time from existing packages with incorrect identity or API. Combining them as hallucinations hides different control decisions.

Search-tool availability and libraries supplied in context affect trials too. Report examined recommendations and generated responses. A package-level result is not a vulnerable-response rate.

Operationally, treat a new dependency as a build-chain change. Review project identity, contents and execution conditions even when a convincing answer supplied the name.
