ZeroHour

CVE-2026-82639

moderate

OpenAI API Key Disclosure in NextChat Proxy via Improper URL Validation

CVSS 4.0
8.7 high
EPSS
<1%p22
Published
()
Modified
AI analysis

NextChat (ChatGPT-Next-Web) versions 2.15.8 through 2.16.1 contain an improper URL validation flaw (CWE-20) in the server-side proxy endpoint that can leak the server's configured OpenAI API key. The proxy validates the attacker-controlled x-base-url header using substring matching instead of hostname parsing, so any URL merely containing 'api.openai.com' passes validation, and the server sends its credentials in the Authorization header to that attacker-chosen URL. An unauthenticated remote attacker who can reach the proxy endpoint can therefore retrieve the operator's OpenAI API key and abuse it for their own API calls at the operator's expense. Operators running affected NextChat versions with a server-configured OpenAI key on a reachable proxy endpoint are affected. Exploitation has not been observed: no public proof of concept exists, the flaw is not in CISA KEV, and EPSS assigns a 0.3% probability of exploitation within 30 days.

What to do: Upgrade NextChat to a fixed release newer than 2.16.1 (the data does not specify a fixed version number). Until patched, restrict access to the proxy endpoint (e.g., require authentication or limit it by firewall), and if the endpoint was internet-exposed, rotate the stored OpenAI API key and review access logs for requests carrying unusual x-base-url values.

Affected
NextChat (ChatGPTNextWeb project) NextChat (ChatGPT-Next-Web)2.15.8 through 2.16.1
Estimated exposure
moderateplausibly thousands of self-hosted, internet-reachable instances (order-of-magnitude estimate; only deployments exposing the proxy endpoint while storing a… — No public scan or install-count data was provided; NextChat is a widely used open-source ChatGPT web UI commonly self-hosted via Docker or one-click deployments, so the count of exposed instances that configured a server-side OpenAI key is…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

NextChat versions from 2.15.8 through 2.16.1 contain an improper URL validation vulnerability in the proxy endpoint that allows attackers to obtain the server's OpenAI API key. The x-base-url header is validated using substring matching instead of hostname parsing, allowing any URL containing 'api.openai.com' to pass validation and receive the server's credentials in the Authorization header.

Weakness
CWE-20
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In the news

No ingested article mentions this CVE yet.