LibreChat
CVE-2026-31942
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain authenticated LibreChat account
-
DeliveryIdentify victim userId
-
ExploitCraft PUT /api/keys with injected userId and attacker keys
-
ExecutionServer spread overwrites victim record
-
PersistVictim chats route through attacker keys
-
ImpactCapture prompts/responses or deny service
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V8 - Authorization Authorization checks on every request
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Attacker must hold any authenticated LibreChat account (PR:L) on the target instance and be able to reach the PUT /api/keys endpoint over the network; no user interaction from the victim is needed and no special server configuration is required because the vulnerable spread pattern is present in default deployments of versions through 0.7.6. Exploitation is limited to instances that allow the attacker to obtain an account (e.g., open registration, shared internal tenancy, or compromised low-privilege credentials) and is fully blocked on instances upgraded to 0.8.3-rc1. |
| Impact | The CVSS 7.1 vector AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L reflects a remote, low-complexity, authenticated attack with high integrity impact and low availability impact, no confidentiality loss directly on the API call itself - consistent with overwriting (not reading) victim keys. EPSS and CISA KEV data were not supplied for this CVE, and no public exploit is identified at time of analysis, so this should be treated as a credible but not yet weaponized risk. The practical impact understates downstream confidentiality risk: attacker-controlled keys can silently proxy victims' subsequent conversations, which is a real prioritization driver for multi-tenant LibreChat deployments even though CVSS scores C:N. Authentication is required (PR:L), which limits exposure to instances with public signup or shared tenancy. |
| Exploit ScenarioDerived | An attacker registers or uses an existing low-privileged LibreChat account, then sends a PUT /api/keys request with a JSON body containing both their own legitimate fields and a userId value targeting a victim along with attacker-controlled OpenAI/Anthropic keys. The victim's subsequent chat sessions are routed through the attacker's keys, allowing silent capture of all prompts and responses or, by supplying invalid keys, a denial of service against the victim's chat functionality. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 02, 2026
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.
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.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
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.
Know when Librechat gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
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
DescriptionCVE.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.
Executive ViewAI
LibreChat versions up to 0.7.6 contain an authentication bypass flaw allowing any logged-in user to steal API credentials (OpenAI, Anthropic, Azure) belonging to other users, enabling unauthorized access to customer cloud services and conversation hijacking. Organizations running multi-tenant LibreChat deployments face immediate risk of API key compromise and data exposure affecting all connected cloud AI services.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict API key feature access to administrators; disable provider-integrated API key storage if not critical to operations; implement network segmentation limiting authenticated user access; monitor PUT /api/keys endpoint for suspicious userId parameter injection; audit authentication logs for unusual cross-user activity patterns. Release candidate 0.8.3-rc1 available for accelerated testing if business risk tolerance permits pre-release deployment.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Affected Products (CPE)CVE.org
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 before v0.8.2-rc2 allows any authenticated user to execute shell commands as root inside the container through
LibreChat 0.7.9 lets an authenticated user turn off two-factor authentication on their own account without supplying a v
Stored cross-site scripting and tracker injection in LibreChat 0.8.0 and earlier allow a user who can create a chat to c
LibreChat is a ChatGPT clone with additional features. Rated high severity (CVSS 8.6), this vulnerability is remotely ex
LibreChat 0.8.1-rc2 has SSRF in the Actions feature that allows authenticated users to make the server perform requests
In danny-avila/librechat version git 0c2a583, there is an improper input validation vulnerability. Rated high severity (
A mass assignment vulnerability exists in danny-avila/librechat, affecting all versions. Rated high severity (CVSS 7.5),
Unbounded `key` and `value` parameters on the LibreChat 0.7.9 memory API (`POST /api/memories` and `PATCH /api/memories/
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
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB