Skip to content

storage_getAuthData() never scrubs the passphrase-derived key or the decrypted authenticator secret on any exit path #576

Description

@BitHighlander

Summary

`storage_getAuthData()` derives `authdataKey` (passphrase-derived) and decrypts into `plaintextAuthBlock` (the CTAP2/passkey authenticator secret), but never calls `memzero()` on either buffer -- not on either early `return false`, not on the successful `return true` (after the data has already been copied out to the caller). The sibling function `storage_wipeAuthData`, right above it in the same file, correctly scrubs its own local `plaintextAuthBlock`.

Impact (high)

Both the derived passphrase key and the decrypted authenticator secret remain resident on the stack after every call -- reachable via the ordinary CTAP2/passkey authenticator flow (`authenticator.c`) whenever passphrase protection + a cached passphrase are in use, not an edge case.

Fix direction

Add `memzero(authdataKey, sizeof(authdataKey))` and `memzero(&plaintextAuthBlock, sizeof(plaintextAuthBlock))` before every return.

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity-relevant defect or hardening

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions