查看原文
其他

堪比 left-pad 2.0 事件,又有无聊人士玩坏 npm,求组队投诉

0xcc 非尝咸鱼贩 2024-01-06

写代码用包管理挺方便的,就是经常出现各种意外和滥用事件。

大家应该对几年前的 left-pad 事件还有印象。

当时 left-pad 包的作者因为不爽 npm,一怒之下把包全删了。而这个仅 17 行代码的模块被大量包依赖,导致众多流行的构建工具无法安装,一人之力几乎搞垮整个 node 生态。

之后 npmjs 加入了一个新的机制,一旦包被别的依赖,就不能随便 unpublish。

就在半小时前笔者手滑推送了一个 git tag,GitHub Action 自动打包推送了一个新版本到 npm 上。我突然发现本地的代码看着不对,刚才不知怎么回事 git merge 出来的结果不对。

于是我先赶紧救场,尝试撤回刚才推送的版本,却得到这样的提示:

npm ERR! code E405
npm ERR! 405 Method Not Allowed - PUT - You can no longer unpublish this package.
npm ERR! Failed criteria: npm ERR! has dependent packages in the registry

好奇谁依赖了这个仅作为命令行工具的包,上去一看让人大为光火。

这个名叫 everything 的“包”把所有 npmjs 的包添加到依赖项。

https://www.npmjs.com/package/everything

为了解决单个包依赖过多的问题,还把依赖列表拆分成树,“分流”到 @everything-registry 下面的多个包:

https://www.npmjs.com/package/@everything-registry/sub-chunk-1211

他还做了个网站宣传这事:

https://everything.npm.lol/


结合之前 left-pad 的贡献,这下所有的 npm 包都不可以 unpublish 了。不知道还有没有别的什么副作用。


忍不住去找这个🐷头家访。原来您老人家也知道 npm 被搞抽风了啊

一分钟后被 block。

既然 block 我了,就撕破脸把这位肥头大耳的仁兄放封面吧。实在闲的谎怎么不去找个厂纳鞋底?再一次加深我对米国人的刻板印象。



求组队去 npm 官方投诉这玩意儿:

https://www.npmjs.com/support?inquire=security&security-inquire=malware&package=everything&version=3.0.0

How can we help?

I'm reporting spam, abuse or a security issue

My Security Issue

I am reporting spam or abuse in a package on npmjs.com

Subject *

This package added all packages as dependencies, thus broke npm

Package *

everything

Version *

3.0.0

How can we help? *

Please check the author's website: https://everything.npm.lol/

He did this intentionally. By adding all npm packages as dependencies to "everything", he's making it impossible for everyone to unpublish. And further side effects to be discovered.

Please take down this everything package and others that are under @everything-registry scope.

Thanks!

继续滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存