CVE-2026-54042 in LibreChatinfo

Summary

by MITRE • 11/20/2026

LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.7, POST /api/auth/2fa/verify-temp in api/server/routes/auth.js calls verify2FAWithTempToken and accepts repeated TOTP or backup-code guesses without a dedicated attempt limiter. An attacker must first possess valid primary credentials and a valid five-minute temp token, but can then make repeated second-factor attempts and obtain a full session if a valid code is guessed. This issue is fixed in version 0.8.7.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/20/2026

The vulnerability identified in LibreChat versions prior to 0.8.7 represents a critical authentication bypass mechanism rooted in the absence of rate limiting on secondary verification endpoints. LibreChat, functioning as an enhanced ChatGPT clone that aggregates multiple AI providers, relies heavily on robust access control mechanisms to protect user data and computational resources. The specific flaw resides within the POST /api/auth/2fa/verify-temp endpoint located in api/server/routes/auth.js. This endpoint is designed to validate temporary tokens issued during a two-factor authentication flow, specifically handling time-based one-time passwords (TOTP) or backup codes. While the application correctly requires an attacker to first compromise primary credentials and obtain a valid five-minute temp token, it fails to implement any dedicated attempt limiter for these secondary verification steps. This architectural oversight allows an authenticated user session context to be exploited through brute-force attacks against the second factor without triggering account lockouts, IP-based throttling, or exponential backoff mechanisms typically expected in secure authentication flows.

From a technical perspective, this flaw constitutes a classic case of insufficient rate limiting on critical security controls. The verification logic for TOTP and backup codes operates with high entropy but lacks iterative protection. An attacker who has successfully harvested valid primary credentials through phishing, credential stuffing, or data breaches can leverage the five-minute window provided by the temp token to execute rapid-fire requests against the verify-temp endpoint. Since there is no counter tracking consecutive failed attempts within this session context, the system will continue to accept guesses until a match is found. Given that TOTP codes are typically six digits long and backup codes are often shorter or less complex, the probability of successful brute-forcing increases significantly when unbounded by time-based restrictions or attempt caps. This effectively reduces the security strength of two-factor authentication to near parity with single-factor authentication in scenarios where primary credentials are compromised, thereby negating one of the most effective layers of defense against unauthorized access.

The operational impact of this vulnerability is severe for both individual users and organizations deploying LibreChat instances. Once an attacker successfully guesses a valid TOTP or backup code within the five-minute window, they obtain a full session token equivalent to that of the legitimate user. This grants unrestricted access to all features supported by the AI providers integrated into the platform, including sensitive conversation history, personal data inputs used for prompt engineering, and potentially connected API keys if such configurations exist. For enterprise environments, this could lead to significant data exfiltration, intellectual property theft, or further lateral movement within internal networks if LibreChat is integrated with other corporate tools. The lack of detection mechanisms means that successful attacks may go unnoticed until substantial damage has occurred, as standard logging might not flag the high volume of rapid verification attempts originating from a single session context.

This vulnerability aligns closely with CWE-307, which describes Improper Restriction of Excessive Authentication Attempts, and maps directly to MITRE ATT&CK technique T1110.004, representing Brute Force: Password Guessing for Web Applications. Although the initial access vector requires compromised primary credentials, the failure to secure the secondary authentication step undermines the entire multi-factor authentication strategy. Security best practices dictate that all endpoints involved in identity verification must implement strict rate limiting based on user identifiers or session IDs, not just IP addresses, to prevent automated guessing attacks even when a valid token is present. The absence of such controls indicates a gap in the application security lifecycle where threat modeling did adequately account for post-compromise exploitation paths involving secondary factors.

Mitigation strategies primarily involve upgrading to LibreChat version 0.8.7 or later, which addresses this issue by implementing appropriate attempt limits on the verification endpoint. For organizations unable to immediately patch their instances due to operational constraints, temporary mitigations should include deploying a Web Application Firewall (WAF) rule that monitors and restricts the frequency of POST requests to /api/auth/2fa/verify-temp from individual session IDs or user accounts. Additionally, administrators can enforce stricter timeout policies for temp tokens if configurable, reducing the window of opportunity for brute-force attacks. Long-term remediation should also include implementing account lockout mechanisms after a small number of failed attempts and ensuring that all authentication-related endpoints are subject to rigorous security testing during development phases. Regular penetration testing focusing on authentication flows is essential to identify similar gaps in other parts of the application where rate limiting may be inadvertently omitted or misconfigured.

Responsible

GitHub M

Reservation

06/11/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00435

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!