this post was submitted on 02 Sep 2024
28 points (96.7% liked)

Cybersecurity

5687 readers
49 users here now

c/cybersecurity is a community centered on the cybersecurity and information security profession. You can come here to discuss news, post something interesting, or just chat with others.

THE RULES

Instance Rules

Community Rules

If you ask someone to hack your "friends" socials you're just going to get banned so don't do that.

Learn about hacking

Hack the Box

Try Hack Me

Pico Capture the flag

Other security-related communities !databreaches@lemmy.zip !netsec@lemmy.world !cybersecurity@lemmy.capebreton.social !securitynews@infosec.pub !netsec@links.hackliberty.org !cybersecurity@infosec.pub !pulse_of_truth@infosec.pub

Notable mention to !cybersecuritymemes@lemmy.world

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] breadsmasher@lemmy.world 4 points 2 months ago (2 children)

Why does it seem to be specifically npm packages being attacked/mimicked to spread malware? I don’t see the same for nuget or maven, for example. Not to say they don’t have the same issue, just vastly fewer issues? Maybe I just don’t see the information - is it just that npm is used so much more, in general, so its the best attack vector?

[–] lemmy_in@lemm.ee 10 points 2 months ago (1 children)

In my (non-expert) opinion, there are a few reasons

  1. NPM is more popular than those other services by an order of magnitude, especially among new developer and startups.
  2. NPM allows for code to be executed while you install the package which is different from maven or nuget and allows for easy exploitation paths
[–] x1gma@lemmy.world 4 points 2 months ago

NPM allows for code to be executed while you install the package which is different from maven or nuget and allows for easy exploitation paths

This is the winner. Combine that with a vastly bigger group of inexperienced developers (and I'm willing to die on that hill), and you have a lot of people running node / npm as an admin / root user, who have close to zero idea what they are doing, hitting their project with third party dependencies left and right for no particular reason (left-pad, is-number, ansi console and similar useless crap), and then your dependency management allows for code execution. Also, from my personal feeling, it seems that npm simply cannot properly audit the packages due to the sheer mass. From a technical standpoint it's close to trivial to put your malware onto npm, and then you just need to get someone to install your package, which is way simpler than in other package managers