MEDIUM 5.3

CVE-2026-54036: LibreChat 2FA Bypass via Unprotected Endpoint—Patch to 0.8.4-rc1

LibreChat versions prior to 0.8.4-rc1 contain a critical flaw in two-factor authentication (2FA) management. An attacker who has compromised a user's session token can call a specific API endpoint to completely reset that user's 2FA settings—overwriting their TOTP secret, invalidating backup codes, and disabling 2FA entirely—without needing to know or verify the existing 2FA credentials. This locks legitimate users out of their own account security while giving the attacker an open door to permanent access.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N
Weaknesses (CWE)
CWE-306
Affected products
1 configuration(s)
Published / Modified
2026-06-25 / 2026-06-26

NVD description (verbatim)

LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.4-rc1, the GET /api/auth/2fa/enable endpoint can be called by an authenticated user (or attacker with a stolen session) even when 2FA is already fully enabled on the account. This endpoint overwrites the existing TOTP secret, generates new backup codes, and sets twoFactorEnabled to false — all without requiring any TOTP or backup code verification. An attacker with a valid session token can completely take over a victim's 2FA, locking the legitimate user out of their own two-factor authentication. This vulnerability is fixed in 0.8.4-rc1.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The GET /api/auth/2fa/enable endpoint in LibreChat fails to enforce proper authorization checks when 2FA is already active on an account. The endpoint does not verify current TOTP tokens or backup codes before modifying authentication state. When called by an authenticated session (PR:L in the CVSS vector), it performs four dangerous operations: overwrites the TOTP secret, generates and replaces all backup codes, sets twoFactorEnabled to false, and likely returns new credentials to the caller—all within a single unprotected transaction. The vulnerability stems from missing step-up authentication (CWE-306) at a sensitive endpoint. No user interaction is required; a passive session token is sufficient. The fix in 0.8.4-rc1 presumably adds TOTP or backup code verification before allowing 2FA reconfiguration.

Business impact

Organizations using LibreChat for internal AI interactions face a direct threat to account takeover resistance. If an attacker gains a user's session token through phishing, malware, or network compromise, they can immediately neutralize that account's 2FA defense, ensuring persistent unauthorized access even if the user detects the breach and changes their password. For compliance and audit purposes, this vulnerability violates the principle of strong authentication controls and may trigger incident reporting obligations under frameworks like SOC 2, HIPAA, or GDPR if customer or regulated data flows through LibreChat instances.

Affected systems

LibreChat prior to version 0.8.4-rc1 is affected. The vulnerability exists in the authentication subsystem and affects any LibreChat instance where 2FA has been enabled. Self-hosted and cloud-based deployments are equally vulnerable if running an unpatched version. Users relying on LibreChat as their primary AI gateway should prioritize updates.

Exploitability

Exploitability is moderate and requires pre-existing access (a valid session token). The attacker does not need to interact with the victim or bypass network defenses; they can trigger the exploit programmatically via a single HTTP request. The high AC (Attack Complexity) value in the CVSS reflects the prerequisite of obtaining a session token, but modern session theft vectors (XSS, credential stuffing, malware) make this a realistic secondary attack once initial compromise occurs. No special tools or deep knowledge of LibreChat internals are needed.

Remediation

Upgrade LibreChat to version 0.8.4-rc1 or later immediately. This is a session-based compromise that does not require password reset alone; users should assume that if their session was exposed, an attacker may have already accessed and disabled 2FA. After patching, audit 2FA settings across all accounts and consider issuing a security notice advising users to review recent login activity and confirm their 2FA configuration.

Patch guidance

Apply the 0.8.4-rc1 release or any subsequent stable version. Verify the patch by confirming the version string in your LibreChat instance (typically visible in UI footer or via API endpoint). Test 2FA functionality after patching: attempt to call /api/auth/2fa/enable when 2FA is already active and confirm that it now requires TOTP or backup code verification before proceeding. Restart services if running a containerized deployment.

Detection guidance

Monitor logs for repeated calls to the /api/auth/2fa/enable endpoint from a single session or IP address, especially if followed by successful TOTP secret or backup code changes. Implement alerting on any 2FA disable or reset event that lacks corresponding TOTP verification logs. Check for audit trails showing discrepancies between user-initiated 2FA changes and actual endpoint calls. In LibreChat's database, query the user authentication log for instances where twoFactorEnabled transitioned from true to false without a documented verification step.

Why prioritize this

Although the CVSS score is medium (5.3), this vulnerability directly undermines a primary security control—two-factor authentication. Any organization running LibreChat should treat this as high priority for patching because the impact (loss of 2FA integrity) is disproportionate to the technical complexity of exploitation. Session compromise is increasingly common, and 2FA bypass is a known precursor to full account takeover in multi-factor environments.

Risk score, explained

The CVSS 5.3 score reflects the requirement for a pre-existing authenticated session (lowering the score from critical to medium) and the fact that confidentiality is not directly impacted. However, the integrity impact is rated HIGH because the attacker can permanently modify the authentication posture of an account. The score appropriately captures that this is not a pre-auth remote code execution, but it underplays the organizational risk when 2FA is the last defense against session-based attacks. Security teams should weight this higher than the raw score suggests in their own risk models.

Frequently asked questions

Do we need to reset all user passwords after patching this vulnerability?

Patching the code vulnerability stops future exploitation, but you should audit active sessions to identify any that may have been compromised. A password reset is recommended for any account whose session was exposed to an external attacker. If you cannot identify exposed sessions, consider a targeted re-authentication flow rather than a blanket reset to avoid operational disruption. Users should also manually verify their 2FA settings after the patch is applied.

If we're running LibreChat in an air-gapped environment, is this still a concern?

Yes. Air-gapped deployments reduce the risk of remote exploitation, but insider threats and compromised internal networks can still abuse session tokens. Additionally, if your LibreChat instance is ever connected to the broader network in the future, legacy unpatched instances become an entry point. Patch promptly regardless of network topology.

What does 'step-up authentication' mean in the context of this fix?

Step-up authentication means requiring additional verification (e.g., current TOTP token or a backup code) before allowing the user to modify sensitive security settings like 2FA configuration. The fix enforces this requirement on the /api/auth/2fa/enable endpoint so that even a valid session cannot unilaterally disable 2FA without proving possession of the current 2FA credentials.

Can we detect if an attacker has already disabled 2FA on our users' accounts before we patch?

Partially. Check your user database or LibreChat audit logs for any accounts where twoFactorEnabled changed from true to false without a corresponding user-initiated action or password change event nearby. If logs show 2FA was disabled but the user never requested it, that's a strong indicator. However, the absence of evidence is not evidence of absence—assume any account with an exposed session may have been compromised and audit accordingly.

This analysis is provided for informational purposes to help security teams understand and remediate CVE-2026-54036. SEC.co does not warrant the accuracy or completeness of patch version guidance; always verify availability and compatibility with your deployment against the official LibreChat advisory and release notes. No exploit code or weaponized proof-of-concept is included. Organizations should conduct their own risk assessment based on their specific use of LibreChat and threat landscape before prioritizing remediation efforts. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).