CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
239 CVEs have CWE-1336 as their primary weakness. 3 of them are in the CISA KEV catalog. The highest EPSS score among them is 99.539%.
The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.
In some cases, XSS-style attacks can work, which can obscure the root cause if the developer does not closely investigate the root cause of the error. Template engines can be used on the server or client, so both sides could be affected by injection. The mechanisms of attack or the affected technologies might be different, but the mistake is fundamentally the same.
Child of CWE-94: Improper Control of Generation of Code
Mitigations
- Architecture and Design: Choose a template engine that offers a sandbox or restricted mode, or at least limits the power of any available expressions, function calls, or commands.
- Implementation: Use the template engine's sandbox or restricted mode, if available.
Observed examples
- CVE-2024-34359: Chain: Python bindings for LLM library do not use a sandboxed environment when parsing a template and constructing a prompt, allowing jinja2 Server Side Template Injection and code execution - one variant of a prompt injection attack.
- CVE-2017-16783: server-side template injection in content management server
- CVE-2020-9437: authentication / identity management product has client-side template injection
- CVE-2020-12790: Server-Side Template Injection using a Twig template
- CVE-2021-21244: devops platform allows SSTI
- CVE-2020-4027: bypass of Server-Side Template Injection protection mechanism with macros in Velocity templates
- CVE-2020-26282: web browser proxy server allows Java EL expressions from Server-Side Template Injection
- CVE-2020-1961: SSTI involving mail templates and JEXL expressions
- CVE-2019-19999: product does not use a safe setting for a FreeMarker configuration, allowing SSTI
- CVE-2018-20465: product allows read of sensitive database username/password variables using server-side template injection
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2024-4040 | 2024-04-22 | CRITICAL | 9.8 | 99.539% | A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms allows unauthenticated remote attackers to… |
| CVE-2024-23692 | 2024-05-31 | CRITICAL | 9.8 | 99.485% | Rejetto HTTP File Server, up to and including version 2.3m, is vulnerable to a template injection vulnerability. This vulnerability allows a remote… |
| CVE-2026-75650 | 2026-09-07 | CRITICAL | 10.0 | 99.376% | Adobe Commerce is affected by an Improper Neutralization of Special Elements Used in a Template Engine vulnerability that could result in arbitrary code… |
| CVE-2026-111559 | 2026-11-16 | CRITICAL | 9.3 | 0.939% | Batflat CMS does not sanitize data passed to the /contact endpoint. A remote unauthenticated attacker can send a POST request with a crafted message, causing… |
| CVE-2026-21596 | 2026-11-17 | HIGH | 7.7 | not scored | This High severity SSTI (Server-side Template Injection) vulnerability known as CVE-2026-21596 was introduced in version 12.0.0, 12.1.0. This SSTI (Server-side… |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-1336'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-1336'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).