Skip to main content

Incidents

LLM-hallucinated "huggingface-cli" package downloaded thousands of times after a researcher registered it

Bar Lanyado (Lasso Security) saw AI models recommend a huggingface-cli package that did not exist, registered it empty on PyPI and counted 15,000 to 30,000 downloads in about three months.

Incident 2024-03-28 user reported confirmed

Description

Bar Lanyado of Lasso Security noticed that generative AI models repeatedly recommended pip install huggingface-cli, a package that did not exist; the real tool is installed with pip install -U "huggingface_hub[cli]". He registered the name on PyPI as an empty, harmless package to see whether a hallucinated name could be used to distribute code. The Register (2024-03-28) reports more than 15,000 authentic downloads in three months; Simon Willison's summary of Lanyado's post (2024-04-01) gives 30,000. By February 2024 the installation instructions of Alibaba's GraphTranslator project told users to install the fake package. In the same research Lanyado asked four models (GPT-3.5-Turbo, GPT-4, Gemini Pro, Cohere Command) thousands of "how to" questions and measured how often they invented package names. The practice was later named slopsquatting.

Exhibited failure modes

  • Fabrication — Generating reference to non-existent APIs, packages, or symbols.
  • Supply-chain attack — Slopsquatting, typosquatting, compromised MCP servers.

Affected systems

  • GPT-3.5
  • GPT-4
  • Gemini Pro
  • Alibaba GraphTranslator README

Mitigated by

  • Socket — Dependency supply-chain scanner that inspects packages before install.
  • Snyk — Vulnerability scanning for code, dependencies, containers, and IaC.

Documented by

Sources

Notes

The package was empty on purpose, so no code was delivered; harm_class is "user_reported" (it was "security_breach", which the schema defines as a confirmed incident with compromise). incident_date is the date of The Register's article. Corrected on 2026-11-21 from the two sources: the real install target is huggingface_hub[cli], not huggingface[cli]; the two sources disagree on the download count (15,000 or 30,000) and on the month of registration (December 2023 or January 2024), and both figures are now given. Spracklen et al. cite Lanyado's earlier posts on package hallucination.

View raw YAML on GitHub →