News for hackers. Stuff that matters.
Re:Self Propagating NPM Malware Compromises over 40 Packages by mewpmewp2 on Tuesday September 16, 2025 @07:56AM (#45261018)
How do you manage secrets for your projects?
Re:Self Propagating NPM Malware Compromises over 40 Packages by mr_toad on Tuesday September 16, 2025 @08:17AM (#45261228)
One option is pass, which is a shell script that uses GPG to manage passwords for command line tools. You can put the password store into a git repository if you need to sync it across machines.
Re:Self Propagating NPM Malware Compromises over 40 Packages by chrisweekly on Tuesday September 16, 2025 @08:47AM (#45261503)
Wait, what? "put the password store into a git repository"?!
Re:Self Propagating NPM Malware Compromises over 40 Packages by dflock on Tuesday September 16, 2025 @10:13AM (#45262528)
The store in the case of pass, is a plain text file, whose contents are encrypted strings. If you trust the encryption, you can put it anywhere you like. Keep the keys secret and safe, though!
Re:Self Propagating NPM Malware Compromises over 40 Packages by 9dev on Tuesday September 16, 2025 @04:14PM (#45267380)
Until you have to fire one of your disgruntled employees, who has a copy of all your secrets that you now need to rotate.

A repository that an attacker only needs to get access to once, after which they can perform offline attacks against at their leisure.

A repository that contains the history of changed values, possibly making the latter easier, if you used the same encryption secret for rotated values.

This is an awful idea. Use a proper secret management tool you need to authenticate to using OIDC or Passkeys, and load secrets at runtime within the process. Everything else is dangerous.

Re:Self Propagating NPM Malware Compromises over 40 Packages by diggan on Tuesday September 16, 2025 @07:58AM (#45261045)
Using a password manager for fetching them when needed. 1Password in my case, but I'm sure any password manager can be used for storing secrets for most programming projects.
Re:Self Propagating NPM Malware Compromises over 40 Packages by mewpmewp2 on Tuesday September 16, 2025 @08:03AM (#45261088)
Which programming languages/frameworks do you use? Do you use 1Password to load secrets to env where you run whatever thing you are working on? Or does the app load them during boot?
Re:Self Propagating NPM Malware Compromises over 40 Packages by diggan on Tuesday September 16, 2025 @08:07AM (#45261127)
A bunch, ranging from JS to Clojure and everything in-between, depends on the project.

The approach also depends on the project. There is a bunch of different approaches and I don't think there is one approach that would work for every project, and sometimes I requires some wrangling but takes 5-10 minutes tops.

Some basic information about how you could make it work with 1Password: https://developer.1password.com/docs/cli/secrets-environment...

Re:Self Propagating NPM Malware Compromises over 40 Packages by mewpmewp2 on Tuesday September 16, 2025 @08:26AM (#45261319)
How long have you been using that method? I didn't feel it's been very popular so far, although it makes a lot of sense. I've always seen people using gitignored .env files/config dirs in projects with many hardcoded credentials.
Re:Self Propagating NPM Malware Compromises over 40 Packages by loloquwowndueo on Tuesday September 16, 2025 @08:51AM (#45261546)
Fun fact : Bitwarden’s cli is written in JavaScript and needs Node.js to run.
Re:Self Propagating NPM Malware Compromises over 40 Packages by mewpmewp2 on Tuesday September 16, 2025 @08:53AM (#45261567)
I was thinking about one more case, if you are using 1password as a cli tool. Let's say you "op run -- npm dev". If there's a malicious node modules script, it would of course be able to get the env variables you intended to inject, but would it also be able to continue running more op commands to get all your other secrets too if you have started a session?

Edit: Testing 1Password myself, with 1password desktop and shell, if I have authed myself once in shell, then "spawn" would be able to get all of my credentials from 1Password.

So I'm not actually sure how much better than plaintext is that. Unless you use service accounts there.