@pwolanin has pointed out that TFA's TOTP seeds have a length far shorter than industry standards such as AWS.

At Drupalcon LA we looked at the RFC recommendation for OTP seeds which should be at least 128 bits https://tools.ietf.org/html/rfc4226

Fortunately, PHPGangsta_GoogleAuthenticator allows the seed length to be set by callers so TFA Basic can pass a length of 32 or 64.

This will also need the seed field to be updated so the full seed is visible.
This relates to https://www.drupal.org/node/2483529

Comments

coltrane’s picture

Just noting this issue is not about removing a security risk here, RFC 4226 recommends 128 bits and https://github.com/PHPGangsta/GoogleAuthenticator defaults to length of 16. This issue is about further hardening.

coltrane’s picture

Status: Active » Needs review
StatusFileSize
new402 bytes

Patch doubles the length.

greggles’s picture

This seems great. In addition, how about an issue in https://github.com/PHPGangsta/GoogleAuthenticator/issues to extend the length?

greggles’s picture

I talked to ben more in person. I feel like 20 makes more sense as a balance of security and ux for people who have to type it instead of copying it.

  • coltrane committed 5a47188 on 7.x-1.x
    Issue #2487664 by coltrane: Increase TOTP seed length
    
coltrane’s picture

Status: Needs review » Fixed

Committed as 20.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

banviktor’s picture

Status: Closed (fixed) » Active

I hate to be the one to resurrect this, but none of the TOTP applications I tried could provide a valid code for a 20 characters long seed.
I'm not sure whether it's the library's fault or the applications'.
I've tried Google Authenticator, FreeOTP and the Chrome plugins.
However they do work with 24 or 32 long seeds.

coltrane’s picture

@banviktor, using the QR code and/or manually typing in seed? I'll test as well but since 4 more characters is negligible it's an acceptable change to make.

banviktor’s picture

@coltrane In some applications I tried both, in some only the seed and in others only the QR code.

coltrane’s picture

Status: Active » Needs review
StatusFileSize
new404 bytes

Ran into this issue today with oath-toolkit. Patch increases seed length to 24

  • coltrane committed f1ce0d3 on 7.x-1.x
    Issue #2487664 by coltrane, banviktor: Increase TOTP seed length
    
coltrane’s picture

Status: Needs review » Fixed

Committed #11

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.