/

CVE-2026-62669

Severity:

HIGH RISK

(7.4)

Authentication Bypass (CWE-287) in Grav Login Plugin

CVE-2026-62669

Deferred

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Authentication Bypass and Account Takeover

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A flaw in the Grav Login Plugin's two-factor authentication flow allows an attacker who knows a victim's correct password to replace the pending user's TOTP secret before authorization is completed.

The attacker may then generate a valid replacement code and finish logging in without the victim's original second factor.

Affected context

The issue occurs in Grav Login Plugin deployments that use the login flow with TOTP-based two-factor authentication. It becomes risky when a user has passed password verification but remains in a pending TOTP session, and the secret-regeneration task can be invoked without confirming that the user is fully authorized.

Exploit preconditions

  • Attack surface: The Grav Login Plugin's authentication and two-factor secret-regeneration task
  • Required access: Knowledge of the victim's valid password and the ability to submit requests to the login flow
  • Trigger point: Invocation of the secret-regeneration task during the pending TOTP challenge
  • Why exploitation is possible: The task checks that a pending-session user exists but does not require the user to be authorized, allowing the active TOTP secret to be replaced before second-factor authentication completes

Why this happens

The underlying bug is an authorization-state validation failure. A sensitive account-management operation is permitted based only on the existence of a pending user session, rather than requiring successful completion of the authentication flow.

This maps to CWE-287: Improper Authentication, because the application accepts a newly generated second-factor credential without adequately proving that the requester has already satisfied the required authentication stages. The insecure pattern is allowing pre-authentication or partially authenticated sessions to modify credentials that protect the account.

Potential impact

  • An attacker could bypass the victim's intended second authentication factor.
  • An attacker could gain unauthorized access to the victim's account.
  • Account data and administrative functions may be exposed or altered.
  • An attacker could establish persistence by changing other account security settings after login.

General mitigation guidance

Mitigation generally focuses on enforcing authentication state and protecting credential-changing operations.

Common defensive patterns include:

  • Require fully authorized user state before allowing TOTP secret generation, replacement, or disclosure.
  • Keep credential-management actions unavailable during pending or partially authenticated sessions.
  • Bind sensitive operations to an authenticated server-side session and verify the intended account explicitly.
  • Avoid returning newly generated authentication secrets through responses unless the requester has completed the required authorization checks.
  • Apply least privilege to account-management capabilities and require reauthentication for high-impact security changes.
  • Treat all client-controlled session identifiers and workflow transitions as untrusted inputs.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying credential or MFA-secret changes reachable from pre-authentication handlers.
  • Code review checks that compare authorization-state validation with the sensitivity of the requested operation.
  • Tests that attempt account-security actions during password-pending, MFA-pending, expired, and partially authenticated sessions.
  • Runtime monitoring for TOTP secret regeneration followed immediately by successful authentication from the same or an unusual client.
  • Policy enforcement requiring explicit authorization checks before credential-management endpoints are exposed.

Automated security review tools may help identify workflow paths where pending sessions access fully authenticated functionality.

Sources

SourceLink
github.comgithub.com/getgrav/grav-plugin-login/commit/5d1b722298cb947d8f434025d121b99152a2c630
github.comgithub.com/getgrav/grav-plugin-login/releases/tag/3.8.11
github.comgithub.com/getgrav/grav/security/advisories/GHSA-7mgc-c7pq-3rr3

Frequently asked

questions

It may be exploitable through the application's login and task endpoints when those endpoints are reachable by an attacker who knows a valid victim password.

Yes. The described attack requires the correct password to reach the pending TOTP challenge, although it avoids the victim's original second factor by replacing the pending secret.

Require a fully authorized session before permitting TOTP-secret regeneration or any comparable credential-management operation. Pending authentication states should not be treated as equivalent to authenticated access.

Model authentication stages explicitly, enforce authorization checks at every sensitive state transition, and test security-sensitive workflows from partially authenticated sessions as well as ordinary unauthenticated and authenticated states.

Find out what's already
exploitable in your codebase.