Toutes les vulnérabilités
HIGHAI/LLM

AI-SLOPSQUATTING-2025

LLM packages · AI-suggested dependencies (npm/PyPI)

Résumé

Slopsquatting is a supply-chain attack class where LLM code assistants recommend dependency names that do not exist, and attackers pre-register those hallucinated names on public registries to ship malware. A USENIX Security 2025 study analyzed 576,000 code samples across 16 LLMs and found 19.7% of recommended packages were hallucinated (21.7% for open-source models, 5.2% for commercial), yielding over 205,000 unique fake package names. Hallucinations repeat across sessions, so a single registered malicious package can be installed by many developers; researcher Bar Lanyado previously demonstrated the risk by registering a frequently hallucinated 'huggingface-cli' package that received tens of thousands of downloads.

Comment l’éviter dans votre code

  • Verify every AI-suggested package exists and is legitimate before installing; check downloads, maintainer and repo history.
  • Pin and lockfile all dependencies; never blindly run install commands emitted by an assistant.
  • Use private registry proxies or allow-lists to block unknown public packages.
  • Enable supply-chain scanning (Socket, dependency audit) in CI to flag newly-registered or typosquat packages.
  • Mandate human review of dependency additions in AI-authored code before merge.

Références

Vulnérabilités liées

Tout AI/LLM →