/

CVE-2026-63764

Severity:

HIGH RISK

(8.6)

SSRF via Unsafe Redirect Handling (CWE-918) in lmdeploy

CVE-2026-63764

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized access to internal services and cloud metadata

Severity:

HIGH RISK

(8.6)

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

The lmdeploy OpenAI-compatible API server contains a server-side request forgery flaw that lets attackers pivot outbound HTTP requests toward internal services and cloud metadata endpoints.

By abusing image_url handling and unvalidated HTTP redirects, unauthenticated attackers can coerce the server into fetching sensitive internal resources that are not directly exposed.

Affected context

This vulnerability appears when lmdeploy is deployed with its OpenAI-compatible API server exposed to untrusted clients and configured to fetch remote image URLs on behalf of users.

Risk increases in environments where:

  • The server can reach internal network segments or instance metadata endpoints
  • Outbound HTTP requests are allowed without strict egress filtering
  • URL safety checks are performed only on the initial request, not on redirects

Exploit preconditions

  • Attack surface: Publicly exposed chat completions endpoint that accepts image_url parameters
  • Required access: Network reachability to the API server; no authentication is required
  • Trigger point: Submission of a crafted POST request where image_url points to an attacker-controlled host that responds with an HTTP 302/3xx redirect
  • Why exploitation is possible: The server follows redirects from the attacker-controlled URL to internal addresses (e.g., loopback, metadata endpoints) without re-applying URL validation or safety checks on each redirect hop

Why this happens

The underlying bug aligns with CWE-918: Server-Side Request Forgery.

The application performs outgoing HTTP requests based on user-provided URLs, performing an initial safety validation but then automatically following HTTP redirects without re-validating the redirected target.

This pattern effectively turns the server into an HTTP proxy into its own network environment, allowing untrusted input (image_url plus redirect behavior) to control where the server connects internally.

The absence of strict network boundary checks and per-hop URL validation enables access to resources that should be unreachable from external clients.

Potential impact

  • Unauthorized access to cloud instance metadata services, which may yield credentials or sensitive configuration
  • Enumeration and probing of internal HTTP services and management endpoints
  • Potential credential theft or token exfiltration from metadata or internal APIs
  • Use of the server as a stepping stone for further attacks against internal infrastructure
  • Exposure of internal service responses and configuration details to external attackers

General mitigation guidance

Mitigation typically focuses on reducing trust in user-supplied URLs and constraining the server's network reach.

Effective patterns include:

  • Enforcing strict allowlists or blocklists for outbound HTTP destinations, explicitly excluding loopback, RFC1918 ranges, link-local and metadata service IPs/hostnames
  • Re-validating every redirect target during HTTP request handling, applying the same safety guard to each hop or disallowing redirects entirely for user-controlled URLs
  • Decoupling image or resource fetching from the core API by using dedicated, locked-down fetcher services with narrow egress policies
  • Applying least-privilege networking: limit outbound access to only required external domains and block internal address ranges at the network layer
  • Avoiding implicit proxy behavior where server-side requests mirror arbitrary client-supplied URLs

How teams detect issues like this

Detection can combine code-level and operational techniques:

  • Static analysis or manual code review to identify patterns where user-supplied URLs are fetched server-side, especially when redirect following is enabled without per-hop validation
  • Review of HTTP client configuration for permissive redirect handling and absence of IP/hostname filtering logic
  • Logging and monitoring of outbound HTTP requests from the API server, alerting on connections to internal IP ranges or known metadata endpoints
  • Policy-based checks in CI/CD pipelines that flag new or modified code performing server-side URL fetches without explicit SSRF safeguards
  • Periodic penetration testing and SSRF-focused security assessments targeting image_url and similar parameters that trigger remote fetches

Sources

SourceLink
github.comgithub.com/InternLM/lmdeploy/commit/03c313006d17cc3feae86b633c44206a997c44db
github.comgithub.com/InternLM/lmdeploy/issues/4761
github.comgithub.com/InternLM/lmdeploy/pull/4734
vulncheck.comvulncheck.com/advisories/lmdeploy-server-side-request-forgery-via-http-redirect-bypass

Frequently asked

questions

Yes. An attacker with network access to the lmdeploy API server can exploit this issue remotely by sending crafted requests, even without authentication.

Only the ability to reach the exposed chat completions endpoint is required. The attack is performed via normal API requests that include a malicious image_url and rely on redirect behavior.

The most robust pattern is to treat all user-supplied URLs as untrusted and enforce strict outbound network policies combined with comprehensive URL validation on every redirect hop, or to disable redirect following entirely for user-controlled URLs.

Future designs should avoid directly fetching resources from arbitrary client-provided URLs, isolate any necessary fetch logic in tightly constrained services, apply allowlists and IP range checks, and include SSRF-specific checks in code review and automated security testing processes.

Find out what's already
exploitable in your codebase.