"Token is unsafe" error when I try to enable 2FA #177801
Replies: 2 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.
-
|
The FreeOTP source code distinguishes between four "unsafe token" exception types:
But then makes the latter three subclasses of So we can't tell which error is being thrown here, but my first guess would be that the token is fewer than 16 bytes "encoded". Github can't find see a definition for The code mentions that this minimum is defined in RFC 4226, section 4, requirement 6. Indeed, it says:
Github is not complaint with the RFC for HTOPs, but Github specifies that it's a TOTP instead. Its RFC is 6 years newer (2011 instead of 2005) but has no such requirement:
Which is a bit of an oversight if you ask me. 4 is not a safe secret when chosen by fair dice roll! However, it does say:
Maybe that means Github is noncompliant with the TOTP RFC after all, because it references following the HOTP RFC as one of its requirements? Either way, Github should upgrade. If I remember correctly, NIST and AIVD recommend that the industry starts implementing quantum-safe algorithms where possible, which an 80-bit hash probably isn't (per my rudimentary understanding of Grover's algorithm). Using 160 bits, as the RFC recommended as of 2005, sounds much more likely to be safe. If 256-bit tokens are compatible in most implementations, I would personally go for that because there is no downside. Increasing the tokens beyond that is pointless (128-bit-equivalent strength (on a quantum computer) is universally considered safe), but 256 bits of storage is negligible if you're already storing a salted password. For the time being, though, I think it is safe: validation is an online attack by default, unless someone captures one or more OTPs that you generated, performs a (currently theoretical) brute-force attack on a quantum computer to see which underlying secrets would result in that OTP value, and then tries out which one it is. They also still need your password. An advanced (individualised, not scalable) attack, and that's when presuming the availability of a stable quantum computer. ConclusionI would use the provided token for the time being, but Github should start issuing stronger tokens as soon as possible as it may become insecure in the future and there is no practical downside to using at least the token length that the authors recommended in 2005. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
I get the following error when I try to enable 2FA on my GitHub ID. My 2FA application is FreeOTP. I am reluctant to add the GitHub token to FreeOTP, until this problem is cleared up. Is there a better place to report a bug than here?
Beta Was this translation helpful? Give feedback.
All reactions