'everything' blocks devs from removing their own NPM packages
bleepingcomputer.com
bleepingcomputer.com
I get that this royally inconvenienced a ton of people, but come on: the fact that this can happen in the first place, along with the fact that the expectation for most users is that it can't, is a clear failing on NPM's part.
I don't know what the solution is - maybe packages should be permanent after 24 hours instead of after they're depended upon, maybe there's a different solution - but it's disheartening to see the vitriol with which folks went after PatrickJS in the screenshotted comments in TFA.
In the next episode we’ll be unable to publish more than three packages a day, have to request dependency quotas, investigate ip blocking issues, solve captcha for every basic operation and try to weed through support rounds to unlock the org that was locked due to suspicious activity.
That said, props for them not hiding in a shadow watching things happen.
You're making the assumption that they were aware of the complications their experiment would cause beforehand. The fact that they weren't "hiding in the shadows" indicates they had no ill intent. Also if they didn't do this, someone else eventually would (possible with ill intent).
In any case this is a mild inconvience at most. Anyone who gets upset over this needs to go touch grass.
Given the number of bots uploading malicious packages, I wouldn't be surprised if this is mostly all automated, and there's no manpower available to dedicate to descriptions of each shady package uploaded to the world's largest package repository.
If this were a vulnerability in the infrastructure of NPM itself, then I would definitely expect a full writeup with a working link.
Github acquired NPM, and now they're trying to integrate NPM with all of Github's products, so NPM advisories now link to the Github advisories page, which is probably why the search query is being stripped. This is definitely not ideal, but I would probably characterize this as corporate ineptitude. Classic case of a company acquiring a smaller company and not properly handling the integration.
> Second, searching the github for "no-one-left-behind" gives no results.
Like I said, there are bots publishing malicious packages faster than human reviewers can even describe them, so I don't expect a full write up for every prank package. Are you really upset that you had to Google the package instead of following a link in a package's description? Really? Would you instantly mistrust any organization with a link that lead to a 404 page?
> Third, this _is_ a vulnerability of the NPM ecosystem, as shown by the fact that this happened _AGAIN_ this week.
I would hardly characterize this as a vulnerability of the NPM ecosystem. I'm not even sure if this would warrant its own CVE. You act as if the package was installing bitcoin miners on developer machines. Like I said, if this were a vulnerability in the infrastructure of NPM itself (say for instance it managed to hack the servers hosting NPM), then I would definitely expect a full write up. All it's doing is preventing people from unpublishing packages. It was honestly a curtesy of NPM to even take it down. If it was up to me I might make the whole registry immutable.
Another commenter said it best: "In any case this is a mild inconvience at most. Anyone who gets upset over this needs to go touch grass."[1]
Doesn't happen to literally any other programming language (or maybe I just haven't paid attention to others)
Personally, I think if you're not sure you want a package to be available publicly in perpetuity, you should maybe consider publishing it to a private registry. Even if NPM did allow developers to unpublish any package, there's nothing stopping me from downloading a tarball of your package as soon as you publish it, and hosting a mirror of it somewhere else.
As far as I can tell, NPM does not enforce any limitations on the license of published packages; I would not assume you can legally do this unless you have verified the package has been published under a license which permits such actions and which you are certain you understand.
I'm not a lawyer, but in my best judgment I see no reason to assume an NPM package can continue being used after it is taken down -- you need to actually evaluate the license it's published under to determine that. If I'm mistaken, I'd love to see a source establishing the contrary.
When you upload something to the internet it's there forever. The only way to ensure something is not on the internet is if you don't post it (and even then...). People are destined to learn this lesson over and over again.
I once saw a package on NPM that had a commercial license. It even had a link to its source on GH.
And a note that if you used the package you needed to pay up.
As has rust. https://blog.rust-lang.org/2022/05/10/malicious-crate-rustde...
NPM wants to have its cake and eat it too, which is the problem here. The solution is just to say that if you publish a package to NPM you give it the perpetual right to distribute it as-is, and then remove the ability for users to delete their packages at-will.
Yes, exactly!
Kind of unrelated, but I think it is important to remember that the left-pad was also ENTIRELY npm team's fault. You can't just take away a namespace from someone just because some startup like kik comes knocking.
Toyota does not have a right to my domain dot tld slash toyota The correct answer would have been npm to tell kik to pound sand.
npm has never fixed this grave error.
https://blog.npmjs.org/post/141577284765/kik-left-pad-and-np...
> We stand by our package name dispute resolution policy, and the decision to which it led us.
npm deserves to die.
So many issues arise from the fact that our UIs can’t do simple things on lists like folders (e.g. archive) and tags/notes.
The way PyPI does deletions is through "yanking," which is really a soft-delete mechanism. Yanking prevents usage of a particular package version for new resolutions, but allows fully-resolved versions to be downloaded. As a result, PyPI doesn't have the specific behavior that caused this (forbidding people from removing their packages because removal means hard-deletion).
I don't see these as serious contenders anymore.
It's such an interesting and important field but largely treated as an annoyance, dismissed by the very people who should be learning about it.
Simply having a table of all the fundamental concepts involved and how each package manager handles them would be really interesting. Or even just a list of the fundamental concepts useful for building your mental model of how they work!
Vendor your dependencies.
By which I mean: commit the dependencies you rely on, to your VCS. It's really that simple.
Yes, this probably requires some different usage or default behaviour from package managers to be "efficient" (i.e. you probably don't need to include all the tests, docs etc for each dependency in your repo).
If you're following "best practices" for every library package manager I've seen (to commit their respective "lock" file, thereby fixing the used version of each dependency for subsequent installs), the end result is the same in terms of what version of dependency is available when the source is checked out - but now you have (a) zero risk of dependencies being pulled; (b) the ability to do comprehensive change reviews when versions are bumped; (c) likely faster updates for anyone pulling changes subsequent to a dependency change; (d) zero risk of 'install dependencies' related issues at deployment time.
The downside is, as you found, they're usually out of date. The upside is that if you get a Python program added to Stable, you can rest easy knowing that end users won't have to battle dependency hell to get it running.
*: This does not apply if you've made a FrankenDebian by combining Sid and Stable, or other such things. You're on your own, good luck.
Perhaps we should standardise "languages" too: all compiled programming do be done in N-- and all interpreted programming in Piffle. Thou shalt not touch machine code and that unless thou be a priest
... no of course not!
A "standardised" package manager is close to the least of our worries in IT land. Today I updated a .deb based server software on an Ubuntu box and used a built in update mechanism to update its client software - this is a MinIO instance. I'm not worried that it will fall to bits.
Anyone with a Windows box with a worrying number of Visual C++ runtimes might like to remove the lot and install the latest from here: https://learn.microsoft.com/en-us/cpp/windows/latest-support...
A general package manager that only sees packages as directory blobs would not need to be that complicated. In fact I don’t think npm has this deep knowledge about JavaScript either, it just put stuff inside node_modules and calls it a day.
That said, it would be great if more projects adopted Bazel, its biggest problem today is adoption, forcing you to convert any dependencies to make it Bazel compatible.
Because the job of a package manager is complex and humanity hasn't figured out a universally satisfactory solution.
Research and development are ongoing, and the state of the art is at a level of complexity that I'd compare to a doctoral project or something, requiring one to throw away tons of the abstractions they know and learn a lot from scratch (nix).
SMACK
Somewhere in an alternate universe, there's a better timeline.
But I also think it’s been permanently tainted due to a constantly shifting ecosystem that can’t settle down, and a user community that is constantly chasing new shiny things.
Dependency management is a disaster in a ton of ecosystems. It is often a different set of disasters than what npm has, but it isn't like this is a solved problem everywhere else and it is just the js ecosystem that sucks. NPM is made marginally worse by the poor standard library in JS but I don't think the problem is fundamentally attached to the language in any meaningful way.
And the push to use JS for backends was not "we want this to be a serious language" but was instead "well, we are already using JS for frontends so it'd be nice from a practical standpoint for hiring and training to be able to use the same language and ecosystem for backends too."
The benefit of CDNs used to be that you could cache a library for use on multiple domains but I don't think that works anymore.
These don't seem bad for dependency-free libraries, but they won't warn you about incompatible package dependencies.
I guess the real answer is because it's a lot of work to maintain packages and versioning and there is space for multiple solutions.
By being hermetically sealed, the community can make progress on testing, repeatability, and lots of things that would become incredibly difficult if you introduced anything else into the mix.
Moreover, each language gets to innovate in its own way. Cargo is fantastic and fits the needs of Rust quite well. Custom builds, cross compiling, codegen, ...
This is not what they’re arguing for.
> Custom builds, cross compiling, codegen, ...
That’s great, none of that is “package management”.
The point is, every language has a way to specify dependencies, find the correct versions, and download them recursively. Could that piece be made generic?
Python is an example of a language that can (and historically has) done arbitrary things in package installation https://stackoverflow.com/a/43350802/2751619
I think things have improved, but you didn't used to be able to build a dependency tree without installing all packages and iirc there was a dependency resolution case where pip would download every version counting backwards until one happened to install
Tight coupling matters.
> Could that piece be made generic?
Semver has different meanings to different languages based on compiler versions.
Some languages want 100% build reproducibility and hermeticity, and some languages will never get there.
Some languages permit yanking.
Some languages allow binary distributions.
...
These decisions go very deep to the fundamental ethos of the languages themselves. I don't think we'd find any agreement.
I know way too many coders and firms taking a "throw stuff to the wall and see what sticks" approach to software. The phrase "just solve the problem and move on" comes to mind. These places are often in firefighting mode and cannot connect the dots for some reason.
You can mark a package you’ve published as “yanked”, which will make it so that if someone tries to depend on that version in the future they “can’t” (cargo will tell you it’s yanked). But if it’s in your Cargo.lock file since before, cargo will still fetch it and use it.
This way you can mark a broken version of your published package as bad so that fewer people will use that version. While not preventing anyone who was already using it from continuing to use it.
https://learn.microsoft.com/en-us/nuget/nuget-org/policies/d...
Some time ago I ran head first into an npm bug when I tried to symlink the README file which resulted in the package getting published without a README file because apparently someone somewhere is "opinionated" about symlinks.
https://github.com/npm/cli/issues/6746
That was embarrassing and annoying. So I unpublished it. Then I discovered I couldn't replace the bad package, I had to create a new version of the package. So I did and then I discovered they had slapped me with a stupid 24 hour count down on top of all that during which I could not actually push the corrected version. I hate this thing so much, you have no idea.
This doesn't work if you've accidentally published sensitive information or files. Though I agree that deleting packages is generally not necessary.
I’m sure there are bots watching new versions posted to NPM, scanning them for things like AWS access keys or crypto wallet creds. I’d bet that if you publish a package with AWS creds you will have crypto miners launched on your account within the hour if not within 5 minutes (probably all automated).
NPM is a very good package manager registry. It's just extremely popular because javascript is extremely popular and the entry barrier is tiny compared to other languages and registries.
These issues would pop up in any package manager, no matter the language, you just need enough users and usecases.
I haven’t read TFA, but judging from the domain it missed the whole point. We weren’t intending to break anything, we just wanted to install everything. Combined storage size of package manifests were 82mb
Was there a legitimate purpose or is he just a troll?
Call attention to a real issue that should be solved by the ecosystem so that people cannot do it in the future? In my opinion it is not useful or even sane to expect people to just _not_ do annoying things if you develop systems that allow people to do things that annoy you with them. Design and build systems that assume people will be trolls, and make it so people cannot so easily troll you with them. Failing that, there's nobody to point the finger at besides the person or people who made it possible.
The pranksters "thought it would be funny" (one is quoted as saying in the article).
How crazy that there’s not like a limit or some kind of basic check to prevent the upload or something?
Honestly at this point it seems to be a failure on NPM’s part. People should really direct their anger to the maintainers at this point
And it's not really arbitrary. You can count the dependency tree of every package and get the P99, exclude joke packages and get the max of the rest. Set the limit around there with an error message to open a bug if you need more, grandfathering legit old large packages with some kind of admin-level exception.
The number of people actually needing more will be incredibly tiny. Service those folks individually to avoid pain.
The person made thousands of modules that look like `@everything/sub-chunk-{id}`, each depending on N modules. Those sub-chunk modules, together, depend on all NPM modules. Whatever upper limit you come up with, anyone can do this by setting N to your upper limit.
The problem here isn't that you can create modules that depend on other modules. If there's a problem at all, it's that the NPM's yank policy could be improved.
And I agree about yank! I just think you could implement multiple reasonable solutions here
That they rolled all of those submodules into one big everything package is just a gimmick, not a source of the problem.
When it's a staffing limit the question becomes less arbitrary.