LibrechatApplication

CVE-2026-31942

HIGH · 7.1 CVSS v3.1 Published 2026-06-02
Fix available
A fix is available. Upgrade to 0.8.3 or later.
See remediation →
77/100
Remediation priority · High
Remotely reachable Zero-click

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 · unedited
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.

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 confidence

An 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.

MitigationUpgrade 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.

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
LibrechatApplication
Affected:< 0.8.3

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify LibreChat installation
    Locate 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 containers
    Affected if The installed version is below 0.8.3 (any version up to 0.7.6)
  2. Verify API keys endpoint exists
    Check if the endpoint PUT /api/keys is defined in the application's route configuration, typically in the api/routes directory
    Affected if The /api/keys endpoint exists and handles PUT requests without proper authorization checks
  3. Confirm user authentication is enabled
    Check 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 folder
    Affected if Authenticated users can access the API and the route lacks role-based or user-ownership authorization validation for the userId parameter
  4. Inspect the key update logic for vulnerable pattern
    Examine 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 identity
    Affected 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to 0.8.3 or later
Fixed in 0.8.3
Interim mitigation

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.

Recommended fix High confidence

LibreChat 0.8.3-rc1 or later stable release

  1. Upgrade LibreChat to version 0.8.3-rc1 or later to resolve the IDOR vulnerability in the API keys management endpoint
Caveat Review release notes for any breaking changes between your current version and 0.8.3-rc1

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Librechat Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA2.0 h
11.0 hours of engineering $1,930
Get the upgrade done

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-31942 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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