this post was submitted on 23 Apr 2026
594 points (99.8% liked)

Selfhosted

58738 readers
1215 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] Dop@lemmy.zip 4 points 11 hours ago (1 children)

What is npm? How do I know I'm not using it?

[–] sunbeam60@feddit.uk 1 points 55 minutes ago

Short answer: If you don’t know if you’re using it, you’re very likely not using it.

Npm is a package manager for node.js, a programming framework for JavaScript.

[–] quick_snail@feddit.nl 43 points 1 day ago (12 children)

Don't. Use. Npm.

That applies to pip and crate and all the other shitty lang package managers that totally fail at security

[–] captcha_incorrect@lemmy.world 40 points 1 day ago (2 children)

What should be used instead?

[–] quick_snail@feddit.nl 8 points 17 hours ago (1 children)

A package manager that uses cryptographic signatures. Apt had this since 2005 iirc. Use apt.

[–] AtHeartEngineer@lemmy.world 6 points 14 hours ago (1 children)

if the dev(s) gets compromised there's the same issue, except with an extra checkmark on it.

[–] quick_snail@feddit.nl 2 points 14 hours ago (1 children)

Packages are reviewed by package maintainers.

Humans are required to solve a malicious insider. But most supply chain vulns of these shitty software dependency managers were resolved decades ago by freely available cryptography

[–] AtHeartEngineer@lemmy.world 2 points 10 hours ago

Human review really should be what's needed, maybe not even just by the package maintainers.

[–] grandma@sh.itjust.works 22 points 1 day ago

Easy, just vendor all your dependencies! Can't have a supply chain attack if you are the supply chain.

[–] HubertManne@piefed.social 3 points 15 hours ago (2 children)

so many workplaces I have been at used npm.

[–] victorz@lemmy.world 1 points 9 hours ago

We just recently switched from npm to pnpm, due to all the supply chain attacks. I did the PR for it, even.

Our release schedule is like a year though so we don't really have to worry much about releasing compromised dependencies. But still, better to be on the safer side.

[–] quick_snail@feddit.nl 3 points 14 hours ago

Yep. And so many workplaces have had security vulnerabilities caused by dumb decisions that could have been easily avoided

[–] pineapple@lemmy.ml 5 points 18 hours ago (2 children)
[–] rmrf@lemmy.ml 6 points 19 hours ago (4 children)

Honestly just fine use computers at all, completely eliminate the remote attack vector. And only drink rain water since city water can be compromised.

Or, recognize this is a normal part of using software and have more than 1 thing between you and a breach

[–] quack@lemmy.zip 30 points 17 hours ago (1 children)

The rules of cybersecurity:

  1. Under no circumstances should you own a computer.

  2. If you absolutely must own a computer, under no circumstances should you connect it to the internet.

  3. If you absolutely must connect it to the internet, it’s too late and they already have you

[–] HubertManne@piefed.social 3 points 15 hours ago

I know this is a joke but im old enough we used to install the os and had it on the network and eventually update it but then it got to the point were like being connected to the internet for like a minute and the machines were compromised. Thats when we got off our duffs and started making custom installs that had updates and configurations and software pre installed before we even connected it to the net.

Dude, rain water is full of pollutants too. 😂

[–] quick_snail@feddit.nl 3 points 17 hours ago (1 children)
[–] stardreamer@lemmy.blahaj.zone 6 points 14 hours ago* (last edited 14 hours ago) (1 children)

And how would apt help in this particular case? A supply chain attack can happen with any particular package manager. In this case, the compromised package was detected and mitigated within 93 minutes, affecting a total of ~330 users. Which is a lot better than how a lot of distros handled the xz breach last year.

All reasonably secure package managers (and https) operate on a chain of trust. There is little that can be done if that chain of trust is broken.

Based on this the cause was a malicious VSCode extension that stole credentials that were later used to trigger a deployment CI/CD pipeline. If there's anything to learn from this, it's probably to not use VSCode.

[–] quick_snail@feddit.nl 2 points 14 hours ago (1 children)

With cryptography. X.509 is trash. They should pin the public key.

[–] stardreamer@lemmy.blahaj.zone 3 points 13 hours ago (1 children)
  1. If your assumption is that X509 is trash, does that mean you hold the same amount of distrust to TLS?
  2. How do you propose the scaling of key management? Do you have a reasonable alternative to users blindly trusting every single key they come across?
  3. Back to my original question: what prevents a VSCode extension from stealing a private signing key (as opposed to an API key) and causing the same issues described here?
[–] quick_snail@feddit.nl 1 points 2 hours ago (1 children)

TLS is fine with certificate pinning m

[–] stardreamer@lemmy.blahaj.zone 1 points 1 hour ago

That still leaves two out of three questions unanswered. Most importantly the last one, which was addressed towards the original complaint.

