CVE-2026-54040 LibreChat: 2FA Backup Code Regeneration Without OTP Verification Allows 2FA Bypass
Attackers with stolen session tokens can regenerate 2FA backup codes without verification, bypassing two-factor authentication to take over accounts.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-54040?
CVE-2026-54040 is a medium-severity vulnerability in Librechat Librechat, published on 25 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
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.
Weakness: CWE-306
Which versions are affected by CVE-2026-54040?
It affects 1 product.
Products include Librechat Librechat.
How do I fix CVE-2026-54040?
No fix has been published for CVE-2026-54040 yet. Limit exposure of the affected software until one is available.
Is CVE-2026-54040 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54040 exists.
Other vulnerabilities in Librechat Librechat
- CVE-2026-32625 LibreChat Exfiltrates Server Secrets via MCP Server URL Injection
- CVE-2024-11167 Improper Access Control in danny-avila/librechat
- CVE-2026-22252 LibreChat MCP Stdio Remote Command Execution
- CVE-2025-69222 LibreChat is vulnerable to Server-Side Request Forgery due to missing restrictions
- CVE-2024-41704 Path traversal in n/a
Sources
Also known as GHSA-h59w-x9h4-m6gv.