CVE-2026-31942
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedLibreChat 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceAn IDOR vulnerability in LibreChat's PUT /api/keys endpoint allows any authenticated user to overwrite other users' API keys by injecting a userId parameter in the request body. The vulnerability stems from using the JavaScript object spread operator after setting the authenticated user's ID, which permits attacker-controlled userId values to take precedence.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data< 0.8.3CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- High
- Availability
- Low
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify LibreChat installationLocate the LibreChat installation directory and check the package.json file for the version field, or run 'npm list librechat' or check the Docker image tag if using containersAffected if The installed version is below 0.8.3 (any version up to 0.7.6)
-
Verify API keys endpoint existsCheck if the endpoint PUT /api/keys is defined in the application's route configuration, typically in the api/routes directoryAffected if The /api/keys endpoint exists and handles PUT requests without proper authorization checks
-
Confirm user authentication is enabledCheck if the application requires authentication for API access. Look for auth middleware on the keys route, typically in a file like keys.js or keys.ts in the routes folderAffected if Authenticated users can access the API and the route lacks role-based or user-ownership authorization validation for the userId parameter
-
Inspect the key update logic for vulnerable patternExamine the PUT /api/keys handler code for use of the object spread operator after setting req.user.id. Look for patterns like { ...req.body, userId: user.id } that would allow req.body.userId to override the authenticated user's identityAffected if The code uses spread operators that allow the userId from the request body to take precedence over the authenticated user's ID, enabling the IDOR flaw
You are affected if running any LibreChat version below 0.8.3 where the PUT /api/keys endpoint permits authenticated users to inject a userId parameter and modify other users' API keys.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped0.8.3
Upgrade to version 0.8.3-rc1 or later. Until upgrade is possible, implement application-layer validation to ensure users can only modify their own API keys and reject any userId parameter in API requests.
LibreChat 0.8.3-rc1 or later stable release
- Upgrade LibreChat to version 0.8.3-rc1 or later to resolve the IDOR vulnerability in the API keys management endpoint
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing3.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,088.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2026-31942 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-31942 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data