Slopsquatting
Slopsquatting 是什么?
SlopsquattingA 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code.
Slopsquatting is a software supply-chain attack discovered as LLM-driven coding assistants became mainstream. Researchers documented that models consistently invent plausible-but-nonexistent package names — for example a Python pandas helper, a Node logging library, or a Rust crate that sounds right but has never been published. Attackers register those hallucinated names on the relevant package registry (PyPI, npm, crates.io) with malicious payloads; when a developer follows the AI's suggested `pip install` or `npm install` command, the attacker's code runs in their build environment. The name 'slopsquatting' fuses 'AI slop' with typosquatting. Because the same hallucination tends to repeat across users and even across model versions, a single squatted name can harvest many victims over weeks. Defenses include human verification of every external dependency, deterministic lockfiles, allowlisted registries or proxy registries that block recently-registered packages, and IDE plugins that flag packages the assistant suggested but a curated registry hasn't seen.
● 示例
- 01
A coding assistant repeatedly suggests `pip install requests-helper`; an attacker registers that name on PyPI with a post-install hook that exfiltrates environment variables.
- 02
Internal policy requires that any dependency proposed by Copilot or Claude Code must exist on the proxy registry before it can be installed by CI.
● 常见问题
Slopsquatting 是什么?
A 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code. 它属于网络安全的 AI 与机器学习安全 分类。
Slopsquatting 是什么意思?
A 2024-coined supply-chain attack where adversaries register package names that LLM code assistants frequently hallucinate, so developers who copy-paste the suggested install command end up pulling malicious code.
Slopsquatting 是如何工作的?
Slopsquatting is a software supply-chain attack discovered as LLM-driven coding assistants became mainstream. Researchers documented that models consistently invent plausible-but-nonexistent package names — for example a Python pandas helper, a Node logging library, or a Rust crate that sounds right but has never been published. Attackers register those hallucinated names on the relevant package registry (PyPI, npm, crates.io) with malicious payloads; when a developer follows the AI's suggested `pip install` or `npm install` command, the attacker's code runs in their build environment. The name 'slopsquatting' fuses 'AI slop' with typosquatting. Because the same hallucination tends to repeat across users and even across model versions, a single squatted name can harvest many victims over weeks. Defenses include human verification of every external dependency, deterministic lockfiles, allowlisted registries or proxy registries that block recently-registered packages, and IDE plugins that flag packages the assistant suggested but a curated registry hasn't seen.
如何防御 Slopsquatting?
针对 Slopsquatting 的防御通常结合技术控制与运营实践,详见上方完整定义。
Slopsquatting 还有哪些其他名称?
常见的别称包括: AI package hallucination attack, LLM package squatting。
● 相关术语
- attacks№ 1234
供应链攻击
通过攻陷可信的第三方软件、硬件或服务提供商,进而入侵其下游客户的攻击方式。
- attacks№ 1308
拼写抢注 (Typosquatting)
注册与合法域名或软件包名极为相似的拼写错误版本或视觉仿冒名,以利用用户或开发者的输入和识别错误。
- attacks№ 1307
拼写抢注包(Typosquatted Package)
以与流行库非常相似的名称发布的恶意开源包,引诱开发者输入错误时误装。
- attacks№ 719
恶意 npm 包
包含隐藏代码、安装后会窃取数据、植入恶意软件或破坏下游应用的 npm 软件包。
- ai-security№ 032
AI 幻觉
生成式 AI 输出流畅且自信、但事实错误、凭空捏造或与来源不符的失效模式。
- appsec№ 1186
软件供应链安全
保护软件生产链中每一个环节——源代码、依赖、构建、签名、分发与部署——使其免受篡改、恶意代码与完整性破坏的学科。