Detection queries Research demonstrationDeveloper workflows

Slopsquatting: hallucinated huggingface-cli package

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.

What happened

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.

Read the original sourceAdditional source: arxiv.orgAdditional source: aikido.dev

How it happened

Select a stage to explore its defenses
Detect this stage
Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Code model hallucinates a package

    An assistant recommends a package name that was not a legitimate dependency.

    Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

    Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

    Source for step 1
  2. 02 · An adversary can register that name

    The slopsquatting pattern makes the hallucinated name installable.

    Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

    Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

    Source for step 2
  3. 03 · Developer installs the suggested package

    The research registered huggingface-cli and measured downloads.

    Hunt: A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

    Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

    Source for step 3
  4. 04 · Downloads do not prove compromise

    The experiment measures exposure; the registered research package does not establish a malicious payload on every user.

    Source for step 4

Why it matters

Reported entry point: Developer installs LLM-suggested nonexistent package that attacker registered. Reported impact: huggingface-cli >30,000 downloads cited; 205,474 unique fake names in study corpus.

Check these source-linked conditions against your setup.

npm / PyPI dependencies

The research demonstrates downloads of a package name suggested incorrectly by code models.

Conditions to check
  • The workflow requires trusting an AI-suggested package name without checking its provenance.
  • The reported downloads demonstrate adoption of the name, not verified victim compromise.

Source-linked applicability guidance. Confirm current scope in the original report.

Read the original report

What you can do

Protection & prevention

Start here

Verify the package exists in the official project documentation before installing AI-suggested dependencies.

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

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance Additional source 2 Additional source 3
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Code model hallucinates a packageDependency / CI trust boundaryCustom schema · Draft

An assistant recommends a package name that was not a legitimate dependency.

What to look for

A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

Compare the model recommendation with registry provenance and the lockfile; a recommended name alone does not establish installation or compromise.

Visibility: Defender-side logs where collected

Required logs

  • Package-manager and CI job logs
  • Lockfile / manifest / workflow diffs
  • Runner process trees, secret access and egress

Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
  dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - package.install
      - ci.workflow.change
      - package.lifecycle.exec
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
  2. Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
02An adversary can register that nameDependency / CI trust boundaryCustom schema · Draft

The slopsquatting pattern makes the hallucinated name installable.

What to look for

A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

Visibility: Defender-side logs where collected

Required logs

  • Package-manager and CI job logs
  • Lockfile / manifest / workflow diffs
  • Runner process trees, secret access and egress

Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
  dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - package.install
      - ci.workflow.change
      - package.lifecycle.exec
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
  2. Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
03Developer installs the suggested packageDependency / CI trust boundaryCustom schema · Draft

The research registered huggingface-cli and measured downloads.

What to look for

A package or workflow change introduces a lifecycle hook, remote dependency or new command that accesses secrets or external services.

Package downloads demonstrate exposure, not malware execution or confirmed compromise.

Visibility: Defender-side logs where collected

Required logs

  • Package-manager and CI job logs
  • Lockfile / manifest / workflow diffs
  • Runner process trees, secret access and egress

Coverage limit. Package installation and unfamiliar names are not malicious by themselves. Dependency resolution and CI audit records are required.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Dependency / CI trust boundary
id: 5fa9c45a-ac1c-4666-a598-e80626320997
status: experimental
description: A package or workflow change introduces a lifecycle hook, remote
  dependency or new command that accesses secrets or external services.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - package.install
      - ci.workflow.change
      - package.lifecycle.exec
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("package.install", "ci.workflow.change", "package.lifecycle.exec")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Compare package provenance, publish identity, lifecycle scripts and resolved dependency URLs with the approved version.
  2. Correlate the install or workflow to secret reads and subsequent token use; distinguish exposure from confirmed compromise.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
Agent / MCP as target
Initial access
Developer installs LLM-suggested nonexistent package that attacker registered

Tooling as reported

AI products, models and artifacts

  • Code-generating LLMs

Other tooling

  • PyPI/npm typosquat registration

Targets and reported impact

Reported scale / exposure
huggingface-cli >30,000 downloads cited; 205,474 unique fake names in study corpus

Detection rules

  • Review attack-specific indicatorsGUIDANCE

    Monitor for the techniques described in Slopsquatting: hallucinated huggingface-cli package downloads. Refer to sources for specific IOCs and TTPs.

Source defensive notes

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

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0060Publish Hallucinated Entities

An installable entity is registered using a package name hallucinated by models. Source

AML.T0062Discover LLM Hallucinations

Research identifies package hallucinations that create the exposure. Source

Sources & research credit

3 sources

Research by Lasso Security / academic package-hallucination research · Lasso Security / USENIX research lineage

  1. lasso.security
  2. arxiv.org
  3. aikido.dev
Record & downloads
Source record name
Slopsquatting: hallucinated huggingface-cli package downloads
Entry ID
slopsquatting-huggingface-cli-2024
Catalog review
October 20, 2026
Category
attacks-on-ai
AI involvement confidence
confirmed