xslt-injection
XSLT injection testing: processor fingerprinting, XXE and document() SSRF, EXSLT write primitives, PHP/Java/.NET extension RCE surfaces. Use when user-controlled XSLT/stylesheet input or transform endpoints are in scope.
Security Assessment
Detected risks:
About xslt-injection
A security-testing playbook for XSLT injection, used when user-controlled XSLT or stylesheet input, or transform endpoints, are in scope for authorized testing. The vulnerability arises when attacker-influenced XSLT is compiled or executed server-side, and the recommended methodology maps the processor family first, then chains the appropriate escalation per platform. Many payloads are noted as destructive, so it is framed for authorized testing only.
The workflow starts by finding sinks (parameters named xslt, stylesheet, transform, or template, plus SOAP stylesheets, report generators, and XML-to-HTML converters), probing for reflection with a harmless marker, and fingerprinting the engine via system-property reads that reveal vendors such as Xalan (Java), Saxon, libxslt, or MSXML/.NET. Escalation paths are organized by capability: external entity (XXE) injection through DTD entities; local file read via the document() function; server-side request forgery and out-of-band interaction using document() against http URLs; arbitrary file write via the EXSLT exslt:document extension; and remote code execution surfaces that depend on platform configuration, namely PHP via php:function (for example readfile, scandir, or historically preg_replace with the /e modifier), Java via Saxon/Xalan extension functions mapping to static methods like Runtime.exec, and .NET via msxsl:script script blocks.
Throughout, the guidance notes that hardened parsers and secure defaults often disable external DTDs, extensions, and script blocks, so a failed vector does not disprove others, and testers are advised to pivot between document(), XXE, SSRF, and platform-specific paths. It cross-references related skills for generic XML external entity testing and for SSRF, and includes a decision tree to route from user-influenced transforms to the most promising technique.
FAQ
When should this skill be used?
When user-controlled XSLT/stylesheet input or transform endpoints are in scope, and only for authorized testing since many payloads are destructive.
Why fingerprint the processor first?
Escalation techniques differ by engine (Java/Xalan/Saxon, libxslt, PHP, .NET/MSXML), so identifying the vendor via system-property reads determines which XXE, file, or RCE paths to try.
What can XSLT injection lead to?
Depending on the processor and configuration: information disclosure via XXE and the document() function, SSRF and out-of-band requests, arbitrary file write via EXSLT exslt:document, and remote code execution through PHP, Java, or .NET extension surfaces.
How do you find candidate sinks?
Look for parameters named xslt, stylesheet, transform, or template, plus SOAP stylesheets, report generators, and XML-to-HTML converters, then inject a harmless marker to confirm the input is executed.
Does a failed payload mean the endpoint is safe?
No. Hardened parsers commonly disable external DTDs, extensions, and script blocks, so one blocked vector does not disprove others; the guidance is to pivot to document(), XXE, SSRF, or platform-specific paths.
Install xslt-injection
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
yaklang/hack-skills