Live data from Hacker News

Keyv and friends compromised in active Shai-Hulud supply chain attack

aikido.dev

111–120 of 145 posts

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#111
post #99

Earlier quoted context omitted.

First point.. plus, OTP/MFA authenticated publishing. This OTP/MFA should come from package repositories, before the package is made publicly available. This is needed so that CD stage is not blocked. OTP/MFA should be scoped to publishing user/org, not the package. How the OTP/MFA client is managed across the maintainers/org, lies in the scope of maintainers/org.

This still does nothing to prevent anyone from publishing a bad package, for example a compromised device/dev in the organization. A cooldown of a day, and maybe not updating on weekends will save you from that. It's time to stop moving at the speed of stupid.

A compromised device still can't access the secure enclave.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#112

Once again, I ask myself: should we start "shaming" developers who don't use isolation? It still seems I am the exception and most people run their dev environment with full permissions. Why? I also wrote an article ( https://evertheylen.eu/p/shame-devs-without-isolation/ ) to flesh out my thoughts, but I'd be really happy to discuss this in the comments.

Yes, it gets boring that each time one of these supply chain attack article appears everybody starts talking about cooldowns, 2FA, MFA, etc. Just don't give Node the permissions to your complete filesystem / network.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#113
post #111
post #99

Earlier quoted context omitted.

This still does nothing to prevent anyone from publishing a bad package, for example a compromised device/dev in the organization. A cooldown of a day, and maybe not updating on weekends will save you from that. It's time to stop moving at the speed of stupid.

A compromised device still can't access the secure enclave.

It doesn't need to, it just updates the code, you have the human publish.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#114
post #85

Earlier quoted context omitted.

Defense in depth is the “meat and potatoes” of security. In other words: people should be auditing their software, but we should also design systems and schemes that provide varying degrees of defense and protection when people invariably fail to review the code they run.

Defence in depth is not just 'throw anything in that might improve security' though. The idea is to have multiple strong layers, not a hundred half-measures that are all easily bypassed. A stronger layer might be sandboxing, or separating your build and publishing steps as others have suggested (and also probably worth restricting the credentials the publishing step to just the relevant packages as well). These will…

>The idea is to have multiple strong layers, not a hundred half-measures that are all easily bypassed

Definitely. On the other hand, in my opinion, "not running arbitrary code during package install" is not a "half-measure", it's a basic sanity. This whole arbitrary code execution at install time is a convenience feature that was adapted by some package managers, but it was never a good idea.

Fortunately, nixos solves that for me in most cases.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#115
post #28

Earlier quoted context omitted.

This article has a lot of information and ways to check & clean: https://safedep.io/keyv-npm-supply-chain-compromise/

I ended up asking my agent with auto mode: can you search all installed node modules for any sign of the shai hulud supply chain attack? What happened Every package in the family received two new files, setup.mjs and Math_Symbol.js, along with a "preinstall": "node setup.mjs" entry added to each package.json. Anyone who ran npm install against an affected version would have had setup.mjs execute automatically before…

No one wants to see slop that you pooped out of an LLM butt

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#117
post #55

Earlier quoted context omitted.

Missile defense systems are unnecessary because they could just use tanks Anti-tank measures are unnecessary because they can just use missiles

What's your solution to using a library without executing the code in it?

This is moving the goalposts. The original problem was that installing a library should not execute code from that library.

In most sane environments, like for example native languages, this is already the case. Downloading a .dll file and putting it in an appropriate directory won't, by itself, execute code in that library.

You may argue that the code will get executed at some point anyway, but that's besides the point. Sandboxing the build environment is a different problem than sandboxing the test/staging/production environment.

I think we both agree that "adding random obstacles that don't actually protect anything" is not a valid approach to security, but my mental model of the build step is "transformation of input data into output data", and while this step may produce a malicious output from malicious inputs, it should not do anything malicious itself. For example, "gcc source.c" should not execute arbitrary code by itself.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#118
It's time for all developers to learn about devcontainers and use them consistently. They're super easy to setup and run and would protect from most of what this worm does. https://code.visualstudio.com/docs/devcontainers/containers is the best guide to get started if you use vscode.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#119

It's time for all developers to learn about devcontainers and use them consistently. They're super easy to setup and run and would protect from most of what this worm does. https://code.visualstudio.com/docs/devcontainers/containers is the best guide to get started if you use vscode.

They help only to the extent that you have completely isolated credentials: the hard part isn’t the container, it’s things like fastidiously using separate least-privilege credentials everywhere and not using tools or editor integrations which don’t support that style of work. Once you map your GitHub or AWS token into a container, it’s no longer useful as a security boundary.

Re: Keyv and friends compromised in active Shai-Hulud supply chain attack

#120
I've been building an OSS tool to detect software supply-chain attacks: https://github.com/ossillate-inc/packj

Packj uses static+dynamic code/behavioral analysis to scan for indicators of compromise (e.g., spawning of shell, use of SSH keys, network communication, use of decode+eval, etc). It also checks for several metadata attributes to detect impersonating packages (typo squatting).

Post reply on HN