# Slopsquatting: hallucinated huggingface-cli package downloads

- ID: slopsquatting-huggingface-cli-2024
- Reported: 2024-06-14
- Researcher: Lasso Security / academic package-hallucination research
- Organization: Lasso Security / USENIX research lineage
- AI role: ai_agent_or_mcp_as_target (Agent / MCP as target)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/slopsquatting-huggingface-cli-2024/
- Entry JSON: https://openattacks.ai/api/attacks/slopsquatting-huggingface-cli-2024.json
- Browse title: Slopsquatting: hallucinated huggingface-cli package
- Editorial summary: Researchers registered huggingface-cli, a PyPI name LLMs often hallucinate, and saw tens of thousands of downloads. This shows how attackers could exploit AI-suggested fake packages.
- Evidence class (catalog annotation): Research demonstration
- Source-stated target environments: Developer workflows
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/slopsquatting-huggingface-cli-2024.json

## Technique
Attackers register package names that code-generating LLMs hallucinate. Researchers registered hallucinated PyPI name huggingface-cli and observed tens of thousands of downloads (including reported Alibaba adoption). Broader study: 5.2%/21.7% hallucination rates commercial vs open-source models.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Verify the package exists in the official project documentation before installing AI-suggested dependencies.
- Relationship: workflow; tools: npm-pypi; OS scope: not OS-specific / not stated; requires existing MCP connections: false.
  Relevance: The research demonstrates downloads of a package name suggested incorrectly by code models.
  Condition to check: The workflow requires trusting an AI-suggested package name without checking its provenance.
  Condition to check: The reported downloads demonstrate adoption of the name, not verified victim compromise.
  Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
Developer installs LLM-suggested nonexistent package that attacker registered

## AI tooling and models
- Code-generating LLMs

## Other tooling
- PyPI/npm typosquat registration

## Victims and sectors
unknown

## Target geography
- unknown

## Attribution
unknown

## Scale and metrics
huggingface-cli \>30,000 downloads cited; 205,474 unique fake names in study corpus

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: Code model hallucinates a package [ai]
An assistant recommends a package name that was not a legitimate dependency.
Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks

### step-2: An adversary can register that name [access]
The slopsquatting pattern makes the hallucinated name installable.
Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks

### step-3: Developer installs the suggested package [execution]
The research registered huggingface-cli and measured downloads.
Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks

### step-4: Downloads do not prove compromise [unknown]
The experiment measures exposure; the registered research package does not establish a malicious payload on every user.
Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: Dependency / CI trust boundary
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/package.sigma.yml
- KQL query download: /api/detections/package.kql
- SPL query download: /api/detections/package.spl
- Hunt hypothesis: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.
- Required telemetry: Package-manager and CI job logs; Lockfile / manifest / workflow diffs; Runner process trees, secret access and egress
- Investigate: Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
- Investigate: Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
- Limitation: Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.
- Qualification: Compare the model recommendation with registry provenance and the lockfile; a recommended name alone does not establish installation or compromise.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Dependency / CI trust boundary
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/package.sigma.yml
- KQL query download: /api/detections/package.kql
- SPL query download: /api/detections/package.spl
- Hunt hypothesis: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.
- Required telemetry: Package-manager and CI job logs; Lockfile / manifest / workflow diffs; Runner process trees, secret access and egress
- Investigate: Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
- Investigate: Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
- Limitation: Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.
- No direct MagicSword prevention claim is recorded for this stage.

### step-3: Dependency / CI trust boundary
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/package.sigma.yml
- KQL query download: /api/detections/package.kql
- SPL query download: /api/detections/package.spl
- Hunt hypothesis: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.
- Required telemetry: Package-manager and CI job logs; Lockfile / manifest / workflow diffs; Runner process trees, secret access and egress
- Investigate: Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
- Investigate: Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
- Limitation: Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.
- Qualification: Package downloads demonstrate exposure, not malware execution or confirmed compromise.
- No direct MagicSword prevention claim is recorded for this stage.

### step-4: No source-backed runtime hunt yet
- Visibility: Not established
- Query origin: catalog_authored; status: not_applicable; log scope: gap
- Hunt hypothesis: The supplied account does not establish a deployed victim-side behavior for this stage.
- Required telemetry: not assessed
- Investigate: Obtain a source-backed procedure and identify which party could observe it before drafting a detection.
- Limitation: Marketing claims, unknown steps and unconfirmed deployments are not detection coverage. No rule is generated for this stage.
- Qualification: The supplied account leaves this stage unestablished. Obtain a source-backed procedure before proposing a runtime query.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0060: Publish Hallucinated Entities — An installable entity is registered using a package name hallucinated by models.
  Technique: https://atlas.mitre.org/techniques/AML.T0060
  Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks
- AML.T0062: Discover LLM Hallucinations — Research identifies package hallucinations that create the exposure.
  Technique: https://atlas.mitre.org/techniques/AML.T0062
  Evidence: https://www.lasso.security/blog/ai-package-hallucinations ; https://arxiv.org/abs/2406.10279 ; https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks

## Defensive notes
Pin packages; verify registry names against official docs; SCA on AI-suggested deps

## Sources
- https://www.lasso.security/blog/ai-package-hallucinations
- https://arxiv.org/abs/2406.10279
- https://www.aikido.dev/blog/slopsquatting-ai-package-hallucination-attacks
