
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-137656 is a race condition vulnerability in LibreChat's checkBalance middleware that allows authenticated users to obtain multiple auto-refill token credits by sending concurrent requests. Affecting LibreChat versions 0.7.8 through 0.8.8-rc2 (fixed in 0.8.9), the flaw enables K simultaneous chat requests to each pass the same stale lastRefill eligibility check and receive K × refillAmount credits from a single refill window. It was published on November 26, 2026, with a patch released November 17, 2026. The CVSS v3.1 base score is 3.1 (Low), and the CVSS v4.0 base score is 2.3 (Low) (GitHub Advisory, LibreChat Advisory).
The root cause is CWE-362 (Race Condition / Concurrent Execution using Shared Resource with Improper Synchronization), with a secondary weakness of CWE-841 (Improper Enforcement of Behavioral Workflow). In the vulnerable code (packages/api/src/middleware/checkBalance.ts, lines 113–140), the auto-refill eligibility check reads lastRefill from the balance record without holding a lock. The updateBalance compare-and-swap (CAS) operation in createAutoRefillTransaction is keyed only on tokenCredits, not on lastRefill, so its retry loop re-reads and re-adds refillAmount for each concurrent request that passed the eligibility gate. An attacker with a depleted balance can fire K simultaneous POST requests to /api/ask/openAI during an open refill window; each request independently reads the same stale lastRefill, passes the eligibility check, and calls createAutoRefillTransaction, resulting in K × refillAmount credits being added instead of one (LibreChat Advisory, Vulnerable Code).
Successful exploitation allows any authenticated user to inflate their token credit balance far beyond the configured refillAmount per interval, effectively bypassing the platform's token credit limits. In deployments where token credits map directly to monetary cost (e.g., API usage billed to the operator), this constitutes a financial integrity violation. There is no confidentiality or availability impact; the harm is limited to integrity of the credit accounting system (LibreChat Advisory, GitHub Advisory).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at the time of disclosure. The vulnerability requires a valid authenticated session and the target instance must have autoRefillEnabled: true with an elapsed refill interval and a near-zero balance — conditions that limit opportunistic exploitation. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. The advisory includes a detailed PoC script demonstrating the attack, attributed to reporter HarshKumar09 (LibreChat Advisory, GitHub Advisory).
autoRefillEnabled is true, the refill interval has elapsed, and the account balance is near zero (e.g., curl -s http://<host>/api/balance -H "Authorization: Bearer $TOKEN" returns a low tokenCredits value).lastRefill:for i in $(seq 1 10); do
curl -s -o /dev/null -X POST http://<host>/api/ask/openAI \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
--data '{"text":"hi","endpoint":"openAI","model":"gpt-4o"}' &
done; waitlastRefill eligibility check and calls createAutoRefillTransaction, crediting refillAmount per request. With K=10 and refillAmount=10000, the balance becomes ~100,000 instead of ~10,000./api/ask/openAI (or other chat endpoints) from the same authenticated user within a very short time window (milliseconds apart).createAutoRefillTransaction log entries for the same user within a single refill interval; repeated [Balance.check] debug log entries showing the same stale lastRefill value across concurrent requests.tokenCredits balance significantly exceeding the configured refillAmount after a single refill interval (e.g., balance = N × refillAmount where N > 1); rapid successive credit refill events in transaction logs for a single user.Upgrade LibreChat to version 0.8.9 or later, which replaces the vulnerable createAutoRefillTransaction flow with an atomic reserveBalance / releaseBalanceReservation mechanism that fences on tokenCredits, reservations, and lastRefill in a single compare-and-swap write, ensuring one refill window credits exactly once. The fix is delivered via commits 696bcb6c1e (credit reservation) and 0fea0240d6 (balance reset without rollover). As a temporary workaround, disabling autoRefillEnabled in the LibreChat configuration eliminates the vulnerable code path until an upgrade is possible. Monitoring for anomalous rapid credit refills from individual users can help detect exploitation attempts (LibreChat Release, Fix Commit 1, Fix Commit 2).
The vulnerability was reported by security researcher HarshKumar09 and accepted by the LibreChat maintainer (danny-avila), who assessed it as medium severity and prioritized a fix. The maintainer's audit note confirms the fix atomically fences on lastRefill, balance, reservation, and policy values before applying credits, addressing the stale-window race. No significant broader media coverage or notable community commentary beyond the GitHub advisory has been identified (LibreChat Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."