Live data from Hacker News

Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

safedep.io

71–80 of 329 posts

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#71
post #18

are these fixed removed now?

Seems like it is fixed/removed: https://github.com/antvis/.github/commit/cb641113703e531ee43...

Some are still on npm but marked "deprecated":

https://www.npmjs.com/package/size-sensor/v/1.0.4?activeTab=...

As the article states, you can see in the package.json that the optionalDependencies references "@antv/setup": "github:antvis/G2#7cb42f57561c321ecb09b4552802ae0ac55b3a7a"

I'm pretty sure those commits have been removed from github:

https://github.com/antvis/G2/issues/7401#issuecomment-448480...

https://github.com/antvis/G2/issues/7394

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#72
post #26
post #20

Earlier quoted context omitted.

> Make sure you're running a rootless VM engine (e.g. podman instead of docker) ! Aren't most people running docker rootless (at least on Linux)? Does podman do more?

The docker CLI tool is normally executed with user privileges, but there's dockerd, a daemon running as root that actually does the container execution.

Installing docker doesn't require root.

"Rootless mode lets you run the Docker daemon and containers as a non-root user."

https://docs.docker.com/engine/security/rootless/

This is how docker is best installed on Linux, and there's a convenience script for it as well (https://get.docker.com/rootless). I am surprised that's not how people are using docker.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#73
post #26

Earlier quoted context omitted.

The docker CLI tool is normally executed with user privileges, but there's dockerd, a daemon running as root that actually does the container execution.

im not sure people understand the security vectors. a user with docker permissions effectively has root permissions. often, docker in docker is used to manage docker orchestration. putinng a user in a docker and peoviding docker access is security through obscurity. on the flip side, i see people blindly installing tools and skills not understanding they are pushing context and capabilities without any significant se…

Docker has not required root for a long time, at least on Linux. There's even a convenience script for it: https://get.docker.com/rootless

Almost everyone I know installs docker rootless.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#74

Another day, another pre/postinstall script executed that could have easily have been prevented by any sane package manager. NPM really desperately needs an 'allowBuilds' style allowlist [1] and 'approve-builds' command [2]. 1. https://pnpm.io/settings#allowbuilds 2. https://pnpm.io/cli/approve-builds

After I upgraded pnpm to v11, I set all allowBuilds to false and have not observed any failures. Made me wonder why the packages even need build scripts. My guess is for obscure or old platforms, but for most users running on Linux or Darwin build scripts seem to be unnecessary.

> Made me wonder why the packages even need build scripts

As the name implies it's for building stuff. Most (all?) packages that use C++ FFI with node-gyp need it. A popular package that needs it is re2.

Many newer packages bundle prebuilt native code as transitive dependencies, so build scripts are less needed than before.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#76

> Docker Container Escape > The payload checks for the Docker socket and, if present, attempts container escape through three sequential methods: So even if you're running devcontainers / VMs, these worms are already trying to escape. Make sure you're running a rootless VM engine (e.g. podman instead of docker) !

Why not run a proper virtual machine?

That's the direction container runtimes are trending

Amazon has been doing it with Firecracker for a while and Kata containers is another popular one

https://github.com/firecracker-microvm/firecracker

https://github.com/kata-containers/kata-containers

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#77

> Docker Container Escape > The payload checks for the Docker socket and, if present, attempts container escape through three sequential methods: So even if you're running devcontainers / VMs, these worms are already trying to escape. Make sure you're running a rootless VM engine (e.g. podman instead of docker) !

Despite what some people will tell you (including many in the security indistry), Docker is not a strong security boundary, and it should not be treated as one. It shares a kernel with the running system.

It reminds me of the good old days when people would hand out low privilege Linux accounts and rely on the kernel to prevent privilige escalation. Docker is literally the same thing, just with extra steps. Especially today with new kernel LPE'S dropping every 5 minutes.

Yes, Podman is a bit better because you arent handing the attacker root, but... why hand them an account at all? Just use a grown up VM.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#78

In the fictional universe of William Gibson's Sprawl trilogy, it is legal and normal for defenders to go kinetic on cyberattackers. How long until it is simply easier for governments and big business in the countries victimised by these criminal groups, to find the path of least resistance and go after them personally?

We can’t even prevent shop lifting.

Shoplifting isn't a national security matter.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#79
post #14

The situation is getting crazy ... personally I have already uninstalled node, python and all package managers from my machine and instead only use them in devcontainers / VMs. But even if the dev community comes up with super hardened security, I fear in at least a year the models will be good enough in social engineering that we are still running a losing game.

how do containers solve the problem? if they are connected to the internet (and they are) you have got the same problem, if the credentials can be read by the container, at least to my understanding

Watertight subdivision in a ship doesn't promise: "there'll never ever be water in this ship". It says: "If there's water in this ship due to one hole, it'll stay in one compartment". Note that I said one hole: you have the titanic, many compartment gets holes, that one ship is still going to sink.

(btw that the Titanic sunk is not an excuse not to secure other ships. And it did save a great many other ships to have watertight subdivision.)

So... Although there are exploits escaping containers and VMs and then bad guys doing lateral moves across machines, you still want defense in depth.

Re: Mini Shai-Hulud Strikes Again: 314 npm Packages Compromised

#80

The situation is getting crazy ... personally I have already uninstalled node, python and all package managers from my machine and instead only use them in devcontainers / VMs. But even if the dev community comes up with super hardened security, I fear in at least a year the models will be good enough in social engineering that we are still running a losing game.

Without node, how do you control your cloud resources? Cloudflare requires wrangler. AWS has a lot of node clis. Etc.
Post reply on HN