Server Side Templates Injections
Summary
Tools
Methodology

ASP.NET Razor
ASP.NET Razor - Basic injection
ASP.NET Razor - Command execution
Expression Language EL
Expression Language EL - Basic injection
Expression Language EL - One-Liner injections not including code execution
Expression Language EL - Code Execution
Freemarker
Freemarker - Basic injection
Freemarker - Read File
Freemarker - Code execution
Freemarker - Sandbox bypass
Groovy
Groovy - Basic injection
Groovy - Read and create File
Groovy - HTTP request:
Groovy - Command Execution
Groovy - Sandbox Bypass
Handlebars
Handlebars - Command Execution
Jade / Codepen
Java
Java - Basic injection
Java - Retrieve the system’s environment variables
Java - Retrieve /etc/passwd
Jinja2
Jinja2 - Basic injection
Jinja2 - Template format
Jinja2 - Debug Statement
Jinja2 - Dump all used classes
Jinja2 - Dump all config variables
Jinja2 - Read remote file
Jinja2 - Write into remote file
Jinja2 - Remote Code Execution
Exploit the SSTI by calling os.popen().read()
Exploit the SSTI by calling subprocess.Popen
Exploit the SSTI by calling Popen without guessing the offset
Exploit the SSTI by writing an evil config file.
Jinja2 - Filter bypass
Jinjava
Jinjava - Basic injection
Jinjava - Command execution
Lessjs
Lessjs - SSRF / LFI
Lessjs < v3 - Command Execution
Plugins
Mako
Direct access to os from TemplateNamespace:
Pebble
Pebble - Basic injection
Pebble - Code execution
Ruby
Ruby - Basic injections
Ruby - Retrieve /etc/passwd
Ruby - List files and directories
Ruby - Code execution
Smarty
Twig
Twig - Basic injection
Twig - Template format
Twig - Arbitrary File Reading
Twig - Code execution
Velocity
References
Last updated