Clear Byte

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

  1. Identify any opportunity to submit user input to the application. Mark down candidates of template injection for further inspection.
  2. 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.
  3. 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.
  4. Research the template engine and programming language that the target is using to construct an exploit.
  5. Try to escalate the vulnerability to arbitrary command execution.
  6. 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.txt to create a specific proof-of-concept file.

On this page