/

CVE-2026-63438

Severity:

CRITICAL RISK

(9.8)

Authentication Bypass (CWE-287) in 2FAuth Proxy Guard

CVE-2026-63438

Deferred

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Account takeover and unauthorized administrative access

Severity:

CRITICAL RISK

(9.8)

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

2FAuth can trust authentication headers supplied by a client when the reverse-proxy guard is enabled, even if the request did not pass through a trusted proxy. An unauthenticated remote client may create an administrator account on a fresh instance or impersonate a known account, potentially exposing 2FA secrets and administrative functions.

Affected context

The issue affects 2FAuth deployments using AUTHENTICATION_GUARD=reverse-proxy-guard when client-supplied authentication headers can reach the application without being validated by a trusted proxy. During identity lookup, an unknown REMOTE_USER may lead to account creation, with the first created account receiving administrator privileges. The configured mail header may also be used to synchronize an account's email address.

Exploit preconditions

  • Attack surface: The web application's reverse-proxy authentication flow
  • Required access: No prior authentication is required if an untrusted client can reach the application with accepted authentication headers
  • Trigger point: Identity lookup through RemoteUserProvider::retrieveById()
  • Why exploitation is possible: The application may accept identity and email headers without confirming that the request passed through a trusted proxy
  • Relevant configuration: AUTHENTICATION_GUARD=reverse-proxy-guard

Why this happens

The application treats proxy-provided identity headers as trustworthy without reliably establishing that they were added or validated by a trusted proxy. This can allow an unauthenticated client to influence account lookup and creation. Promoting the first created account to administrator and synchronizing email from a configured header increase the impact. This is an authentication failure mapped to CWE-287: Improper Authentication.

Potential impact

  • An attacker may create an administrator account on a fresh instance.
  • An attacker could impersonate a known account and redirect its email address.
  • Unauthorized access may expose 2FA secrets and administrative functions.
  • Changes made through an administrative account could affect other users or application data.

General mitigation guidance

Defensive patterns focus on establishing a clear trust boundary between the proxy and application:

  • Accept identity headers only from explicitly trusted proxy connections.
  • Configure the proxy to remove client-supplied identity headers and set its own authenticated values.
  • Prefer application-managed authentication when proxy identity cannot be securely verified.
  • Avoid automatically granting administrator privileges based solely on account creation order.
  • Validate and constrain identity and email values before creating or updating accounts.
  • Apply least privilege to application accounts and restrict direct network access to the application where practical.

How teams detect issues like this

Review authentication configuration and request paths to determine whether clients can reach the application without passing through a trusted proxy. Static analysis and code review can look for identity providers that trust request headers, create accounts during identity lookup, or assign elevated roles automatically. Monitor for unexpected account creation, new administrator assignments, and email changes, and use deployment policies to restrict which services may connect to the application. Automated code review tools may help identify header-based authentication trust patterns.

Sources

SourceLink
github.comgithub.com/Bubka/2FAuth/commit/43873cbfba445926c7008b4291eeee67752af9e8
github.comgithub.com/Bubka/2FAuth/commit/8a4c395cac97f8b70b4a822639a6ad8a816f927c
github.comgithub.com/Bubka/2FAuth/commit/d9e58ac4a63fbd8a073e423567881c81a87915de
github.comgithub.com/Bubka/2FAuth/releases/tag/v8.0.0
github.comgithub.com/Bubka/2FAuth/security/advisories/GHSA-r9xx-45m8-mw24

Frequently asked

questions

It may be exploitable by an unauthenticated remote client when the application accepts authentication headers from requests that have not passed through a trusted proxy.

Not necessarily. On a fresh instance, an attacker may be able to create the first account and receive administrator privileges. In other circumstances, the issue may allow impersonation of a known account.

Ensure the application trusts identity headers only when they come from a verified proxy, and have that proxy strip client-supplied versions before setting authenticated values.

Define and enforce proxy trust boundaries, avoid privilege grants based only on account creation order, and monitor unexpected account, role, and email changes.

Find out what's already
exploitable in your codebase.