-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lessons from recent NPM password vulnerabilities #815
Comments
Also maybe #1667 |
I'll bump this. Recently a Ruby gem has been compromised via stolen credentials. To reduce chance of this happening, a combination of:
would be a big improvement for crates.io. This is what npm does already. Note that I mean 2FA managed by Cargo+crates.io specifically. GitHub's own 2FA is not sufficient here, because |
In a situation like this, I think it's important to determine your threat models. I see multiple distinct risks discussed so far here.
I hope that this helps the discussion and clarifies what the problems seem to be from the outside. |
I like that idea. 😃 |
Another option to bolster access control around the publication of crates is to use a public-key infrastructure which allows developers to opt-into requiring end-to-end signatures for published crates. The Update Framework a.k.a. TUF (see also #75) supports a notion of "delegated targets" which allows developers to enroll digital signature keys and require releases are signed by them. This process is optional (TUF will still sign packages with a server-side key otherwise) but enables additional security which might be nice for widely used or security-sensitive crates. Using an end-to-end signature model can greatly reduce overall attack surface: TUF subdivides the functions of package registries like crates.io into various "roles", and enables what the original paper describes "survivable compromise" of certain roles including some of the currently most sensitive ones like generation of the index. Python's PyPI is deploying TUF for this purpose (PEP 458) and they recently had a root key generation ceremony. At one point I worked on an RFC for what a minimum viable TUF integration with crates.io might look like. It doesn't include the aforementioned "delegated targets" feature, but it paves the way for it: withoutboats/rfcs#7 There are many options for securing digital signature keys used for package signing (and other sensitive functions). Hardware tokens like YubiKeys and SoloKeys (in the forthcoming V2 models) can be used to protect such keys from compromise and support a standard called PIV which can be used to create ECDSA/P-256 (or with SoloKeys, Ed25519) signatures. YubiHSMs (used by PyPI) can be used for keys where it would be useful to keep encrypted backups. Failing that, digital signature keys can be kept in the OS keychain (which on macOS devices can be optionally backed by a Secure Enclave Processor which can enforce things like biometric authentication). If any of this sounds interesting to people, I'd be happy to help organize at least some general discussion, and perhaps we can look into dusting off my TUF RFC draft. |
This is being discussed again thanks to the fact that the exact same issue happened again with a prominent NPM package. The GitHub API now supports checking if 2FA is in use: https://docs.github.com/en/rest/reference/users#get-the-authenticated-user |
See https://github.com/ChALkeR/notes/blob/master/Gathering-weak-npm-credentials.md for reference.
Cargo/crates.io is less affected than NPM, since it relies on github authentication for publishing, which one would expect to already be fairly well hardened against these kind of brute-forcing attacks. However, this doesn't prevent the use of leaked passwords and other human errors.
AFAICT, these are the only actions from the article which might apply to crates.io:
These are some other possibilities:
The text was updated successfully, but these errors were encountered: