Severity:

HIGH RISK

(7.3)

SSRF in ChatGPTNextWeb NextChat Artifacts Endpoint

CVE-2026-7178

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized network access via SSRF, potentially reaching internal services and sensitive metadata endpoints

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery (SSRF) vulnerability in ChatGPTNextWeb NextChat's Artifacts API allows attackers to abuse the storeUrl function to make the server initiate arbitrary outbound HTTP requests.

By manipulating the id argument, a remote attacker can pivot through the server to reach internal or protected resources that are not directly exposed to the internet.

Affected context

The issue occurs in deployments of ChatGPTNextWeb NextChat (up to 2.16.1) where the Artifacts Endpoint (app/api/artifacts/route.ts) is exposed and processes user-controlled input through the storeUrl function.

The vulnerability is present when the id parameter is accepted from client input and used to construct or influence outbound requests without strong validation or restriction of target hosts, schemes, or IP ranges.

Any environment where the application can connect to internal services, cloud metadata endpoints, or other non-public infrastructure is at elevated risk.

Exploit preconditions

  • Attack surface: Publicly exposed Artifacts API endpoint (/api/artifacts or equivalent) reachable over the network.
  • Required access: Ability to send HTTP requests to the affected endpoint (typically unauthenticated or low-privilege API access, depending on deployment).
  • Trigger point: Supplying a crafted id argument that controls or significantly influences the destination of an outbound HTTP request in storeUrl.
  • Why exploitation is possible: The server-side logic trusts the user-provided id value when building or resolving URLs, and does not adequately restrict internal IP ranges, non-HTTP(S) schemes, or sensitive endpoints, allowing the server to act as a proxy to unintended network targets.

Why this happens

The vulnerability stems from insufficient validation and sanitization of user-influenced URL parameters before they are used in server-initiated HTTP requests.

In the storeUrl function, the id argument is treated as a trustworthy component in constructing or resolving a URL, effectively delegating target selection to the client.

This maps to CWE-918: Server-Side Request Forgery, where an application permits attackers to make arbitrary network requests from the server to internal or external systems by controlling URL-like input.

The core insecure pattern is using client input directly to drive server-side HTTP requests without enforcing strict allow-lists, scheme checks, IP filtering, or network egress controls.

Potential impact

  • Access to internal web services that are not exposed to the public internet
  • Interaction with cloud provider metadata services, potentially leaking credentials or tokens
  • Port scanning or service discovery within the internal network from the application host
  • Bypassing IP-based access controls or network segmentation by tunneling through the application server
  • Pivoting into more sensitive systems, enabling follow-on attacks such as data exfiltration or environment reconnaissance

General mitigation guidance

Effective mitigation focuses on constraining where the server is allowed to connect and reducing client control over outbound requests:

  • Enforce strict allow-lists for outbound destinations (domains, paths, and protocols) used by artifact-related requests, rejecting any value outside expected patterns.
  • Validate and normalize user-influenced URL components before use: require HTTPS, reject ambiguous encodings, and disallow redirects to unapproved hosts.
  • Block access to internal IP ranges (e.g., RFC1918, link-local, loopback) and metadata service addresses at the application layer and, where possible, at the network layer.
  • Decouple user input from raw URLs: map user-supplied identifiers to predefined, server-side configured endpoints instead of treating them as full or partial URLs.
  • Apply least-privilege networking for the application runtime, limiting egress to only the domains and ports necessary for normal operation.

How teams detect issues like this

To identify and monitor SSRF risks in similar code paths, organizations can:

  • Use static analysis rules to detect patterns where user input flows into HTTP client calls (e.g., fetch, axios, http.request) without prior validation or allow-list checks.
  • Add code review checklists that flag any new feature where URLs or hosts are derived from request parameters, query strings, or body fields.
  • Implement runtime logging and anomaly detection for outbound HTTP requests, such as alerts for attempts to reach internal IP ranges, metadata services, or unexpected domains.
  • Leverage automated security testing tools (DAST and SAST) that specifically probe for SSRF by injecting internal IPs, reserved hostnames, or metadata endpoints into URL parameters.

Sources

SourceLink
gist.github.comgist.github.com/YLChen-007/43252d45d75e8bdd2d45136fd6ffe8a5
github.comgithub.com/ChatGPTNextWeb/NextChat/
github.comgithub.com/ChatGPTNextWeb/NextChat/issues/6741
vuldb.comvuldb.com/submit/797646
vuldb.comvuldb.com/vuln/359780
vuldb.comvuldb.com/vuln/359780/cti

Frequently asked

questions

The vulnerability is remotely exploitable wherever the Artifacts Endpoint is reachable over the network and accepts attacker-influenced id values, making it relevant for internet-facing and intra-organization deployments alike.

That depends on how the endpoint is deployed. If the Artifacts Endpoint is publicly accessible without strong authentication, an unauthenticated attacker may exploit it; otherwise, any account that can hit the endpoint and control id is in a position to attempt SSRF.

The most robust approach is to remove direct user control over outbound request targets: map client-provided identifiers to server-side configured, allow-listed destinations, and perform strict validation to prevent access to internal or sensitive endpoints.

Treat any URL- or host-related input as untrusted, enforce allow-lists and scheme/IP restrictions before making outbound requests, and embed SSRF-focused checks into code review, static analysis rules, and architectural guidelines for any component that performs server-initiated HTTP calls.

Find out what's already
exploitable in your codebase.