CVE-2026-54040 LibreChat: 2FA Backup Code Regeneration Without OTP Verification Allows 2FA Bypass

Medium 5.9 Published Updated

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.

All Librechat Librechat vulnerabilities

Sources

Also known as GHSA-h59w-x9h4-m6gv.

Is CVE-2026-54040 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free