CVE-2026-54040: LibreChat: 2FA Backup Code Regeneration Without OTP Verification Allows 2FA Bypass
LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.4-rc1, the POST /api/auth/2fa/backup/regenerate endpoint regenerates all 2FA backup codes without requiring any TOTP token or existing backup code verification. An attacker with a stolen session token can silently replace a victim's backup codes and use them to bypass 2FA login or disable 2FA entirely. This vulnerability is fixed in 0.8.4-rc1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
LibreChatto a version that resolves this vulnerability.Fixed in 0.8.4-rc1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-54040?
The severity of CVE-2026-54040 is medium with a score of 5.9.
How do I fix CVE-2026-54040?
To fix CVE-2026-54040, upgrade LibreChat to version 0.8.4-rc1 or later.
What vulnerability does CVE-2026-54040 address?
CVE-2026-54040 addresses a flaw that allows 2FA bypass through backup code regeneration without OTP verification.
What could an attacker do with CVE-2026-54040?
An attacker with a stolen session token could bypass 2FA and gain unauthorized access to user accounts.
Is user authentication affected by CVE-2026-54040?
Yes, CVE-2026-54040 affects user authentication by allowing code regeneration without verifying existing credentials.