Tips

Server-side template injection (SSTI) tips

Server-side template injection happens when input becomes part of a template instead of a value in it, so the template engine evaluates it. It often leads to remote code execution.

Published tips, newest first. Payloads and commands are shown as plain text.

Server-side template injection (SSTI): how to hunt it

Where to look

  • Fields shown back in emails, PDFs, notifications and previews rendered from templates.
  • Probes such as {{7*7}}, ${7*7} and <%= 7*7 %> that come back as 49 in the server’s response, not from a client-side framework.
  • Error messages that name the template engine, which decide the next payload.
  • Templates customers can edit in admin or theme settings.

What proves it

Show the engine evaluating an expression you supplied and, where the program allows it, a harmless command; name the engine and where the input was placed.

Read further

Writeups on Server-side template injection (SSTI), by hunters and researchers, most with a short summary.

Related classes