SSTI
PRACTICE ! PRACTICE ! PRACTICE !
Now that we've exploited the application, let's see what was actually happening in the backend
So how do we mitigate this now ?
Secure methods
Most template engines will have a feature that allows you to pass input in as data, rather that concatenating input into the template
In Jinja2, this can be done by using the second argument
Sanitisation
User Input cannot be trusted and is very dangerous, every place in your application where a user is allowed to add custom content, make sure the input is sanitised !
This can be done by first planning what character set you want to allow, and adding these to a whitelist, basically implementing Regex
Remember to read the documentation of the template engine you are using
Last updated