load more comments (1 replies)
load more comments (8 replies)
[–] panda_abyss@lemmy.ca 169 points 1 day ago (14 children)

Can we stop using npm now?

I swear to god the number of attacks like this or spawned from other attacks like this is fucking stupid. I’ve gender seen anything like it.

[–] i_am_not_a_robot@discuss.tchncs.de 63 points 1 day ago (4 children)

This problem has nothing to do with NPM. Checkmarx was compromised last month, and during that compromise there were malicious VS Code extensions published to Visual Studio Code Marketplace. A Bitwarden developer says that somebody ran one of those malicious extensions, and GitHub API keys were stolen which were used in publishing the malicious CLI package.

It's probably better that it happened on NPM. If the CLI were only downloadable from the Bitwarden website, it would have likely taken longer for somebody to notice something was wrong.

load more comments (4 replies)
[–] anyhow2503@lemmy.world 11 points 1 day ago (1 children)

Npm probably has the biggest attack surface and many of the libraries hosted there are in extremely widespread use. They've taken some steps to mitigate these supply chain attacks, but as we've seen with more recent examples, it's unrealistic to think they can be prevented completely. Most of these attacks use stolen developer credentials, which invalidates almost all potential security measures on the registry side and the best you can hope for is catching a malicious package quickly. To be clear: I think the JS ecosystem is uniquely positioned to be the prime target of supply chain attacks and while that doesn't excuse the slow implementation of security measures from the npm team, the people arguing that other package managers and registries aren't vulnerable to this have to be huffing fumes.

[–] panda_abyss@lemmy.ca 7 points 21 hours ago (2 children)

That’s fair, I won’t pretend pypi/pip and running uvx is much safer than npx.

But why hasn’t JavaScript established a defacto stdlib to replace ask the left pads and is even type packages?

I’ve taken a near zero dependency policy on my personal projects regardless, and now I run most code in containers to sandbox it.

[–] savedbythezsh@sh.itjust.works 2 points 11 hours ago

If you're asking why there isn't one shipped with JS, the answer is because JS is built for the web, and the "don't break the web" rule makes changing things in JS hard, as well as browser devs pushing back hard on anything that increases install size.

If you're asking why as a community, we haven't agreed on a single package to be a stdlib - lodash.

[–] anyhow2503@lemmy.world 3 points 15 hours ago

But why hasn’t JavaScript established a defacto stdlib to replace ask the left pads and is even type packages?

I'm guessing things were working out pretty alright, even with the insane amount of dependencies per project. The awareness and the increasing frequency of supply chain attacks is relatively recent for npm. But who knows, maybe the tech giants in control of the web standards are happy to keep using their own vendored registries.

[–] LurkingLuddite@piefed.social 40 points 1 day ago (10 children)

Genuine question. How is NPM more vulnerable than other repos? Haven't similar supply chain attacks succeeded at least as well as this one through GitHub itself and even Linux package repos?

[–] Serinus@lemmy.world 42 points 1 day ago (5 children)

Larger standard libraries do a lot. It's a lot harder to sneak vulnerabilities into the basic C# or Java or C++ libraries than it is to add a vulnerability to something one dude maintains in the javascript ecosystem.

And since javascript libraries tend to be so small and focused, it's become standard practice for even other libraries to pull in as many of those as they want.

And it stacks. Your libraries pull in other libraries which can pull in their own libraries. I had a project recently where I had maybe a dozen direct dependencies and they ended up pulling in 1,311 total libraries, largely all maintained by different people.

In a more sane ecosystem like C#, all the basics like string manipulation, email, or logging have libraries provided by Microsoft that have oversight when they're changed. There can be better, third-party libraries for these things (log4net is pretty great), but they have to compete with their reputation and value over the standard library, which tends to be a high bar. And libraries made on top of that system are generally pulling all those same, certified standard libraries. So you pull in 3 libraries and only one of those pulls in another third party single library. And you end up with 4 total third party libraries.

Javascript just doesn't really have a certified standard library.

(This certified standard library doesn't have to be proprietary. Microsoft has made C# open source, and Linus Torvalds with the Linux Kernel Organization holds ultimate responsibility for the Linux kernel.)

load more comments (5 replies)
load more comments (9 replies)
load more comments (11 replies)
[–] BlackEco@lemmy.blackeco.com 104 points 1 day ago (1 children)

It has only been available for 2h30 on NPM, so unless you had the misfortune of installing the latest version in this short window, you should be fine. Thankfully people have been able to quickly catch this.

[–] northendtrooper@lemmy.ca 94 points 1 day ago (5 children)

This is one of the reasons why I update a version or two behind. The other reason is because I'm lazy.

load more comments (5 replies)
load more comments
view more: next ›