Course contentsShow
← Security
Lesson 621 of 3,05213. Web Security - Injection AttacksFree lesson

XXE Attack Types: SSRF via XXE

Discover how XXE enables Server-Side Request Forgery to scan internal networks and access internal services.

XXE Attack Types: SSRF via XXE

You'll learn how attackers exploit XXE vulnerabilities to make the server perform requests to internal systems, turning XML parsing into a network scanner.

What Is SSRF via XXE?

Server-Side Request Forgery (SSRF) via XXE occurs when an attacker uses XML External Entity processing to force the vulnerable server to make HTTP requests to internal or external resources. Instead of just reading local files (which you learned in the previous lesson), the attacker leverages the server's network position to probe systems that aren't directly accessible from the internet.

Think of it like this: You hand a librarian (the server) a special request form (malicious XML). The librarian, following protocol, contacts an internal department you can't reach directly, then reports back what they found. You've just used the librarian's access privileges to explore restricted areas.

How It Works

An attacker crafts an XML payload that defines an external entity pointing to an internal URL:

<?xml version="1.0"?>
<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://internal-server:8080/admin">
]>
<data>&xxe;</data>

When the XML parser processes this, the server makes an HTTP request to http://internal-server:8080/admin — a system typically hidden behind the firewall. The response may be embedded in error messages or the application's output, revealing internal service information.

Attack Scenarios

  • Port scanning: Probe internal IP ranges to discover running services
  • Cloud metadata access: Retrieve AWS credentials from http://169.254.169.254/latest/meta-data/
  • Internal API exploitation: Access admin panels or management interfaces
  • Service enumeration: Identify internal infrastructure and software versions

Key Takeaway: XXE transforms XML parsing vulnerabilities into powerful SSRF attacks, allowing attackers to abuse the server's trusted network position to scan, probe, and access internal systems that should be unreachable from the outside.