Summary
CVE-2026-82639 is an improper input validation flaw in ChatGPT Next Web (NextChat), a self-hosted web UI for ChatGPT and other LLM providers. The proxy request handler validates the x-base-url header using a substring check instead of proper hostname parsing, allowing an unauthenticated remote attacker to trick the server into forwarding its configured OpenAI API key to an attacker-controlled host. The issue is rated high severity and affects any self-hosted NextChat deployment with a server-side OPENAI_API_KEY configured.
Technical details
- Root cause:
app/api/proxy.tsdecides whether to attach the server’s OpenAIAuthorizationheader by checkingbaseUrl?.includes("api.openai.com")— a plain substring test rather than a parsed-hostname comparison. - Trigger condition: An attacker sends a request with an
x-base-urlheader containingapi.openai.comanywhere in the string (e.g., as a query parameter or path segment) while pointing the actual host elsewhere, such ashttp://attacker.com?q=api.openai.com. - Attack vector: Network, unauthenticated, single HTTP request; access-code protection on the NextChat instance does not mitigate it because the proxy endpoint performs no authentication of its own.
- Impact: Disclosure of the deployment’s server-side OpenAI API key to an attacker-controlled endpoint, enabling unauthorized use of the victim’s OpenAI account/billing and potential further abuse of that key.
Affected software
- ChatGPTNextWeb/NextChat versions 2.15.8 through 2.16.1 (inclusive), with a server-configured
OPENAI_API_KEY.
Severity
- CVSS v3.1: 7.5 (High) —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N - Also scored under CVSS v4.0 as 8.7 (High) —
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
Mitigation and recommended actions
- Immediate: No official patched release has been confirmed at time of writing; a fix (replacing the substring check with proper
URLhostname parsing) is proposed in pull request #6884 against the project repository. Apply that fix or an equivalent patch, and track the upstream repository for a tagged release beyond 2.16.1. - If no patch is available: Rotate the server’s
OPENAI_API_KEYimmediately and monitor OpenAI account usage for unauthorized activity; restrict or firewall outbound traffic from the NextChat host so the proxy endpoint cannot reach arbitrary external destinations; disable or remove the/api/proxyroute if it is not required; place the deployment behind an authenticating reverse proxy or VPN so the endpoint is not directly internet-exposed.
How IONIX identifies potentially affected assets
IONIX matches the following signals against data already collected when it crawled the asset; identifying the technology sends no request beyond that crawl.
- Raw response body:
Your personal ChatGPT Chat Bot. - Favicon fingerprint:
-489732743,1296353639

