Skip to content

[Extension]: Proton Authenticator shows the same TOTP code for every account #1849

Closed

Description

@akaready

Existing issues

  • I searched open and closed issues and didn't find this already reported.

Extension URL

https://github.com/raycast/extensions/tree/main/extensions/proton-authenticator

What happened?

Proton Authenticator → Get Totp lists every account with the same 6-digit code. The code changes every 30 seconds, but it is identical across accounts and doesn't match the codes in the Proton Authenticator app.

Expected: each account shows its own code, matching Proton Authenticator. Actual: one shared code, and it's wrong for all of them.

It looks like a gap in Tinycast's Buffer shim rather than anything Raycast-only:

  1. The extension generates codes with otplib 12, which decodes each base32 secret with the bundled thirty-two package. That package builds its buffers with the legacy new Buffer(string) form.
  2. Tinycast's Buffer is class Buffer extends Uint8Array with no constructor of its own, so new Buffer("JBSWY3DP…") goes to Uint8Array, which reads the string as a length. The secret comes out as an empty buffer (a numeric-looking string such as new Buffer("6869", "hex") becomes 6,869 zero bytes instead).
  3. Every account then gets an empty HMAC key, and Hash.digest treats an empty key as "no key", so it returns a plain hash of the time counter. Same input for every account, so the same code.

Steps to reproduce

  1. Install Proton Authenticator (proton-authenticator, author Fared) and import two or more accounts.
  2. Open Get Totp.
  3. Every row shows the same code.

The same failure without any real secrets, using the RFC 4226 / RFC 6238 test secrets through the runtime fixture harness:

✗ a base32 secret decodes to its key — ""
✗ each secret gets its own RFC 4226 code — ["362668","878336","362668"]   (expected 755224, 287082, 282760)
✗ an empty HMAC key is still an HMAC — e3b0c442…b855   (SHA-256 of "", not HMAC-SHA256)

Screenshots or recording

I've left out a screenshot because the codes are live 2FA codes. The harness output above shows the same thing with public test secrets.

Tinycast version + channel

0.12.11 stable, build 138. The Buffer class and the Hash.digest check are unchanged on current main.

macOS version

27.2 (build 26B123), Apple Silicon.

Extension limits

  • I understand this is closed if the extension depends on Raycast-only capabilities.

Contribution

  • I'm willing to implement this myself once this issue is labelled approved

I have a small fix ready, with a case in fixtures.mjs and one in ext-test: a Buffer constructor that decodes a string like Buffer.from, and createHmac keeping an empty key as an HMAC. Thank you for considering it, and happy to change the approach if you'd prefer something different.

Activity

  1. github-actions commented on Nov 8, 2026

    @github-actions

    Thanks for opening this! Tinycast stays small and focused, so new features are chosen
    carefully and smaller conveniences are usually closed.

    Tip

    Planning to build this? Discussing the approach here first is highly preferred.

  2. abue-ammar commented on Nov 9, 2026

    @abue-ammar
    Owner

    @akaready if it wont break other extension or other features open a pr

  3. added
    extensionBug or request inside a Raycast extension running in Tinycast
    on Nov 12, 2026
  4. Repository owner locked and limited conversation to collaborators on Nov 13, 2026
  5. converted this issue into a discussion #1895 on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionBug or request inside a Raycast extension running in Tinycast

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions