SSTI
Server-Side Template Injection.
Last updated
Server-Side Template Injection.
Last updated
Template Engines are software tools used to generate dynamic output. There is a template, which is a predefined document that contains a static structure, but also includes placeholders, markers, and variables that will be replaced with dynamic data during the generation of the final output. So during the rendering process there is interpretation of the template, dynamic insertion of the specified elements, and generation of the final output. Each Template Engine defines placeholders etc. differently.
./tplmap.py -u '<URL>?param=value'
(GET)
./tplmap.py -u '<URL>' -d "param=value"
(POST)
Also look for errors on the Internet, or extensions.
See Navigating Python Objects.
Where INDEX was taken from (example in tornado template engine)
Two payloads that can be used if request
and lipsum
are present (ex. in Jinja2)
In Handlebars (JavaScript)
If the require
function is outside the scope of the application we are attacking, we need to find a function we can access. These are called global variables.
In ERB