Server-side template injection
What is Server-Side Template Injection?
How Does It Happen?
$output = $twig->render("Dear {first_name}, ", array("first_name" => $user.first_name));$output = $twig->render("Dear " . $_GET['name']);http://vulnerable-website.com/?name={{bad-stuff-here}}Impact of SSTI
Constructing an SSTI Attack
1. Detect
How to Detect SSTI
Example: Mathematical Operation
2. Identify the Template Engine
Techniques for Identification
3. Exploit
Read
Attack
Steps to Test for SSTI
Advanced SSTI Techniques
1. SSTI in Plaintext Context
2. SSTI in Code Context
3. Error-Based SSTI
Mitigations for SSTI
Last updated