Template Injection (SSTI)
Template engines are a type of software used to determine the appearance of a web page. Developers often overlook attacks that target these engines, called server-side template injections (SSTIs).
Hunt for template injection
- Identify any opportunity to submit user input to the application. Mark down candidates of template injection for further inspection.
- Detect template injection by submitting test payloads. You can use either payloads that are designed to induce errors, or engine-specific payloads designed to be evaluated by the template engine.
- If you find an endpoint that is vulnerable ti template injections, determine the template engine in use. This will help you build an exploit specific to the template engine.
- Research the template engine and programming language that the target is using to construct an exploit.
- Try to escalate the vulnerability to arbitrary command execution.
- Crate a proof of concept that does not harm the targeted system.
A good way to do this is to execute
touch template_injection_by_me.txtto create a specific proof-of-concept file.