CVE-2026-137656 in LibreChat
Summary
by MITRE • 11/26/2026
LibreChat 0.7.8 before 0.8.9 contains a race condition vulnerability in checkBalance that allows authenticated users to obtain multiple auto-refill credits by sending concurrent requests. Attackers can send simultaneous chat requests that each pass the unlocked lastRefill check, receiving repeated refillAmount credits and bypassing configured token credit limits.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/26/2026
The identified vulnerability represents a classic race condition within the authentication and billing logic of LibreChat versions prior to 0.8.9. Specifically, the flaw resides in the checkBalance function which is responsible for verifying user account balances before processing chat requests. The core technical issue stems from a lack of atomicity when checking and updating the lastRefill timestamp or balance state. When an authenticated user sends multiple concurrent requests simultaneously, these requests can all read the same initial state where the condition for auto-refilling credits has not yet been met due to timing constraints. Because the system does not lock this resource during the check-and-update cycle, each request independently passes the unlocked lastRefill check before any single request triggers the update that would prevent subsequent refills. This allows an attacker to exploit the time-of-check-to-time-of-use gap by flooding the service with parallel requests, effectively bypassing the intended token credit limits and obtaining multiple auto-refill credits in a short timeframe.
From a security architecture perspective, this vulnerability aligns closely with CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization. The failure to properly synchronize access to shared state variables related to user balances creates an opportunity for economic abuse rather than direct system compromise or data exfiltration. While the attacker requires valid authentication credentials, which places this within the bounds of authenticated attacks, the ability to manipulate billing logic undermines the integrity of the service's resource management policies. In terms of offensive security frameworks, this behavior maps to MITRE ATT&CK technique T1496: Resource Hijacking, specifically in the context of consuming computational resources and credits beyond authorized limits for financial gain or denial of service against other users by depleting shared infrastructure capacity through excessive legitimate-looking requests.
The operational impact of this vulnerability is primarily economic and related to resource exhaustion. By obtaining multiple auto-refill credits without authorization, an attacker can consume significant amounts of backend processing power associated with large language model inference. This not only results in direct financial loss for the service provider but also degrades performance for legitimate users who share the same infrastructure. The ability to bypass configured token credit limits means that security controls designed to enforce fair usage policies are rendered ineffective against concurrent attack vectors. Furthermore, if left unmitigated, this could lead to cascading failures where the system becomes overwhelmed by the volume of requests required to exploit the race condition effectively, potentially causing service instability or outages for all tenants on the platform.
Mitigation strategies must focus on enforcing strict atomicity in balance checks and updates. The most effective remediation involves implementing database-level transactions with appropriate locking mechanisms, such as SELECT FOR UPDATE, when checking and modifying user balances to ensure that only one request can process a refill at a time per user account. Alternatively, the application logic should utilize optimistic concurrency control or compare-and-swap operations to detect and reject concurrent modifications to the balance state. Additionally, implementing rate limiting based on IP address or user ID for specific endpoints involved in billing checks can reduce the window of opportunity for race conditions by throttling high-frequency requests. Upgrading to LibreChat version 0.8.9 or later is essential as these versions contain patches addressing this synchronization flaw and restoring proper enforcement of credit limits under concurrent load scenarios.