Skip to content

TOTP Secret Not Encrypted at Rest #149

Description

@roshankumar0036singh

Problem Statement

The mfa_secret field in the database is currently stored in plaintext. If an attacker gains read access to the database or a backup, they can clone the MFA seeds and bypass 2FA for all users.

Technical Approach

Utilize the existing AES encryption key from the environment config to encrypt the TOTP secret before saving it to PostgreSQL, and decrypt it during MFA verification.

Acceptance Criteria

  • mfa_secret is stored as an encrypted binary/base64 string in the database.
  • Existing TOTP verification flows seamlessly decrypt the secret in memory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions