CVE-2026-31942 LibreChat has IDOR in API Keys Management that allows any authenticated user to overwrite other users' API keys

High 7.1 Published Updated

Authenticated users can overwrite other users' API keys via IDOR, enabling service disruption or traffic redirection.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-31942?

CVE-2026-31942 is a high-severity missing authorization vulnerability in Librechat Librechat, published on 2 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

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.

Weakness: CWE-862

Which versions are affected by CVE-2026-31942?

It affects 1 product.

Products include Librechat Librechat.

How do I fix CVE-2026-31942?

No fix has been published for CVE-2026-31942 yet. Limit exposure of the affected software until one is available.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2026-31942 being exploited?

There is no known exploitation of CVE-2026-31942 in the wild and no public exploit code.

All Librechat Librechat vulnerabilities

Sources

Also known as GHSA-5jcj-rh68-cgj7.

Is CVE-2026-31942 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free