NPM 的发布冷却期不过是安全层面的作秀。
NPM's release cooldown is security theater

原始链接: https://blog.outv.im/2026/npm-cooldown-security-theater/

作者认为,npm、pnpm 和 yarn 等包管理器中日益流行的“冷却期”(即对包安装的时间限制)是一种无效的安全策略,这更像是一种“蜜罐”而非解决方案。 核心问题在于集体行动困境:该策略依赖于无私的社区成员充当“金丝雀”,为其他人审查软件包。由于每个人都在等待别人采取行动,实际上根本没有人去审查代码。同样,依赖自动化 CI/CD 流水线往往会导致恶意代码在被识别之前就被自动合并,这使得这种安全防范既被动又滞后。 作者主张“自主研究”(DYOR),而不是等待社区介入或依赖延迟安装。他建议将外部依赖项视为不可信软件,并采取积极、主动的措施:在将新代码集成到代码库之前,使用静态分析工具(SAST)、沙箱和人工智能辅助审计。作者最后总结称,开发者必须摒弃被动的安全措施,转而采取主动、严谨的扫描,以有效降低供应链风险。

最近在 Hacker News 上的一场讨论对“NPM 发布冷却期”(即为了规避潜在恶意软件而推迟包更新的做法)仅仅是“安全剧场”的说法提出了质疑。 原作者认为,如果每个人都采取冷却策略,就不会有人去发现漏洞。然而,大多数评论者反驳了这一前提,指出安全公司、自动化扫描器和独立研究人员会立即对新版本进行审计。许多用户认为,即便只是等待一小段时间,也能让这些自动化系统在开发者集成代码之前捕获恶意程序。 尽管关于人工智能和大语言模型将提升还是贬低安全研究价值存在争议,但社区普遍认为仅靠冷却期是不够的。讨论强调,主动防御策略比被动等待更有效。许多贡献者建议,开发者不应依赖社区筛选,而应优先考虑通过容器或 SELinux 等工具对构建环境进行沙箱化,以隔离第三方代码。最终,社区认为“安全剧场”这一观点存在缺陷,并坚持认为审慎的延迟仍然是稳健安全策略中虽小但有价值的一环。
相关文章

原文
· #tech · ~2.5k words · Views: ...

Due to many ecosystem attack incidents, package managers (and packagers, and managers) are apparently falling in love with cooldowns these days (npm, pnpm, yarn and so on). As a result, their upstream registry is time-gated for some 7 days or 24 hours.

Sounds sweet as honey. Except that it is not going to work. I'll say it's not honey, but a honeypot that traps.

Waiting for security, or Godot

Some are waiting for the community to "vet" the package before installing it. However, people don't know what's the appropriate cooldown time (e.g. 7 days for yarn, 3 days for pnpm). Also, a spoiler: people have no idea who would vet, either.

The implicit assumption is that someone out there (in the community) will:

  • install every package early (because they are warmhearted)
  • notice something wrong (because they are smart)
  • and raise the alarm before the crowd gets to it (because they have the best cyber loudspeaker)
  • all for free!

But the reality isn't that generous. If everyone sets a cooldown, there will be no early adopter. Everyone is waiting for everyone else to be the canary, and the canary does not exist.

So they are waiting for Godot, and... Godot is not coming.

Leaning on CI/CD, which is either useless or too late

Some others use a pipeline or some CI/CD (yes, not necessarily human) that pulls the latest package through some dependabot PR.

When there is malicious code, one of the two results will happen (depending on whether the CI is exploitable/valuable):

  • the exploit either gets unnoticed
  • or succeeds

And the PR gets merged and devs hit npm install without a second thought. Since nobody and nothing looks at the still-untrusted code (reading package-lock.json does not count!), people and machines are unaware of the issue before installing, and malicious code is only found when the impact starts to show. Needless to say it would be too late.

So, I'd say DYOR matters indeed

In a word, waiting without taking action doesn't work. But what to do instead? I would suggest "Do Your Own Research":

  • Treat vendored code like some random Windows EXE downloaded from the Internet. Bring the static analysis tools. Bring SASTs. Bring the sandboxes. Bring your hips HIPS.
  • Run LLM-assisted audit on vendored code.
  • Of course, before the dependabot PRs get merged or devs install them on their boxes.

Stop cooling down or laying flat. Instead, start active scanning, so it's no longer a movie in the security theater.

联系我们 contact @ memedata.com