Feat(sync): Gate Sync Code revelation and QR display behind biometric authentication

Summary

Require device-level biometric or PIN/passcode authentication prior to viewing, copying, or displaying the QR code for a Brave Sync Chain phrase on mobile devices (Android & iOS).


Problem Description

Currently, viewing or copying saved credentials in Brave Mobile requires device-level biometric authentication (fingerprint/face unlock) or the system PIN/passcode. This prevents an unauthorized individual who temporarily has access to an unlocked device from viewing plaintext credentials.

However, the Brave Sync Code lacks this layer of protection:

  1. Anyone holding an unlocked device can navigate to Settings > Sync > Add New Device.
  2. The user can immediately view and copy the 24-word/25-word sync mnemonic phrase or display the Sync QR code without any re-authentication challenge.
  3. An attacker can scan or copy this sync code to an external device, join the sync chain, and remotely pull the entire password database, bookmarks, history, and autofill data.

This represents a critical authorization parity gap: the individual leaf secrets (individual passwords) are gated behind biometric verification, but the root secret granting access to the entire credential vault (the Sync Code) is exposed in cleartext without a verification barrier.


Proposed Solution

Gate access to the Sync Code display screen behind the platform’s standard local biometric/passcode challenge:

  1. Re-authentication Prompt: When a user taps “Add New Device” (or any action that exposes the raw sync words or QR code), invoke the system authentication prompt:
    • Android: BiometricPrompt API (BIOMETRIC_STRONG | DEVICE_CREDENTIAL).
    • iOS: LocalAuthentication framework (LAContext.evaluatePolicy(.deviceOwnerAuthentication)).
  2. Access Control:
    • On successful biometric/PIN verification, render the Sync QR code and reveal the 24/25-word recovery phrase.
    • On cancellation or failure, return to the Sync settings page and do not reveal or copy the mnemonic phrase to the clipboard.
  3. Parity: Match the exact authentication policy currently enforced when viewing saved passwords under Settings > Autofill & Passwords.

Alternatives Considered

  • Requiring auth on initial Sync settings entry: While effective, gating the specific action (“Add New Device” / “View Sync Code”) offers better UX flow while preventing unauthorized exposure or clipboard exfiltration.
  • Status Quo: Relying solely on device lock/OS unlock leaves users vulnerable to borrowed-phone snooping, unauthorized physical access, or quick physical theft where the device remains unlocked.

Additional Context & References

  • Platform: Brave Mobile (Android / iOS)
  • Precedent: Existing password viewer implementation (brave://settings/passwords equivalent on mobile) already successfully utilizes platform biometrics prior to revealing plain-text credentials.