Page MenuHomePhabricator

Use 160-bit TOTP keys rather than 80-bit TOTP keys
ClosedPublic

Authored by epriestley on Nov 7 2018, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 19, 3:53 PM
Unknown Object (File)
Tue, Mar 19, 3:52 PM
Unknown Object (File)
Tue, Mar 5, 4:09 PM
Unknown Object (File)
Feb 3 2024, 7:49 PM
Unknown Object (File)
Jan 29 2024, 6:35 AM
Unknown Object (File)
Dec 27 2023, 12:54 PM
Unknown Object (File)
Dec 23 2023, 12:20 AM
Unknown Object (File)
Dec 22 2023, 12:43 AM
Subscribers
None

Details

Summary

See https://hackerone.com/reports/435648. We currently use 80-bit TOTP keys. The RFC suggests 128 as a minimum and recommends 160.

The math suggests that doing the hashing for an 80-bit key is hard (slightly beyond the reach of a highly motivated state actor, today) but there's no reason not to use 160 bits instead to put this completely out of reach.

See some additional discussion on the HackerOne report about enormous key sizes, number of required observations, etc.

Test Plan

Added a new 160-bit TOTP factor to Google Authenticator without issue.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

amckinley added inline comments.
src/applications/auth/factor/PhabricatorTOTPAuthFactor.php
188

Just for giggles, I checked that auth_factorconfig.factorSecret was compatible with this change, and yeah, it's a LONGTEXT. I also don't think it's worth migrating existing secrets or throwing a setup warning for installs with the old "less secure" TOTP secrets, but maybe we should call out this change in particular in the changelog?

This revision is now accepted and ready to land.Nov 7 2018, 7:02 PM

Yeah, I'll note this in the changelog. I think migrating is probably not worth the effort since even 80 bit secrets are not really within reach of any practical attacker today, but might add a UI hint when MFA next gets a round of updates.

This revision was automatically updated to reflect the committed changes.