/

CVE-2026-85740

Severity:

HIGH RISK

(7.1)

SSRF (CWE-918) in LightRAG Markdown Image URL Parser

CVE-2026-85740

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Internal Resource Access and Data Exposure

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

LightRAG can be vulnerable to server-side request forgery when an uploaded Markdown or textpack document contains an external image URL using certain IPv6 transition forms. On deployments with compatible NAT64 or DNS64 routing, an attacker may cause the server to fetch loopback, private-network, or cloud metadata resources and ingest their responses.

Affected context

The issue occurs in LightRAG deployments that process user-uploaded Markdown or textpack documents and download referenced external images. It is relevant when address validation does not consistently identify IPv4 addresses embedded in IPv6 transition wrappers, and when the deployment network can route those wrappers through NAT64 or DNS64. The affected behavior is associated with versions before the parser's address-validation fix.

Exploit preconditions

  • Attack surface: Markdown or textpack document upload and external image retrieval
  • Required access: Ability to submit or cause processing of a document containing an image URL
  • Trigger point: URL validation followed by image download during document ingestion
  • Network condition: Compatible NAT64 or DNS64 routing must allow the wrapped address to reach an internal destination
  • Why exploitation is possible: Address validation may treat the IPv6 wrapper as globally reachable without consistently evaluating the embedded IPv4 address

Why this happens

The root cause is incomplete validation of IPv6 transition addresses before making server-side requests. The parser evaluates the literal resolved address with a global-address check, but some wrappers can encode loopback, private, or metadata-service IPv4 destinations. When the wrapper is accepted by the download guard, the server becomes an unintended proxy to internal resources. This behavior maps to CWE-918, where attacker-influenced URLs cause a server to initiate requests to restricted destinations.

Potential impact

  • An attacker may read responses from loopback or private-network services
  • The application could expose cloud instance metadata or temporary credentials
  • Retrieved internal content may be ingested into the retrieval corpus
  • Internal service information could support further compromise or lateral movement
  • Resource consumption may increase if the server is used to make repeated internal requests

General mitigation guidance

Mitigation typically focuses on validating the final network destination rather

than trusting the apparent URL representation.

Common defensive patterns include:

  • Resolve and classify all supported IPv4, IPv6, and transition-wrapper forms consistently
  • Reject loopback, link-local, private, reserved, multicast, and cloud-metadata destinations
  • Apply egress allowlists or isolated fetcher services for externally referenced content
  • Revalidate destinations after resolution and account for DNS rebinding and redirect behavior
  • Separate document retrieval from sensitive network zones and use least-privilege network policies
  • Prefer disabling remote image fetching when it is not required
  • Limit downloaded content, response size, redirects, and request time

How teams detect issues like this

Organizations commonly detect SSRF risks through:

  • Static analysis rules for user-controlled URLs passed to HTTP clients
  • Code review checks covering URL parsing, DNS resolution, redirects, and IPv4-in-IPv6 representations
  • Tests for loopback, private, link-local, metadata, NAT64, 6to4, and IPv4-compatible address forms
  • Egress firewall and proxy policies that deny application access to internal address ranges
  • Runtime monitoring for document-ingestion processes contacting internal hosts or metadata endpoints
  • Automated security review tools that flag missing destination validation and unrestricted outbound requests

Sources

SourceLink
github.comgithub.com/HKUDS/LightRAG/commit/9207e7fd10cf6df3cf26e3dd1921490b34a2f132
github.comgithub.com/HKUDS/LightRAG/commit/a25862177a9b00e0edb870778a42b4155924de09
github.comgithub.com/HKUDS/LightRAG/commit/c598545aa0084a427bcb19a84ade5e0ec31fa673
github.comgithub.com/HKUDS/LightRAG/pull/3426
github.comgithub.com/HKUDS/LightRAG/releases/tag/v1.5.5
github.comgithub.com/HKUDS/LightRAG/security/advisories/GHSA-vv3m-f8x4-7377

Frequently asked

questions

Potentially. An attacker generally needs the ability to upload or otherwise cause

LightRAG to process a Markdown or textpack document containing a crafted image URL.

Successful internal access also depends on the deployment's NAT64 or DNS64 routing.

No. The vulnerable server performs the request on the attacker's behalf, although

network reachability, filtering, and authentication on the target service can

limit what is accessible.

Apply complete destination validation across IPv4, IPv6, and documented transition

mechanisms, then enforce outbound network allowlists and block sensitive address

ranges independently at the network layer.

Treat all uploaded-document URLs as untrusted, test every supported address

representation, restrict redirects and DNS resolution behavior, and isolate

content fetchers from internal services and cloud metadata endpoints.

Find out what's already
exploitable in your codebase.