How to fix: Server-Side Template Injection (SSTI)
A form on this page was submitted with a tagged arithmetic expression written in common templating syntax, and the response contained the CALCULATED result in place of the expression. This proves the input is being parsed and evaluated as template code on the server, not rendered as inert text.
Why it matters
Server-side template injection frequently leads to full remote code execution: most templating engines expose enough of their host language through the template context that an attacker who can inject expressions can escalate to reading files, environment variables, or running arbitrary code on the server.
This is a confirmed, active finding: the scanner submitted an expression designed to be inert if treated as plain text, and observed the computed result in the live response, meaning the template engine actually evaluated it. The active-probing category that produced it is opt-in and off by default, since submitting real requests to a target is a materially different action than reading its responses.
How to fix it
- 1Never pass user input directly into a template string that is then compiled/rendered (e.g. `render_template_string(user_input)` in Flask/Jinja2, or building an ERB/ExpressionEngine template from a request field).
- 2Treat user input strictly as DATA passed into a template's variables, never as the template source itself.
- 3If a templating feature genuinely needs to be user-authored (a page builder, an email template editor), sandbox it with an engine designed for untrusted input, and keep it on a codepath separate from the main application's own templates.
- 4Re-run this scan after the fix to confirm the expression is no longer evaluated.
Code examples
Never compile a template from user input
# Bad: user input becomes the template source itself
return render_template_string(f"Hello {request.args.get('name')}")
# Good: user input is only ever a variable inside a fixed, developer-authored template
return render_template('greeting.html', name=request.args.get('name'))References
Detected automatically by VulnRadar. The check id is server-side-template-injection, stable across every scan so you can filter or diff on it.
More active probing checks
- CriticalReflected Cross-Site Scripting (XSS)
- CriticalSQL Injection (Error-Based)
- CriticalOS Command Injection
- MediumConfirmed Open Redirect
Questions
- How severe is Server-Side Template Injection (SSTI)?
- VulnRadar rates this critical severity in the active probing category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id server-side-template-injection, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Server-Side Template Injection (SSTI) map to?
- It maps to CWE-1336. In the OWASP Top 10 it falls under A03:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.