Skip to content

TOTP generation fails when Base32 secret is not properly padded (missing padding handling) #1546

Description

@MallardsAreCool

Describe the issue

TOTP generation is unable to handle padding on secret keys that aren't mod 8 via QRCodes.

To reproduce:

  • Import TOTP via QR code that isn't mod 8 or is padded to be mod 8
  • Compare the generated TOTP with other authenticators (Google, Microsoft, Authy)
  • The codes won't match due to missing padding

Example secrets that won't scan correctly:
otpauth://totp/Example:User?secret=J3WWIV3PTGJPQV5QAICM&issuer=Example
otpauth://totp/Example:User?secret=J3WWIV3PTGJPQV5QAICM====&issuer=Example

Browser

Chrome

Browser Version

149.0.7827.156

Extension Version

8.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions