Skip to content

Disable MFA without TOTP #9623

Open

Description

@mtrezza

New Issue Checklist

Issue Description

Originally posted by @SteffenKeller:

A logged-in user can disable MFA for their account without entering a valid verification code by simply calling the unlink function or saving null for the MFA auth data.

The TOTP auth adapter prevents setting a new secret without a valid code (AuthenticationAdapters.spec.js line 2413), but it does not prevent clearing the secret first and then setting a new one.

This may not be critical, but since the TOTP auth adapter was designed to require a valid code to disable mfa, I thought it was worth mentioning.

Steps to reproduce

JS SDK:

await user._unlinkFrom('mfa');

or

await user.save(
    { authData: { mfa: null } },
    { sessionToken: user.getSessionToken() }
);

Environment

Server

  • Parse Server version: FILL_THIS_OUT

Activity

  1. parse-github-assistant commented on Mar 2, 2025

    @parse-github-assistant

    Thanks for opening this issue!

    • ❌ Please fill out all fields with a placeholder FILL_THIS_OUT, otherwise your issue will be closed. If a field does not apply to the issue, fill in n/a.
  2. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)
    on Mar 2, 2025
  3. removed
    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)
    on Mar 22, 2026
  4. mtrezza commented on Mar 22, 2026

    @mtrezza
    MemberAuthor

    In #10277 we show a way to prevent unsetting MFA with a beforeSave trigger. This is a universal solution that can contain any conditions to allow or reject unsetting MFA. While this is not a simple option in the adapter, it is a viable workaround.

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

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions