/

CVE-2026-85673

Severity:

HIGH RISK

(7.5)

SSRF (CWE-918) in LLaMA-Factory Media URL Endpoint

CVE-2026-85673

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Unauthorized access to internal network resources

Severity:

HIGH RISK

(7.5)

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

LLaMA-Factory contains a server-side request forgery vulnerability in its OpenAI-compatible API handler for multimodal media URLs. An unauthenticated attacker may bypass URL validation through redirects or DNS rebinding, potentially causing the server to request internal services or cloud metadata endpoints.

Affected context

The vulnerability occurs in deployments exposing LLaMA-Factory's OpenAI-compatible multimodal API. It becomes risky when user-controlled media URLs are fetched by the server, the initial URL is validated separately from the eventual connection, and outbound requests can reach private addresses, internal services, or cloud metadata endpoints.

Exploit preconditions

  • Attack surface: OpenAI-compatible API endpoint that accepts remote multimodal media URLs
  • Required access: No authentication may be required when the affected API is publicly reachable
  • Trigger point: Server-side retrieval of an attacker-influenced media URL
  • Why exploitation is possible: URL validation is performed before request processing, while redirects and subsequent DNS resolution can lead the request to a different, unvalidated destination

Why this happens

The underlying bug is a mismatch between URL validation and network request behavior. The application checks the initial destination with an SSRF guard, but the HTTP client may follow redirects or resolve the hostname again without applying equivalent validation to each resulting connection. This maps to CWE-918: Server-Side Request Forgery, where attacker-controlled input influences server-side requests to unintended resources.

Potential impact

  • Access to internal administrative or service endpoints
  • Retrieval of cloud instance metadata or temporary credentials
  • Exposure of sensitive response data to the attacker
  • Internal network reconnaissance
  • Potential follow-on compromise if reachable services trust the affected host

General mitigation guidance

Mitigation generally focuses on enforcing destination controls throughout the complete request lifecycle.

Common defensive patterns include:

  • Disable automatic redirect following for user-controlled media retrieval, or validate every redirect destination
  • Resolve hostnames and validate the resulting addresses before each connection
  • Reject private, loopback, link-local, reserved, and other non-public destination ranges
  • Prefer explicit outbound allowlists for required media hosts
  • Restrict server egress through network policies, proxies, and firewall controls
  • Apply authentication, authorization, and rate limits to media-fetching API paths
  • Run the service with minimal network and cloud-instance permissions

These controls reduce reliance on a single URL check and limit impact if validation is bypassed.

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis for URL validation followed by HTTP requests that permit redirects
  • Code review checks comparing validation behavior with the HTTP client's redirect and DNS-resolution behavior
  • Tests covering redirects, hostname changes, DNS rebinding conditions, and private-address resolution
  • Network monitoring for application-originated requests to loopback, private, link-local, and metadata service ranges
  • Egress policies that alert on or block unexpected internal destinations
  • Automated security review tools that identify server-side requests built from user-controlled URLs

Sources

SourceLink
github.comgithub.com/hiyouga/LlamaFactory
github.comgithub.com/hiyouga/LlamaFactory/blob/v0.9.5/src/llamafactory/api/chat.py
github.comgithub.com/hiyouga/LlamaFactory/blob/v0.9.5/src/llamafactory/api/common.py
github.comgithub.com/hiyouga/LlamaFactory/issues/10646
vulncheck.comvulncheck.com/advisories/llama-factory-ssrf-guard-bypass-via-redirect-and-dns-rebinding

Frequently asked

questions

Yes, when the affected API is reachable by an attacker and accepts unauthenticated, attacker-controlled media URLs. Exploitability still depends on deployment exposure and outbound network access.

The attacker generally needs only the ability to submit a media URL to the vulnerable API. Authentication requirements depend on how the application is deployed and configured.

Validate the final connection destination, not only the initial URL. Restrict redirects, re-check DNS results for every connection, and use an allowlist where practical.

Combine application-level destination validation with controlled egress, network segmentation, minimal service privileges, and tests for redirect and DNS-rebinding behavior.

Find out what's already
exploitable in your codebase.