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 →- HIGHAI-CURSOR-MCPOISON-2025
MCPoison (CVE-2025-54136), disclosed by Check Point Research and published August 1, 2025, is a persistent remote-code-execution flaw in the Cursor AI code editor affecting versions 1.2.4 and below, rated CVSS 8.8 by NIST. The root cause is that Cursor binds trust for a Model Context Protocol server to its configuration entry's name rather than to the content of its command, so once a collaborator approves an MCP entry, later edits to that entry's underlying command are treated as already trusted and run without any re-prompt. An attacker who can edit a shared .cursor/mcp.json in a repository, or the file locally, first commits a benign MCP entry to obtain approval, then silently swaps its command for a malicious one; the payload then executes automatically every time the victim opens the project, giving durable code execution on the developer's machine. This makes shared repositories a software-supply-chain vector for IP theft and host compromise. It is distinct from CurXecute (CVE-2025-54135), which uses live prompt injection to rewrite mcp.json; MCPoison abuses trust-by-name persistence after legitimate approval. Cursor fixed it in version 1.3 by re-validating modified MCP configurations.
- HIGHCVE-2025-54135
Aim Labs disclosed CurXecute (CVE-2025-54135, CVSS 8.6), a remote-code-execution flaw in the Cursor AI code editor reachable through prompt injection. Because Cursor runs with developer-level privileges and supports the Model Context Protocol, untrusted external data pulled in by an MCP server (for example a crafted Slack message) can redirect the agent's control flow and rewrite the global mcp.json configuration to execute arbitrary commands. Potential consequences include data exfiltration, ransomware deployment, and dependency-poisoning; it was patched in Cursor 1.3 on July 29, 2025.
- HIGHAI-AMAZON-Q-WIPER-2025
An attacker using the alias 'lkmanka58' submitted a pull request to Amazon's open-source Amazon Q Developer Extension GitHub repository on July 13, 2025; due to inadequate access controls it was merged, and the compromised version 1.84.0 shipped to the VS Code Marketplace on July 17, 2025. The injected payload was a prompt instructing the AI agent to act as a system cleaner and delete local file-system data and wipe AWS cloud resources via the CLI. Amazon stated the malicious code was incorrectly formatted and non-functional, revoked credentials, and released the fixed version 1.85.0 on July 24, 2025.
- CRITICALAI-MCP-TOOL-POISONING-2025
MCP tool poisoning is a supply-chain prompt-injection class in which a malicious Model Context Protocol server embeds hidden directives inside a tool's description metadata. Because MCP clients feed the full tool description into the model's context but typically render only a simplified tool name to the user, the model reads attacker instructions (often wrapped in tags like IMPORTANT) that the human never sees. Invariant Labs disclosed this on April 1, 2025, demonstrating that merely connecting a server lets a benign-looking add() tool silently instruct the agent to read files such as ~/.cursor/mcp.json and ~/.ssh/id_rsa and exfiltrate them through innocuous-seeming parameters; this also enables 'line jumping' (Trail of Bits), where the description influences the model before any tool is invoked, and 'rug pull' variants that mutate a tool's description after the user has already approved it. The class maps to OWASP LLM01:2025 Prompt Injection and the LLM03 supply-chain risk.
- CRITICALAI-GROK-BANKR-WALLET-2026
In early May 2026 an attacker drained roughly $150,000 from an AI-powered crypto trading agent on X (Twitter) through prompt injection, an exploit of Grok and the linked Bankrbot agent documented by AI-security researchers including Giskard and NeuralTrust. The attacker posted a Morse-code-encoded message on X and asked Grok to translate it; Grok decoded the obfuscated payload, which contained hidden financial instructions, and the encoding let the untrusted post slip past content filters. Grok processed this user-supplied X content as a trusted directive with no separation between conversation input and authorized commands, then relayed the decoded instruction to the linked Bankrbot agent, which executed it as a legitimate order. Combined with a previously transferred Bankr Club Membership NFT that granted elevated 'Executive' wallet permissions, Bankrbot sent about 3 billion DRB tokens (roughly $150,000) on the Base network to the attacker's wallet, with no human-in-the-loop or circuit breaker on the high-value transfer. About 80% of the funds were later returned after the community identified the attacker.
- HIGHAI-CLAUDECODE-SOURCEMAP-2026
On March 31, 2026, Anthropic accidentally shipped the full source of its Claude Code CLI inside a published npm package. A missing .npmignore rule for *.map left a roughly 59.8 MB source map in the tarball, embedding about 512,000 lines of unobfuscated TypeScript across some 1,900 files, including internal prompts, tool definitions and architecture. The root cause was a packaging failure compounded by a bundler bug: Bun continued emitting source maps even when generation was disabled, and nothing stripped or excluded them before publish. Because npm releases are immutable and mirrored instantly, the source was cloned, dissected and re-hosted within hours, and a clean-room reimplementation reached tens of thousands of GitHub stars the same day. It is a textbook source-map disclosure: the sourcesContent field of a .map file carries the original code verbatim, so a single map left in a shipped artifact hands an attacker the entire codebase, comments and all. The same class hit Apple's App Store web front-end in November 2025, where production source maps left enabled let a researcher reconstruct and publish the full client source.