/

CVE-2026-42339

Severity:

HIGH RISK

(7.1)

Server-Side Request Forgery (SSRF) in New API LLM Gateway

CVE-2026-42339

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Blind to Full-Read SSRF Against Internal Services

Severity:

HIGH RISK

(7.1)

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

New API's LLM gateway contains a server-side request forgery (SSRF) flaw where requests using 0.0.0.0 as the host are not blocked by the private-IP filter, allowing traffic to be routed to localhost.

Any regular user with a valid API token can craft multimodal requests that cause the server to fetch internal resources, and when routed through specific adaptors, the fetched content may be exposed in model responses, turning a blind SSRF into full-read SSRF.

Affected context

This vulnerability affects deployments of New API (0.11.9-alpha.1 and prior) that:

  • Expose the LLM gateway endpoints /v1/chat/completions, /v1/responses, or /v1/messages to users holding API tokens
  • Allow multimodal requests where image or file URLs are fetched server-side
  • Rely on the built-in SSRF protection that filters private IP ranges but does not treat 0.0.0.0 as equivalent to localhost
  • Optionally integrate AWS/Bedrock Claude or similar adaptors that inline fetched content into model responses

In these environments, the gateway will accept URLs whose host is 0.0.0.0, resulting in HTTP requests that effectively target localhost or internal interfaces.

Exploit preconditions

  • Attack surface: HTTP API endpoints /v1/chat/completions, /v1/responses, and /v1/messages.
  • Required access: Any valid (non-admin) API token capable of issuing multimodal requests that reference external image/file URLs.
  • Trigger point: Submitting a request where the image/file URL host is 0.0.0.0, which bypasses the private IP filter.
  • Why exploitation is possible: The SSRF protection logic treats 0.0.0.0 as an unspecified address instead of resolving its effective behavior, so requests using this host are not blocked and are routed to localhost or internal interfaces. When combined with adaptors that inline fetched content into model responses, this creates a read channel for internal resources.

Why this happens

The underlying bug stems from incomplete normalization and validation of outbound request destinations in the SSRF protection layer.

While the system attempts to block private and loopback IP ranges, it fails to account for the behavior of the 0.0.0.0 address and does not consistently resolve or canonicalize the effective target before applying policy.

This maps to CWE-918: Server-Side Request Forgery, where a server-side component performs HTTP requests based on user-controlled URLs and insufficiently constrains the reachable addresses, enabling access to internal or otherwise restricted resources.

Potential impact

  • Blind SSRF probing of localhost and internal HTTP services reachable from the LLM gateway
  • Reading internal service responses when routed through adaptors that inline fetched content into model outputs
  • Discovery of internal endpoints, metadata services, or management interfaces exposed on localhost
  • Potential leakage of configuration data, credentials, or system metadata exposed via internal HTTP endpoints
  • Assisting further attacks such as pivoting to other internal services, depending on what is reachable and exposed

General mitigation guidance

Effective mitigation typically combines stricter network egress control with more robust destination validation:

  • Normalize and canonicalize destination hosts and IPs (including 0.0.0.0, loopback, and wildcard addresses) before applying SSRF filters.
  • Implement explicit allowlists for outbound HTTP destinations used for media fetching or external resources.
  • Use network-level egress restrictions (firewalls, security groups, service meshes) to prevent application servers from reaching localhost and sensitive internal ranges for this class of traffic.
  • Segregate responsibilities by running resource-fetching components in constrained environments with minimal network access and no access to administrative or metadata interfaces.
  • Treat all user-supplied URLs as untrusted and ensure that any content they return is handled as data only, not as configuration or executable instructions.

How teams detect issues like this

Organizations can detect and monitor this class of SSRF issues by:

  • Implementing static and configuration analysis rules that flag URL-fetching code paths lacking strict host/IP validation or allowlists.
  • Reviewing gateway and adaptor code for any path that accepts user-controlled URLs and issues server-side HTTP requests, ensuring consistent normalization and filtering.
  • Enforcing infrastructure policies that log and alert on outbound requests targeting loopback, link-local, metadata service IPs, or unexpected internal ranges from application components.
  • Setting up application-level logging for external fetch operations (target host, path, and response metadata) and establishing anomaly detection for unusual patterns or destinations.
  • Using automated security testing tools (e.g., SSRF scanners or fuzzers) against API endpoints that accept URLs to validate that internal ranges and special addresses are effectively blocked.

Sources

SourceLink
github.comgithub.com/QuantumNous/new-api/security/advisories/GHSA-v5c3-6wvc-pc2q

Frequently asked

questions

Yes, provided the API is exposed and an attacker can obtain or abuse any valid API token. The attack is performed via the public HTTP endpoints by supplying crafted URLs.

No. The issue can be triggered by regular (non-admin) users as long as they possess a valid API token that allows them to send multimodal requests to the affected endpoints.

The most robust approach is to normalize and strictly validate all outbound destinations, block or strongly restrict access to localhost and internal ranges, and enforce allowlists for legitimate external hosts used for resource fetching, backed by network-level egress controls.

Preventive measures include designing URL-fetching components with deny-by-default policies for internal addresses, using layered defenses (code-level checks plus network segmentation), adopting secure coding guidelines for handling user-supplied URLs, and integrating SSRF-focused checks into code review and automated testing pipelines.

Find out what's already
exploitable in your codebase.