112 points · by miketheman · 3y ago · 73 comments
The pressure of all of these MFA inputs, especially for products that expire them even on a trusted device/browser, is eventually going to push people into the arms of convenient "password managers".
This will effectively nullify the 'something you have' in MFA because it'll all be available on your one single device again.
Even worse, it'll present multiple high-value targets now, from the centralized server/sync side (ie lastpass) down to individual devices.
Put another way: if you're storing the passwords in the same place as the MFA secrets, then it's not actually MFA anymore.
It's not that PyPI is wrong to do this, it's that the weight of everyone mandating MFA will eventually either push people away or force them to work around draconian or onerous security requirements.
I see this sentiment a lot and IMO it over-simplifies the security model pretty drastically. It's unlikely that a 1P vault is breached or leaked. For most people, the most likely threat vector for a random internet account is:
1. they re-use a password across sites
2. one site gets breached and that password is included in a hash dump (probably associated with their email)
3. one the hashes are broken, an attacker can try that password on another site
In this situation, MFA stored in their password manager is still MFA because the TOTP secret wasn't leaked with the password (or it was and then it doesn't matter where you store it on your end).The only case in which storing MFA secrets with your passwords becomes an issue is if other people have access to your laptop (and password manager). Then you'd probably want passwords on the laptop and MFA on your phone (or something else kept on your person).
Nobody questions leaving a yubikey in a laptop (which is also full of passwords). Even if doing so means anyone with your laptop can use your yubikey, it narrows your attack vector from "anyone who got your password" to "anyone with physical access to your laptop", which is a great reduction in scope (for most people).
The most an attacker might be able to view is the addresses of the sites you are connecting to.
The problem is that a lot of the major package managers - at least nodejs npm/yarn, PHP composer, Apache Maven, Gradle - allow code execution of whatever packages were specified as part of the installation or build process.
That means there are an equal lot of very juicy targets for a takeover - just look at the most popular build plugins... and a few minutes are enough to deploy a keepass and browser credential store stealer to a ton of people. Getting local code execution isn't that difficult if you manage to spray your payload over a huge enough area.
Getting access to a target and their MFA device however is vastly more complicated.
They use 2fa to login onto the website and make you create a token. After that you just save the token within your project and have a script to upload new versions.
This doesn't seem like a big problem to me for two reasons:
1. if they're using a password manager, they are likely to be using a better password
2. it's much more likely that someone has intercepted a single static password for a single website than, say, your 1Password vault password AND username AND secret key
Even if this was right (which I don't think it is under the threat model described by the OP: they claim, rightpy or wrongly, that the attack surface somehow increases when everybody adopts MFA), consider the protocol where you have to enter your password and cut off a lock of hair to authenticate. In the worst case, this is as insecure as someone who just enters their password without any hair cutting, but doesn't mean that adopting it would not be a big problem, or even a good thing overall (at the very least it would massively inconvenience bald people; there are parallels, it's not like MFA does not inconvenience certain people).
So maybe we should just be more honest about what we call things. "True" MFA is too inconvenient for most people - even banking apps are not only happy to let you log in from exactly the same device that they will send verification codes to, they usually make more secure workflows more of a pain too. But we're still gaining some additional security by having one-time codes that can't as easily be stolen without having access to the device.
Seems like a almost fool proof device. Airgaped too.
https://en.m.wikipedia.org/wiki/RSA_SecurID
AFAIK they are still in common use in high security environments. I have one for work, but we are supposed to eventually migrate to phone-based token generators.
The old boxes won't work anymore though. The reason is that with the EU directive PSD2, it became mandated that the codes be tied to the transaction in some way. So the newer devices need some way of reading the transaction info before generating the code, e.g. a QR reader.
For example, on PyPI, to upload stuff, you need to generate a token. Now you have effectively a single factor, which requires as much care as a regular password.
Sure, but PyPI was also giving away yubikeys. Also, you're assuming that the compromise involves fully owning a device instead of the much more common case of phishing/password reuse.
I say this as someone that has several that are used at home but needs to use personal TOTP codes at work.
Physically stealing a token from me is a much riskier, less scalable attack than slinging hashes from someone's hobby site into GPUs.
Unlike car keys the tokens don't even know what they're for. You can walk around a car park with keys and match the car, these days it'll even remotely blip the lights - but if you have some random guy's Yubico Security Key, you don't even know if he uses Facebook, Google, PyPI, or what, let alone what the account's username/ email might be. Good luck.
They told me they'd investigate but have been ghosting me since. I sent several requests to have my account restored but they just won't answer.
We have the published account recovery process here: https://pypi.org/help/#account-recovery
Is that the process you've followed?
I tried re-registering now to check your claim but it says the username is under use and I can't restore the password for it since they changed the e-mail to one of theirs.
The last communication I got from PyPi was from Ee Durbin in 2022 saying:
> Given this, it appears that someone from <redacted> utilized the @<redacted>.com email address associated with the account to take it over and obtain access to the <redacted> libraries that the arnon User owned.
> We are discussing next steps internally.
> -Ee Durbin
> Director of Infrastructure
> Python Software Foundation
I've asked a couple of times for status updates as recently as this July and haven't heard back.
[1]: https://github.blog/2023-03-09-raising-the-bar-for-software-...
Appreciate the efforts to secure the software supply chain!
The image you showed is in regards to Passkeys, which PyPI doesn't support yet.
For TOTP, we support a single entry, and can't set a custom name.
For WebAuthn, we allow a custom label value, is that what you're looking for?
Yep! I don't see that option, but I'm probably just missing it. Thank you for the reply!
2FA means we can trust the person that logged in - but we still don't trust that PyPI is being honest (no offense).
PEP 458 describes the path forward for PyPI. https://peps.python.org/pep-0458/
Here's the in-progress roadmap: https://github.com/pypi/warehouse/issues/10672
If there's particular issues you believe you could pick off to help achieve the goal, much appreciated!
That is covered by PEP 480, which is already 9 years old:
https://peps.python.org/pep-0480/
Too bad that PyPI (and pip) effectively killed PGP signatures under control of the developers (therefore truly end to end) even with the simple TOFU model, and without providing an alternative.
PyPI never supported "signed builds" in the first place. What it had was vestigial support for attaching PGP signatures to distributions; without a key or identity distribution mechanism, these signatures were virtually useless (and all public evidence indicates that they were, consequently, virtually unused).
Note that attached signatures alone don't prevent dishonesty on PyPI's part: without identity pinning, a dishonest PyPI could replace a correctly signed distribution Foo with a correctly signed (and easily exploitable) distribution Bar during a user's retrieval. Every signature needs to be bound to both the distribution's content and its distribution name by some stable discoverable identity.
I use my GitHub account to make bug reports, small pull requests, and silly personal projects. It is not that important. I want to sacrifice security for convenience on it, and that should be my choice.
I also do not agree with the argument this secures the supply chain because:
1. It ignores supply-chain attacks from people who already have repository access.
2. Most big companies (ie. Google) are probably already using 2FA.
3. And if people are automatically pulling code from random people/groups without checking it... maybe that's what actually needs to be banned.
Nothing will fully secure the supply chain, but this certainly reduces risk and given the impact software has in today’s world it’s important.
> 3. And if people are automatically pulling code from random people/groups without checking it... maybe that's what actually needs to be banned.
Github does not have control over this but would largely be blamed for the fallout, regardless of how reckless some individuals may be.
The best most orgs can do to avoid liability/risk is usually to make changes to things they control, even if it isn’t the best option.
You see this sort of coping mechanism in all sorts of situations if you start looking for it.
Most importantly, as a normal person, I'm more inclined to go through security hoops with internet banking and payments, and much less so for every single website that exists.
I have a hardware key for the 2FA on my meagre open source libraries, it takes 10 seconds to pull it out of my pocket and use it. Why is that a bad thing if it's enforced? It seems more like you have a UX problem here, there's solid open source TOTP software that come with browser extensions and are one click to use. SMS only can be a pain but many companies are moving away from that, albeit slowly.
It doesn't take 10 seconds. It takes remembering to keep it with me when I travel.
Also with 2FA the risk of being permanently locked out of my account increases A LOT.
With a bank or similar I can show up to their office, show my id and reset all access. With websites there is NOBODY responding. I've tried taking over an abandoned project on pypi for which I've done several contributions before the owner disappeared. Never got any response.
So losing the keys means that I have to fork my own project :D
I understand why they are needed. I still dislike them.
It’s like washing dishes. I understand why they need to be washed, how good a modern disk-washer can be ...and I still hate them.
Account deletion is excluded so you can elect to remove your account at any time.
Mandatory 2FA, on the other hand, is a little thorny: the Python packaging ecosystem has a lot of very popular, very stable packages that receive relatively few updates, meaning that it takes a long time to onboard those maintainers (without risking locking them out of their accounts or their abilities to do rapid security releases).
Now that GitHub is mandating 2FA, however, the argument for slow-walking it becomes much weaker: the overwhelming majority of maintainers will need to enable 2FA anyways to make changes to their codebases, so PyPI can effectively "hitch" onto that wave and do a mandate at the same time.
TL;DR: Moving hundreds of thousands of users to a mandatory 2FA scheme is relatively disruptive; the circumstances have aligned such that doing so now is minimally disruptive.
Anyway, I don't want to complain. I believe its a good step towards securing the software supply chain.
Keep up the good work.
I agree, but that's the benefit of hindsight :-)
PyPI is simultaneously one of the oldest and most active language packaging ecosystems out there; a lot of of the things we treat as "table stakes" in terms of good security practices weren't even invented when it was first released.
The consequence of all of this is that there's a lot of ossification, and things can't be changed suddenly without (reasonably!) upsetting a lot of people who are invaluable to the community. It'd be great in terms of security if we could just force it, but that wouldn't be fair to them, to their historical expectations, etc.
Edit: I should say: I'm not a maintainer of PyPI, just someone who has contributed to it. My opinions aren't representative.