# XXE to SSRF and Cloud Metadata
> Repurposing an XML parser's entity resolver as a server-side request engine — reaching internal services, scanning ports, and lifting cloud instance-role credentials.
## How it works
Any external entity whose URI uses a network scheme turns the parser into an SSRF primitive: the server, not the browser, issues the request ([[raw/portswigger.net/what-is-xxe-xml-external-entity-injection-tutorial-examples-web-securi-460|What is XXE injection?]]). This is the pivot that takes XXE from "read a local file" to "reach things not exposed to the internet." Where the parser can't declare a DOCTYPE, [[XInclude Attacks]] with an `http://` `href` give the same request primitive.
Primary targets:
- **Internal web/admin apps** and APIs unreachable from outside.
- **Cloud instance metadata** — `http://169.254.169.254/` for AWS IAM role credentials, GCP/Azure equivalents, and container metadata on link-local addresses.
- **Port/host enumeration** via timing or error differentials ([[raw/blog.zsec.uk/hunting-in-the-dark-blind-xxe-442|Hunting in the Dark - Blind XXE]]).
Relationship to the SSRF corpus: the escalation ladder and defenses are the same as [[Server-Side Request Forgery]]; the metadata specifics live in [[Cloud Metadata Service Exploitation]] and [[Local File Read via SSRF]]. XXE's distinctive constraints are the parser's limited scheme/method support (usually GET-only over HTTP) and URL-character validation that mangles multi-line responses.
## Reaching cloud credentials
The canonical chain: redirect an entity from a `file://` path to `http://169.254.169.254/latest/meta-data/...`, then walk the metadata tree by appending path segments reflected in responses or errors, ending at `iam/security-credentials/<role>` to lift temporary IAM credentials and inherit the instance role's privileges ([[raw/medium.com/exploiting-xxe-for-ssrf-retrieving-iam-credentials-of-ec2-by-gupta-ble-1501|XXE for SSRF: EC2 IAM Credentials]], [[raw/yusufalmahmeed.com/exploiting-xxe-to-perform-ssrf-12458|Exploiting XXE to Perform SSRF]]). Because the HTTP entity is typically **GET-only**, this works against IMDSv1 but not an IMDSv2-enforced host, which requires a PUT + token header the plain entity can't send — see [[IMDSv2]] for which SSRF primitives satisfy the token flow. The blind variant feeds the metadata response out-of-band ([[Blind XXE]], [[XXE to SSRF and Cloud Metadata]] via error channel in [[Error-Based XXE]]).
## Beyond HTTP: raw-protocol reach
HTTP entities only speak GET, which blocks services with their own wire protocols. **`gopher://`** (old Java) and **FTP** let an XXE write arbitrary bytes to a TCP socket — the route to Redis, Memcached and SMTP. One researcher reached an unauthenticated internal Redis on `6379` over `gopher://`, ran `INFO`/`SCAN` without `AUTH`, and dumped session data — escalating a $1,000 file-read into a $10,000 critical ([[raw/medium.com/from-1-000-to-10-000-how-i-turned-a-limited-xxe-into-a-critical-redis-14498|Limited XXE to Critical Redis]]). The Perl/LWP Gopher handler's read-to-EOF behavior vs Redis keeping the socket open was the subtle timing clue there.
## Internal pivoting past egress filters
When the parsing host itself can't egress, route through an internal app that can. Honoki proxied OOB fetches through an internal Confluence `makeRequest`/`consumerUri` gadget to bypass the parser's firewall, then used Java's URL-scheme quirks (directory listing on a path) to confirm read-as-root ([[raw/honoki.net/from-blind-xxe-to-root-level-file-read-access-honoki-461|Blind XXE to Root-Level File Read]]).
## Notable cases
- **CVE-2026-20320 Cisco BroadWorks** — unauth XXE used in "Operation Snowball" to exfiltrate the system-identity private key, enabling lateral movement ([[raw/threatseye.io/cisa-kev-cisco-broadworks-xxe-and-openwave-flaws-exploited-14359|CISA KEV Cisco BroadWorks]]).
- **openEQUELLA (CVE-2026-66089 / SOAP)** — authenticated XXE reaching arbitrary files and internal HTTP resources, including cloud metadata, via REST/SOAP ([[raw/github.com/openequella-xxe-in-metadata-field-allows-arbitrary-file-read-12459|openEQUELLA Metadata-Field XXE]]).
- **IBM Business Automation Workflow (CVE-2025-13096)** — classified under CWE-918 (SSRF), the parser issues server-side requests ([[raw/ibm.com/ibm-business-automation-workflow-xxe-cve-2025-13096-4622|IBM BAW XXE/SSRF]]).
- **ArubaOS 8.13.2** — pre-auth XXE → OOB SSRF proxying probes to internal services; notable as a disputed report (closed "theoretical" despite packet captures and internal port-scan results) ([[raw/netacoding.com/pre-auth-xxe-http-ssrf-on-arubaos-8-13-2-closed-as-theoretical-no-vali-8940|Pre-auth XXE → SSRF on ArubaOS]]).
## Related
- [[XML External Entity Injection]]
- [[Server-Side Request Forgery]]
- [[Cloud Metadata Service Exploitation]]
- [[Local File Read via SSRF]]
- [[IMDSv2]]
- [[Blind XXE]]
- [[Gopher Protocol SSRF]]
## Sources
- [[raw/medium.com/exploiting-xxe-for-ssrf-retrieving-iam-credentials-of-ec2-by-gupta-ble-1501|Exploiting XXE for SSRF: EC2 IAM Credentials]]
- [[raw/yusufalmahmeed.com/exploiting-xxe-to-perform-ssrf-12458|Exploiting XXE to Perform SSRF]]
- [[raw/infosecwriteups.com/exploiting-xxe-to-perform-ssrf-attacks-a-step-by-step-walkthrough-15190|Exploiting XXE to Perform SSRF (walkthrough)]]
- [[raw/medium.com/from-1-000-to-10-000-how-i-turned-a-limited-xxe-into-a-critical-redis-14498|From $1,000 to $10,000: Limited XXE to Critical Redis]]
- [[raw/honoki.net/from-blind-xxe-to-root-level-file-read-access-honoki-461|From Blind XXE to Root-Level File Read]]
- [[raw/threatseye.io/cisa-kev-cisco-broadworks-xxe-and-openwave-flaws-exploited-14359|CISA KEV: Cisco BroadWorks XXE]]
- [[raw/github.com/openequella-xxe-in-metadata-field-allows-arbitrary-file-read-12459|openEQUELLA XXE in Metadata Field]]
- [[raw/ibm.com/ibm-business-automation-workflow-xxe-cve-2025-13096-4622|IBM Business Automation Workflow XXE]]
- [[raw/netacoding.com/pre-auth-xxe-http-ssrf-on-arubaos-8-13-2-closed-as-theoretical-no-vali-8940|Pre-auth XXE → SSRF on ArubaOS 8.13.2]]
- [[raw/blog.zsec.uk/hunting-in-the-dark-blind-xxe-442|Hunting in the Dark - Blind XXE]]