Require 2FA confirmation to change email, issue token, alter 2FA methods #191503
Replies: 5 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
This also applies to the npm CLI with https://docs.npmjs.com/cli/v11/commands Basically any command that changes something in the registry: I am aware, that npmjs and npm CLI were designed like that in the past by Isaac and the team. |
Beta Was this translation helpful? Give feedback.
-
Definitely, like it is already case here on GitHub. |
Beta Was this translation helpful? Give feedback.
-
Yep, allowing to remove 2FA without re-authenticating the user, it's bad, very bad. |
Beta Was this translation helpful? Give feedback.
-
|
hey @corneliusroemer This is a critical assessment of a "failure by design" in npm’s security model. The Axios compromise in late March 2026 serves as a stark validation of your point: the attacker hijacked a lead maintainer's account and published malicious versions (v1.14.1 and v0.30.4) within 39 minutes. 1. Session Token Over-PrivilegeThe current npm implementation allows an active session token—obtained via a compromised browser or machine—to perform highly sensitive "account-level" changes without re-authentication.
2. Recovery Code VisibilityYou are correct that recovery codes remain accessible to anyone with an active login session.
3. Web vs. CLI DiscrepancyThere is a clear gap in "hardening" between the two interfaces:
Summary of Suggested FixesTo move beyond "half-hearted" implementation, the community consensus (as seen in recent [GitHub community discussions](https://github.com/orgs/community/discussions/191503)) is pushing for:
Pls Upvote if this helps |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Product Feedback / Security
Body
The axios/axios incident was possible partly because npm gives full privileges to session tokens, even when 2FA is enabled: One can change email, remove 2FA, issue tokens when one is logged in without nom requiring any sort of renewed authentication like password or 2FA token.
This is bad. For such sensitive operations, having a session token should not be enough. You should require a new 2FA token.
Another weakness: as long as one is logged in, one can see one's recovery codes. Recovery codes should only be shown the first time one adds a security key. Or at least require providing a 2FA token.
Current implementation of 2FA hardening seems half-hearted.
Per the docs, removing 2FA via CLI requires both password and 2FA token (as it should). But this doesn't help if the web interface doesn't require it (and it doesn't): https://docs.npmjs.com/configuring-two-factor-authentication#removing-2fa-from-the-command-line
Related:
Beta Was this translation helpful? Give feedback.
All reactions