LibreChat
CVE-2026-31942
HIGH
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. In versions up to and including 0.7.6, an Insecure Direct Object Reference (IDOR) vulnerability exists in the API keys management endpoint (PUT /api/keys). Due to the use of the JavaScript object spread operator after setting the authenticated user's ID, any authenticated user can inject a userId parameter in the request body to overwrite any other user's API keys (e.g., OpenAI, Anthropic, Azure). This allows an attacker to replace a victim's API key configuration, potentially routing the victim's conversations through attacker-controlled keys or denying service by providing invalid keys. This is patched in version 0.8.3-rc1.
AnalysisAI
Cross-user API key overwrite in LibreChat versions up to and including 0.7.6 allows any authenticated user to replace another user's stored provider API keys (OpenAI, Anthropic, Azure) by injecting a userId parameter into PUT /api/keys requests. The flaw stems from an Insecure Direct Object Reference where the JavaScript spread operator overrides the server-set authenticated user ID, enabling conversation hijacking or denial of service. No public exploit identified at time of analysis, and the issue is fixed in 0.8.3-rc1.
Technical ContextAI
LibreChat (cpe:2.3:a:danny-avila:librechat) is an open-source, self-hosted multi-provider chat interface that brokers requests to upstream LLM APIs using per-user stored credentials. The root cause is CWE-862 (Missing Authorization): the PUT /api/keys handler constructs its update document by spreading the request body after assigning req.user.id, so a client-supplied userId in the body shadows the trusted server value and the database write targets an arbitrary account. This is a classic order-of-assignment IDOR exacerbated by trusting client JSON in a privileged write path.
RemediationAI
Upgrade to LibreChat 0.8.3-rc1 or later, which is the vendor-released patched version per advisory GHSA-5jcj-rh68-cgj7 (https://github.com/danny-avila/LibreChat/security/advisories/GHSA-5jcj-rh68-cgj7). If immediate upgrade is not possible, disable open user registration so only trusted users can reach the authenticated endpoint, place an authenticating reverse proxy or WAF rule in front of PUT /api/keys to strip or reject any userId field in the request body, and rotate all stored provider API keys (OpenAI, Anthropic, Azure) after patching since prior overwrites may be undetected; the trade-off of WAF body-rewriting is potential breakage of legitimate future schema changes, and forcing key rotation will require users to re-enter credentials.
A vulnerability in danny-avila/librechat version git 81f2936 allows for path traversal due to improper sanitization of f
An arbitrary file deletion vulnerability exists in danny-avila/librechat version v0.7.5-rc2, specifically within the /ap
LibreChat 0.8.1-rc2 has SSRF in the Actions feature that allows authenticated users to make the server perform requests
LibreChat before v0.8.2-rc2 allows any authenticated user to execute shell commands as root inside the container through
LibreChat is a ChatGPT clone with additional features. Rated high severity (CVSS 8.6), this vulnerability is remotely ex
In danny-avila/librechat version git 0c2a583, there is an improper input validation vulnerability. Rated high severity (
LibreChat is a ChatGPT clone with additional features. Version 0.8.1-rc2 does not enforce proper access control for file
An unhandled exception in the danny-avila/librechat repository, version git 600d217, can cause the server to crash, lead
An improper access control vulnerability (IDOR) exists in the delete attachments functionality of danny-avila/librechat
LibreChat through 0.7.4-rc1 does not validate the normalized pathnames of images. Rated critical severity (CVSS 9.8), th
LibreChat through 0.7.4-rc1 has incorrect access control for message updates. Rated critical severity (CVSS 9.8), this v
Information disclosure in LibreChat's Model Context Protocol (MCP) integration allows any authenticated user to exfiltra
Same weakness CWE-862 – Missing Authorization
View allSame technique Authentication Bypass
View allShare
External POC / Exploit Code
Leaving vuln.today