News for hackers. Stuff that matters.
Re:'No way to prevent this,' says only package manager where... by aselimov3 on Friday May 15, 2026 @09:39PM (#48156010)
What are the actual guarantees that go/Rust make that Python/npm don’t? It seems like it might just be that Python/npm are juicier targets? I’m starting to try and avoid all third party packages
Re:'No way to prevent this,' says only package manager where... by brunoborges on Friday May 15, 2026 @10:14PM (#48156191)
It is 100% up to the package manager's steward to control how ownership of packages and namespaces are granted.

Maven Central exists for decades the amount of incidents of people stealing namespaces is minimal.

One can't simply publish a package under the groupId "com.ycombinator" without having some way to verify that they own the domain ycombinator.com. Then, once a package is published, it is 100% immutable, even if it has malicious code in it. Certainly, that library is flagged everywhere as vulnerable.

It baffles me that NPM for so long couldn't replicate the same guardrails as Maven Central.

Re:'No way to prevent this,' says only package manager where... by cluckindan on Friday May 15, 2026 @10:40PM (#48156340)
How does that protect against credential theft? MFA required to sign published releases?
Re:'No way to prevent this,' says only package manager where... by brunoborges on Friday May 15, 2026 @11:17PM (#48156532)
That is another important layer. Maven Central is not immune to credential theft. If a publisher token is stolen, an attacker may still be able to publish a malicious new version until the token is revoked or the account is suspended after reporting the problem to Sonatype.

But in the Maven/Gradle ecosystem, most projects pin exact dependency versions. Support for version ranges and dynamic versions exist, but they are generally avoided because they hurt reproducible builds. That means a malicious new release does not automatically flow into most consumers’ builds just because it was published.

I'd go as far to say that NPM should:

1. Enforce scope (namespace) requirement, and require external verification (reverse DNS for example).

2. Disable version range support out of the box. User must --enable this setting from the command line at all times.

3. Remove support for install scripts completely. If someone wants to publish a ready-to-run software, there are plenty of other mechanisms.

Re:'No way to prevent this,' says only package manager where... by com2kid on Friday May 15, 2026 @11:20PM (#48156545)
> Enforce scope (namespace) requirement, and require external verification (reverse DNS for example).

Who the heck says everyone who publishes a library has a domain? That seems absurd.

Re:'No way to prevent this,' says only package manager where... by brunoborges on Friday May 15, 2026 @11:36PM (#48156606)
Sonatype allows "io.github.<username>" as a valid groupId and has a process to verify ownership. I am sure other providers like GitLab can work on this.
Re:'No way to prevent this,' says only package manager where... by radlad on Friday May 15, 2026 @11:29PM (#48156582)
And domains can change hands legitimately.
Re:'No way to prevent this,' says only package manager where... by whatevaa on Saturday May 16, 2026 @02:13AM (#48157317)
Or be forgotten to renewed, lost and, depending on registrar, overtaken.
Re:'No way to prevent this,' says only package manager where... by chadgpt3 on Saturday May 16, 2026 @02:00AM (#48157246)
Why don't you? It costs around $20 per year. Every serious computer nerd should have one, and a web server with at least a basic homepage.
Re:'No way to prevent this,' says only package manager where... by whatevaa on Saturday May 16, 2026 @02:12AM (#48157311)
$20 per year on US is not the same value across the world. Would you say $60 per year is ok too, if you adjusted for income? 100$?

Don't count other people money.

Re:'No way to prevent this,' says only package manager where... by lelanthran on Saturday May 16, 2026 @05:18AM (#48158427)
The problem with this argument against, is that it reinforces the point it is arguing against: If a contributor cannot afford the $20/year to publish for a single 12-month period, then they are already a risk - someone could buy their account off them.

A small bar of $20/year is also enough to completely cut-down on contributors who sign up with the intention of publishing malicious packages: they have to pay $20/year for each malicious package they want to publish!

Re:'No way to prevent this,' says only package manager where... by com2kid on Saturday May 16, 2026 @11:37PM (#48165856)
Why should someone need a credit card to contribute to open source? Why should they need to understand DNS?

Heck domain names are ephemeral, forget a deadline by a day and they are snatched up my squatters. They don't provide any extra guarantees. Do we really think a domain requirement is going to stop state level actors that are already stealing 2FA package publishing tokens from major software orgs?

Re:'No way to prevent this,' says only package manager where... by lelanthran on Sunday May 17, 2026 @02:48AM (#48166598)
> Do we really think a domain requirement is going to stop state level actors that are already stealing 2FA package publishing tokens from major software orgs?

Is that your target? Because if so, then nothing will stop them.

Re:'No way to prevent this,' says only package manager where... by com2kid on Sunday May 17, 2026 @03:05AM (#48166677)
The most recent attacks have been incredibly sophisticated, executed against orgs that have taken all the right steps.

Requiring domain name verification is not going to do anything when 2FA tokens are being stolen.

What it will do is prevent students and people who want to stay anonymous from contributing to open source.

Re:'No way to prevent this,' says only package manager where... by oarsinsync on Saturday May 16, 2026 @03:29AM (#48157704)
You can get subdomains for free from a number of places, some of which are more reliable than others.

This exists because domains (historically) used to be expensive by western standards. .com used to be $75/year back in the day.

Re:'No way to prevent this,' says only package manager where... by TiddoLangerak on Saturday May 16, 2026 @12:53AM (#48156942)
You're missing the biggest root cause though, and that significantly hinders how well this translates between languages: the Java community has settled on fewer but large monolithic dependencies, whereas the JavaScript community has settled on many but small composable dependencies (for good historical reasons, but that's a topic in and off itself).

This directly influences how well e.g. version pinning works. In the Java world, package versions are _relatively_ independent from eachother and have few transitive dependencies, and as such version conflicts are relatively rare. This means you can get away with full pinning of all dependencies, with the occasional manual override of a conflicting transitive dependency.

This doesn't work in JavaScript. The dependency ecosystem is massively intertwined, if every library would specify exact versions you'd end up with literally hundreds of conflicts to resolve. That's not feasible. As a result, they've chosen the middle ground of using lock files in addition to version ranges.

This also hurts the effectiveness of verified namespaces: when packages come from hundreds of different sources, you're not going to notice 1 or 2 sketchy ones in there.

Other consequences of the big monolithic packages in Java are that updates tend to be less frequent, and more often from large reputable venders. Both of these help to reduce the problem too.

While the JavaScript toolchain can definitely learn a lot from the Java toolchains, the problems it needs to solve are not the same, and thus solutions don't translate 1-1.

At least I hope that they'll get rid of install scripts, that's such a low hanging fruit that really should've be done a decade ago.

Re:'No way to prevent this,' says only package manager where... by dns_snek on Saturday May 16, 2026 @01:39AM (#48157152)
> At least I hope that they'll get rid of install scripts, that's such a low hanging fruit that really should've be done a decade ago.

How will that help? It's just going to break things that legitimately require them.

Instead of being infected upon running "npm install", you'll just get infected upon running "npm run" instead. The former is slightly more reliable but fixing that is just kicking the can down the road. Maybe we'll have a few days before the payloads get rewritten.

Re:'No way to prevent this,' says only package manager where... by nayroclade on Saturday May 16, 2026 @07:07AM (#48159056)
Dependency versions are also locked for npm projects via package-lock.json, and this has been the default behaviour for years. The version ranges specified in package.json don't mean you just pick up the latest whenever you run npm install. Unless you delete package-lock.json or run "npm update", you and everyone else gets the exact same dependency tree each time. So it is just as reproducible as a Maven build in that sense.
Re:'No way to prevent this,' says only package manager where... by panzi on Saturday May 16, 2026 @12:22PM (#48161556)
Plus the lock file doesn't just contain the exact versions, it contains hashes. Making sure that you actually got the package in the exact same version.
Re:'No way to prevent this,' says only package manager where... by SupLockDef on Saturday May 16, 2026 @01:30AM (#48157107)
Also....

Maven doesn't have "preinstall, install, post install", or " build.rs" for rust, executing arbitrary code during the installation.

The code that's executing with Maven is in your pom.xml, not some hidden code from a transient dependency.

That alone is a major design flaw in both npm and cargo.

Java is boring, because it works. People don't like boring stuff. It's more exciting to play the Russian roulette on each install!

Re:'No way to prevent this,' says only package manager where... by pkolaczk on Saturday May 16, 2026 @03:33AM (#48157727)
As a heavy user of Java I can assure you that Java is very very far from boring, especially when building it with maven or gradle. There are millions ways something can screw up the build. Rust (and Go too) in comparison is much more boring actually - it maybe I was just lucky, but the majority of stuff just builds with zero issues.

Especially the number of times I had to clean all the caches in order for maven and gradle to build the project is just far too high for me. It shouldn’t ever be needed if an ecosystem is meant to be considered boring. I feel like Java doesn’t build when I look at it wrong.

Re:'No way to prevent this,' says only package manager where... by MattPalmer1086 on Saturday May 16, 2026 @03:58AM (#48157889)
Yep, sounds boring!
Re:'No way to prevent this,' says only package manager where... by robotnikman on Saturday May 16, 2026 @04:35PM (#48163560)
> I feel like Java doesn’t build when I look at it wrong.

Hah, too true! I guess it is boring in the fact that it is not as... move fast and break things... as NPM. But Java build systems are still certainly fun and challenging in their own ways.

Re:'No way to prevent this,' says only package manager where... by panzi on Saturday May 16, 2026 @12:19PM (#48161530)
How does Maven handle JNI? Is it also a build system for C/C++, or do packages with native bindings require manual build steps?
Re:'No way to prevent this,' says only package manager where... by panzi on Sunday May 17, 2026 @12:15PM (#48170257)
I googled a bit and found this snippet:

            <plugin>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.5.1</version>
                <groupId>org.codehaus.mojo</groupId>
                <executions>
                    <execution>
                        <id>Generate-shared-lib</id>
                        <phase>package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>bash</executable>
                            <arguments>
                                <argument>generate-lib.sh</argument>
                            </arguments>
                            <environmentVariables>
                                <JAVA_HOME>${env.JAVA_HOME}</JAVA_HOME>
                            </environmentVariables>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
At least with certain plug-ins Maven will execute arbitrary commands at build time. And if you need that to build native bindings it feels like a big hole. Granted, most projects don't need JNI, I guess.
Re:'No way to prevent this,' says only package manager where... by jollyllama on Friday May 15, 2026 @10:03PM (#48156128)
> It seems like it might just be that Python/npm are juicier targets?

Attackers go where the victims are. Frontend is a monoculture with the vast majority using NPM; backend, less so. This isn't an excuse for NPM, but another strike against it.

You could also argue that the attacks make a deeper point about frontend vs backend devs, but I won't go there.

Re:'No way to prevent this,' says only package manager where... by bichiliad on Friday May 15, 2026 @11:28PM (#48156580)
Why would you even imply something like that?
[dead]
Re:'No way to prevent this,' says only package manager where... by rembicilious on Saturday May 16, 2026 @12:32AM (#48156862)
Is this a dogfooding joke?
Re:'No way to prevent this,' says only package manager where... by llbbdd on Saturday May 16, 2026 @01:13AM (#48157030)
They feel the need to compete given that jokes about "backend" devs write themselves
Re:'No way to prevent this,' says only package manager where... by lucketone on Saturday May 16, 2026 @02:06AM (#48157277)
Frontend has lower barrier of entry and more appeal for beginners, so its bell curve might have its left edge is thicker. It impacts the avg of problems and culture of dealing with them
Re:'No way to prevent this,' says only package manager where... by llbbdd on Saturday May 16, 2026 @01:07PM (#48161944)
More appeal I agree because it's easier to see useful results and iterate quicker. Lower barrier of entry I disagree with strongly; if the barrier to entry were so low I don't know why I've worked with so many otherwise-talented backend devs that can't wrap their heads around the frontend to save their lives. Frontend forces you to deal with real-world customer problems sooner rather than later; performance is more important, it has to work on more than one environment, you have a frame budget. It's like saying game development has a low barrier to entry; you might be able to get started quickly but you will run into constraints unless you learn fast. On the backend you can just pay another dollar for a VPS twice the size.
Re:'No way to prevent this,' says only package manager where... by jollyllama on Saturday May 16, 2026 @11:17AM (#48160955)
The fact that a package manager which keeps separate versions of each package for each dependency that it has became the accepted default that everyone in the frontend community uses as a foundation for their projects speaks to a lack of care or understanding within that community for technical matters.
Re:'No way to prevent this,' says only package manager where... by lostglass on Friday May 15, 2026 @10:05PM (#48156143)
To be honest Rust has the exact same supply chain attack pattern - it's just newer and more maintained at the moment. Give it a decade.
Re:'No way to prevent this,' says only package manager where... by marcosdumay on Saturday May 16, 2026 @12:09AM (#48156738)
Programs in Rust (or almost every other language) normally have fewer dependencies by 2 or 3 orders of magnitude.

And that number tends to reduce even more when the ecosystem matures.

Re:'No way to prevent this,' says only package manager where... by rascul on Saturday May 16, 2026 @11:52AM (#48161262)
It may be fewer but it still doesn't feel good when cargo pulls in hundreds of deps for a seemingly simple application. But maybe it seems simple because of all the deps...
Re:'No way to prevent this,' says only package manager where... by anthk on Saturday May 16, 2026 @12:12PM (#48161467)
This; even Golang for medium sized projects (NNCP, Yggdrasil) have about 8-10 deps on average. Rust's dependency chain it's unmanageable for a distro manager.
Re:'No way to prevent this,' says only package manager where... by marcosdumay on Saturday May 16, 2026 @03:31PM (#48163036)
Agreed, but that's the reason why it keeps being a huge problem in JS while other languages only have an eventual small trouble.

But also, almost all of those deps on all simple apps are the same in Rust. They are the same for a large part in JS too, but it's for a smaller part than on most languages.

Re:'No way to prevent this,' says only package manager where... by anthk on Saturday May 16, 2026 @12:11PM (#48161451)
From Golang the Rust dependency size it's closer to NPM than Go.
Re:'No way to prevent this,' says only package manager where... by slopinthebag on Saturday May 16, 2026 @12:08AM (#48156735)
Supply chain attacks are available to every language and framework that uses dependencies or modules you don’t control.
Re:'No way to prevent this,' says only package manager where... by nothinkjustai on Friday May 15, 2026 @10:07PM (#48156151)
Rust doesn’t have post install scripts
Re:'No way to prevent this,' says only package manager where... by est31 on Friday May 15, 2026 @10:18PM (#48156211)
There is build.rs, proc macros are unsandboxed, and lastly you install the binary so that you can run it. Even if the build and install were fully sandboxed, the binary could still do malicious stuff if ran.
Re:'No way to prevent this,' says only package manager where... by drdaeman on Friday May 15, 2026 @11:25PM (#48156563)
Even without post-install script, a malicious payload could be hiding in some function and just wait until the developer invokes `cargo run`. Not that many people audit the crates they pull into their projects.
Re:'No way to prevent this,' says only package manager where... by nothinkjustai on Friday May 15, 2026 @11:56PM (#48156683)
Yeah no shit, if you download malicious code from the internet and run it on your computer you will get pwned. No matter if it’s from a package manager a zip file or a submodule.

However the current npm vulns used a post install script.

Re:'No way to prevent this,' says only package manager where... by mort96 on Saturday May 16, 2026 @01:31AM (#48157114)
I maintain that NPM malware use postinstall scripts just because they exist and are convenient. Had NPM not had postinstall scripts, the malware would have used a different mechanism and been almost exactly as effective.
Re:'No way to prevent this,' says only package manager where... by fabrice_d on Friday May 15, 2026 @10:10PM (#48156169)
It has build.rs that will run as soon as you compile the dependency. That's not the same thing but pretty close to a post install script: it's very likely to run.
Re:'No way to prevent this,' says only package manager where... by deeebug on Friday May 15, 2026 @10:10PM (#48156167)
Re:'No way to prevent this,' says only package manager where... by tasn on Friday May 15, 2026 @10:10PM (#48156165)
It has build.rs, which has essentially the same problems.
Re:'No way to prevent this,' says only package manager where... by aselimov3 on Saturday May 16, 2026 @07:27AM (#48159183)
Yea I’m a big fan of rust but it does feel uncomfortable to see my dependency blowing up to the hundreds when I build
Re:'No way to prevent this,' says only package manager where... by nirvdrum on Friday May 15, 2026 @10:25PM (#48156244)
Part of the point the article makes is that most other popular languages have a comprehensive standard library. JS has an astonishingly small on. Rather than have one vetted set of libraries that ship with the language, applications either need to roll it themselves or pull from a 3rd party package repository. We've drilled NIH into people, so they tend to reach for packages. That's not necessarily a bad thing, but it often means they're pulling in more code than they need. The JS ecosystem has also favored smaller modules, so you need many of them. And everyone builds on top of that, leading to massive growth in dependency graphs. It's a huge surface area for things to go wrong, intentionally or not.

With many other languages, you have a lot of functionality out of the box. Certainly, there have been bugs and security issues, but they're a drop in the bucket compared to what you see in the JS ecosystem. With other languages, you have a much smaller external dependency graph and the core functionality is coming from a trusted 3rd party.

Re:'No way to prevent this,' says only package manager where... by cluckindan on Friday May 15, 2026 @10:42PM (#48156353)
What important functionality do you feel is missing from the commonly used JS environments (node and browser) that is causing people to install it as a third party dependency?

The issue isn’t that the functionality doesn’t exist, it’s always backwards compatibility with versions where it did not yet exist.

Re:'No way to prevent this,' says only package manager where... by sidewndr46 on Saturday May 16, 2026 @10:04AM (#48160370)
How can one have a backwards compatibility issue if the solution didn't exist yet?
Re:'No way to prevent this,' says only package manager where... by cluckindan on Sunday May 17, 2026 @10:09AM (#48169062)
Polyfills/ponyfills for functionality that has been specified but not yet (widely) implemented, or just missing from some blessed runtime at hand.
Re:'No way to prevent this,' says only package manager where... by apothegm on Friday May 15, 2026 @10:28PM (#48156262)
Why Python, tho, in that case? Its stdlib is quite robust. Surprisingly so in some areas.
Re:'No way to prevent this,' says only package manager where... by saghm on Friday May 15, 2026 @10:44PM (#48156362)
I'm not convinced that Python should be the standard for package management either. Earlier this week I was trying to publish a Python package for the first time wrapping a Rust library I wrote (for use only on Linux and Python 3.12+), and it literally took me hours to get from "I have a wheel that I can import and it works on my system" to "I have published that wheel and can install the package from PyPI on the set of systems that I'm trying to support and it actually works". Everything I've heard about this indicates that the situation for Python packaging is literally better than it ever has been before with the current tooling, so I can't even imagine how bad it was for the decades before. In comparison, having literally never touched npm before, I was able to publish a wrapper around the same library and validate that it was working in maybe 10 minutes (most of which were spent from not realizing that a certain tool was failing with a vague "file not found" error because I hadn't installed npm yet).

I'm not saying that npm is doing everything right, but I suspect that beyond the obvious low-hanging fruit that we hear about pretty consistently with npm there's probably a long tail of less obvious stuff that can be exploited that will not be specific to npm. The fundamental problems with supply-chain vulnerabilities aren't going to go away if npm magically became pip or go modules overnight.

Re:'No way to prevent this,' says only package manager where... by otabdeveloper4 on Saturday May 16, 2026 @02:03AM (#48157257)
> Python should be the standard for package management

Python is the antistandard for package management. Or maybe even the eldritch horror of package management.

Re:'No way to prevent this,' says only package manager where... by dv35z on Saturday May 16, 2026 @03:46AM (#48157813)
Curious if we included package managers from operating system distros (example: Debian apt), in your experience, what do you suggest JavaScript/Python/Rust package managers learn / borrow from?
Re:'No way to prevent this,' says only package manager where... by darkteflon on Saturday May 16, 2026 @05:55AM (#48158642)
Thanks to uv, all is forgiven.
Re:'No way to prevent this,' says only package manager where... by Macha on Saturday May 16, 2026 @07:47AM (#48159308)
Part of me wonders if the reason we see more npm attacks than pypi attacks is malware authors not wanting to deal with python packaging either
Re:'No way to prevent this,' says only package manager where... by fud101 on Saturday May 16, 2026 @03:37PM (#48163095)
Hilarious but would they not abuse LLMs for this if so?
Re:'No way to prevent this,' says only package manager where... by apothegm on Saturday May 16, 2026 @07:53AM (#48159355)
I’m not suggesting pythons package management was good. This thread was started with a post about JS and Python, and I was responding to a message saying JS is so vulnerable to package repository attacks because its stdlib is so small. But Python’s been vulnerable too in spite of a robust stdlib.

And IMO the complaints about Python packaging tooling are overblown. Setuptools on its own was a bit disappointing, but coming from PHP 20 years ago it was a revelation! Virtualenvs and requirements.txt were an further improvement and so was pip — in an era where most other scripting languages didn’t have pinning for sub dependencies either; but you could always “pip freeze” to capture everything.

Later on, pipenv wasn’t perfect, but it was enough. I never ran into any of the headaches people keep saying poetry and uv solve. Poetry on the other hand always gives me one reason or another to beat my head against a wall.

That said, I’ve never bothered to try to publish anything and can’t comment on that end of it.

Re:'No way to prevent this,' says only package manager where... by skydhash on Saturday May 16, 2026 @12:31AM (#48156854)
> Part of the point the article makes is that most other popular languages have a comprehensive standard library.

Both the Browser and Node.js standard library are fairly extensive. I don't think there's much you can do with other language you can't do with Node.js. And as a lot of newer languages have demonstrated (like zig and hare), you don't need an extensive one.

Re:'No way to prevent this,' says only package manager where... by themafia on Saturday May 16, 2026 @12:34AM (#48156869)
It used to be true. The early days of node were pretty paltry. I think a lot of developers and projects have picked up these dependencies by habit and accretion and have never factored them out.
Re:'No way to prevent this,' says only package manager where... by skydhash on Saturday May 16, 2026 @01:12AM (#48157028)
My pet peeve is when a developer picks up a library for just a few lines of code, and it turns that this library picks up another one that's not even relevant to its core domain. Whenever you get to the leaves of the dependency tree, it usually turns into a joke. Byte sized libraries everywhere.

Like you have axios.js that decides in turn to depends on the "follow-redirects" library. IMO, the best move would be for axios to vendor the code. Same with "proxy-from-env" Just tiny libraries scattered all over the web. Something like axios, should purely depends on the runtime library.

Re:'No way to prevent this,' says only package manager where... by panzi on Friday May 15, 2026 @10:03PM (#48156130)
Last I checked npm had 2FA for publishing, but cargo didn't. I don't think cargo is any better than npm, just not that of an attractive target.
Re:'No way to prevent this,' says only package manager where... by cookiengineer on Friday May 15, 2026 @09:47PM (#48156057)
I suppose that go's go:generate workflow can also be abused to land a worm like the ones spreading via npm, as you can build programs that just scrape the whole hard drive for git projects and patch the go.mod dependencies there, and you could also just write this in go as a toolchain script, for example.

NPM's achilles is the pre/postinstall step which can run arbitrary commands and shell scripts without the user having any way to intervene.

Dependencies must be run in isolated chroot sandboxes or better, inside containers. That would be the only way to mitigate this problem, as the filesystem of the operating system must be separated from the filesystem of the development workflow.

On top of that most host based firewalls are per-binary instead of per-cmdline. That leads to the warnings and rules relying on that e.g. "python" or "nodejs" getting network access allowlisted, instead of say "nodejs myworm.js". So firewalls in general are pretty useless against this type of malware.

Re:'No way to prevent this,' says only package manager where... by yegle on Friday May 15, 2026 @10:03PM (#48156134)
`go:generate` is for the package provider, the command never runs when someone `go install` or `go get` the package.
Re:'No way to prevent this,' says only package manager where... by cookiengineer on Friday May 15, 2026 @10:12PM (#48156180)
Note that the NPM worms are spreading because the package providers are developing on their libraries without them noticing a malicious dependency. It is not users/consumers spreading the worm, it is developers spreading it.

Your mismatch is that you think in policies, not assessments here. Nothing in my normal go workflow will ask me if I want to run "curl download whatever from the internet" when I run go build.

Though I agree with the difference in workflow, there is not a single mechanism in go catching this. go.mod files can be just patched by the worm, and/or hidden behind a /v123 folder or whatever to play shenanigans on API differences.

Re:'No way to prevent this,' says only package manager where... by xena on Friday May 15, 2026 @10:03PM (#48156135)
go:generate is done at dev time, not at build time.
Re:'No way to prevent this,' says only package manager where... by cookiengineer on Friday May 15, 2026 @10:05PM (#48156145)
Actually bindings are usually generated like that, at build time (though with a build cache that nobody knows how it corrupts all the time).

Examples that come to mind: webview/webview, webkit, cilium/ebpf and most other CGo projects that I have seen.

Re:'No way to prevent this,' says only package manager where... by arccy on Saturday May 16, 2026 @08:50AM (#48159801)
you only run them for your own project, not the generate directives of your dependencies though
Re:'No way to prevent this,' says only package manager where... by raggi on Friday May 15, 2026 @10:18PM (#48156208)
none. they just have smaller target populations.
Re:'No way to prevent this,' says only package manager where... by jiggawatts on Friday May 15, 2026 @10:10PM (#48156164)
Generally, other package managers aren't great either. Notably, crates.io / cargo has some of the same issues as NPM and the verbiage of their excuses for not fixing these problems is oddly similar.

Something fascinating about the design and architecture of programming languages and their surrounding ecosystems is the enormous leverage that they provide to the "core team":

For every 1 core language developer[1]...

... there may be 1,000 popular package developers...

... for which there may be 1,000,000 developers writing software...

... for over 1,000,000,000 users.

This means that for every corner that is cut at the top of that pyramid, the harms are massively magnified at the lower tiers. A security vulnerability in a "top one thousand" package like log4j can cause billions of dollars in economic damage, man-centuries of remediation effort, etc.

However, bizarrely, the funding at the top two levels is essentially a pittance! Most such projects are charities, begging for spare change with hat in hand on a street corner. Some of the most used libraries are often volunteer efforts, despite powering global e-commerce! cough-OpenSSL-cough.

The result is that the people most empowered to fix the issues are the least funded to do so.

This is why NPM, Crates.io, etc... flatly refuse to do even the most basic security checks like adding namespaces and verifying the identity of major publishers like Google, Microsoft, and the like.

That's a non-zero amount of effort, and no matter how trivial to implement technically or how cheap to police, it would likely blow their tiny budget of unreliable donations.

The exceptions to this rule are package managers with robust financial backing, such as NuGet, which gets reliable funding from Microsoft and supports their internal (for-profit!) workflows almost as much as it does external "free" users.

"Free and open" is wonderful and all, but you get what you pay for.

[1] Most of us can name them off the top of our heads: Guido van Rossum, Larry Wall, Kerningham & Richie, etc.

Re:'No way to prevent this,' says only package manager where... by kibwen on Saturday May 16, 2026 @12:28AM (#48156838)
You appear to have missed that NPM is owned by Microsoft.

In addition, crates.io has not flatly refused to support namespaces, there's an entire accepted RFC for it: https://github.com/rust-lang/rfcs/pull/3243

At the same time, note that namespacing does nothing to prevent any sort of problem here. Namespacing is great for package organization and making provenance more deliberately obvious, but beyond that it's not a security measure.

Re:'No way to prevent this,' says only package manager where... by jiggawatts on Saturday May 16, 2026 @01:47AM (#48157192)
> NPM is owned by Microsoft.

I did not miss that.

The "culture" of NPM was firmly established long before the acquisition by Microsoft.

Similarly, there clearly isn't the same feeling of "ownership" over NPM and its giant pile of anonymously published packages as there is over NuGet where a substantial fraction of the traffic is Microsoft customers downloading Microsoft packages for Microsoft DotNet development on Microsoft Visual Studio for Microsoft Windows Server.

Re:'No way to prevent this,' says only package manager where... by 0xbadcafebee on Saturday May 16, 2026 @12:19AM (#48156792)
"What are the actual guarantees that <guy leaving his keys on his dashboard> make that <guy leaving his keys on an illuminated blinking sign outside his house> don't make?"