SSTI to RCE: Payloads for Jinja2, Twig, FreeMarker, Thymeleaf & Velocity

Overview 🆕 Updated September 12, 2026 — added the Thymeleaf tab-character sandbox bypass (CVE-2026-40478) and the audit question that actually determines exposure. A practitioner’s reference for Server-Side Template Injection — template engine vulnerabilities, exploitation techniques, payload development, framework-specific attacks, and defense strategies. Covers detection methodologies, engine-specific exploitation, and secure templating practices. Related guides: RCE — where a working SSTI payload usually ends up · Insecure Deserialization — the other server-side route from untrusted input to code execution · Python Security — Jinja2, Django and Flask hardening in context · XSS — what a template bug looks like when it renders in the browser instead of on the server. ...

April 10, 2026 Â· Updated October 18, 2026 Â· 19 min Â· Carl Sampson