Summary
A server-side request forgery vulnerability in Unstructured allows attacker-controlled URLs supplied to document partitioning functions to make the ingestion service send requests to unintended destinations.
Depending on network placement and permissions, an attacker may disclose internal responses, access cloud metadata services, or trigger side-effecting HTTP endpoints through direct requests, redirects, or DNS rebinding.
Affected context
The issue occurs in Unstructured deployments that expose or otherwise accept attacker-controlled values for the url argument of partition, partition_html, or partition_md. Risk is higher when the ingestion process can reach loopback interfaces, private network services, cloud metadata endpoints, or internal administrative APIs, and when fetched response bodies are returned as document elements.
Exploit preconditions
- Attack surface: Server-side document ingestion and URL-based partitioning
- Required access: Ability to supply or influence the
urlargument - Trigger point: URL retrieval during partitioning of web, HTML, or Markdown content
- Network condition: The ingestion service must be able to connect to the targeted internal or external destination
- Why exploitation is possible: Destination validation does not reliably prevent private, loopback, metadata, redirect-based, or DNS-rebinding targets, and fetched response content may be exposed to the requester
Why this happens
The vulnerability results from treating a user-controlled URL as a trusted outbound request destination without enforcing a robust destination policy.
This maps primarily to CWE-918: Server-Side Request Forgery, because the server performs network requests chosen by an attacker. The related CWE-601: URL Redirection to Untrusted Site is relevant where redirects allow an initially permitted URL to lead to a restricted destination. The insecure pattern includes insufficient host and address validation, incomplete redirect controls, and failure to re-evaluate DNS results during connection establishment.
Potential impact
- An attacker may read responses from loopback or private network services
- Cloud instance metadata or temporary credentials could be disclosed
- Internal administrative or monitoring endpoints could be reached
- Sensitive response bodies may be returned through parsed document elements
- Side-effecting GET endpoints could be triggered
- Internal network reconnaissance or follow-on compromise could become possible
General mitigation guidance
Mitigation generally focuses on making outbound fetching deny-by-default and reducing trust in user-provided destinations.
Common defensive patterns include:
- Permit only explicitly approved URL schemes, hosts, ports, and network destinations
- Resolve hostnames and reject loopback, link-local, private, multicast, and reserved addresses
- Re-check resolved addresses at connection time to reduce DNS-rebinding risk
- Disable or tightly control redirects, validating every redirect destination
- Isolate fetchers in restricted network segments with no access to metadata services or sensitive internal systems
- Apply outbound firewall and egress policies as an independent security boundary
- Limit response size, request duration, and returned content exposure
- Run ingestion workers with minimal network permissions and service privileges
How teams detect issues like this
Organizations can detect SSRF risks through:
- Static analysis rules for server-side HTTP clients receiving user-controlled URLs
- Code review checks for missing scheme, host, port, and IP-range validation
- Tests covering redirects, alternate IP representations, DNS changes, and private address targets
- Network monitoring for ingestion workers contacting loopback, private ranges, metadata addresses, or unexpected ports
- Egress policies that alert on or block unauthorized destinations
- Automated security review tools that identify untrusted URL flows and incomplete redirect handling

