News for hackers. Stuff that matters.
Re:NPM packages from Red Hat have been compromised by nailer on Monday June 01, 2026 @10:25AM (#48357270)
I've deleted and am rewriting this, to be more explicit, because HN downmodded the first comment to hell but I know I'm right and the crowd is wrong.

So, explicitly:

- pip

- Cargo

- apt/dpkg

- dnf/yum

- Homebrew

- RubyGems

- Composer (limited)

- Maven

...all allow scripts.

We understand the reference, it's just not correct: most package managers allow scripts, npm is the most successful package manager.

npm shouldn't allow scripts, but exploits happen everywhere.

Re:NPM packages from Red Hat have been compromised by krautsauer on Monday June 01, 2026 @11:23AM (#48358083)
Are scripts even necessary? I don't think e.g. mvn has any form of scripts¹, but if the dependency is compromised, you're likely to execute whatever compromised code is in there the next time you do mvn verify (or whatever). Slightly less wormable maybe, running tests or at least checking whether your thing still runs after upgrading package versions is really common, no?

¹ Annotation processors are a thing and somewhat similar to rust macros in function, but you need to set those up manually for each dependency, iirc.

Re:NPM packages from Red Hat have been compromised by Zardoz84 on Monday June 01, 2026 @12:17PM (#48358882)
ant-plugin and maven-assembly.

But pulling a maven dependency DON'T run anything. You must download the repository that contains the POM.XML and run mvn with any goal that triggers the lifecycle.

Maven 4 aims to separate distribution and build poms. Currently, we generate distribution pom.xml for distribution using flatten plugin.

Re:NPM packages from Red Hat have been compromised by m4rtink on Monday June 01, 2026 @10:43AM (#48357515)
If DNF/RPM is used there will often be a separate distro maintainer that should ideally review any changes coming from the upstream before pulling them into the distribution.

Also not all maintainers always pull in the latest upstream changes, only rebasing to new stable release or when the new features or fixes are actually needed for the distro stack.

Definitely not bulletproof but still IMHO more robust than "Lets just spray latest code from upstream without any review directly to production with a firehose!" that seems to be the norm.

Re:NPM packages from Red Hat have been compromised by isityettime on Monday June 01, 2026 @11:26AM (#48358122)
Yeah with RPM and dpkg you're trusting the distro, or maybe individual distro maintainers, depending on how you consider it. But there are norms in the distro about what those scripts are for and how to use them, and there's some social enforcement around that.

The real issue for hooks in packaging formats like those is when you start adding third-party vendor repositories, e.g., Zoom, Google Chrome, Discord. None of the social enforcement mechanisms are there and the companies behind the products I just mentioned all have histories of abusing them.

That's why it's generally better to use Flatpak for things like that if your distro itself doesn't include them.

Re:NPM packages from Red Hat have been compromised by nailer on Monday June 01, 2026 @11:53AM (#48358541)
> Yeah with RPM and dpkg you're trusting the distro, or maybe individual distro maintainers, depending on how you consider it.

Not all packages come from the distro. People can and do enable external sources for software that isn't part of their OS.

Re:NPM packages from Red Hat have been compromised by isityettime on Monday June 01, 2026 @05:54PM (#48363176)
Read the third sentence in the comment you're ostensibly replying to, friend.
Re:NPM packages from Red Hat have been compromised by cozzyd on Monday June 01, 2026 @11:26AM (#48358126)
Yes and typically updates take a while to be deployed...
Re:NPM packages from Red Hat have been compromised by tetha on Monday June 01, 2026 @01:09PM (#48359644)
Also the APT and RPM world lets packages sit for a long time - those are called "testing" and "unstable" in the Debian world. It's slow, but it seems hard to move intentional exploits with short-term payoffs through as far as we can see.

That's also why I am actively moving a fundamental and important internal service we have to just use python dependencies packaged in Debian stable packages. Sure, it may be a year or two behind in features, I may loose a nice debugging tool or two, but it is a very stable footprint, has security updates, breaks rarely. For ops-internal scripting and tooling, it's good.

Re:NPM packages from Red Hat have been compromised by bananamogul on Monday June 01, 2026 @11:56AM (#48358591)
You didn't include Perl's CPAN, which I think is older (1995) than all of these. And it allows scripts as well.
Re:NPM packages from Red Hat have been compromised by xienze on Monday June 01, 2026 @10:56AM (#48357649)
Maven does not run arbitrary scripts just by including a dependency.
Re:NPM packages from Red Hat have been compromised by matheusmoreira on Monday June 01, 2026 @10:55AM (#48357628)
> HN downmodded the first comment to hell but I know I'm right and the crowd is wrong.

Got downvoted for saying it too. Don't let it discourage you.

Re:NPM packages from Red Hat have been compromised by wang_li on Monday June 01, 2026 @11:28AM (#48358143)
It's not the package manager, it's the repo and the cryptographic signatures that are trusted by the package manager and the users who choose to point their pacakge managers at those repos. The fundamental problem here is that people's risk assessment is treating a user named devioustiger12345 as having the same situation and story as Microsoft/Apple/Red Hat.