Server-Side Template Injection in Thymeleaf expression execution
CVE-2026-40478 is a security bypass vulnerability in Thymeleaf affecting 3.1.3.RELEASE and earlier. The flaw is in Thymeleaf’s expression execution protections for Spring Expression Language (SpEL): specific syntax patterns are not properly neutralized, allowing attacker-controlled input to bypass intended expression-injection defenses and trigger unauthorized expression evaluation. Supporting content indicates two contributing weaknesses in vulnerable versions: a parsing mismatch where Thymeleaf checked for the token sequence "new " using a literal ASCII space while SpEL accepts other whitespace such as tabs or newlines, and incomplete type restrictions that did not block dangerous non-java.* classes, including Spring classes such as org.springframework.core.io.FileSystemResource. In affected applications, if unvalidated user input is incorporated into Thymeleaf expression text, view names, fragment selectors, or similar parsed channels, an unauthenticated remote attacker can achieve server-side template injection (SSTI). The issue is fixed in Thymeleaf 3.1.4.RELEASE.
Are you exposed to this one?
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
Impact, mitigation & remediation
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
No public exploits tracked yet. Mallory keeps watching.
No public exploit code observed for this vulnerability.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
Recent activity
11 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A specific Thymeleaf template injection vulnerability discussed in the referenced post/article; the content suggests its impact depends on deployment or usage conditions.
A security bypass vulnerability in Thymeleaf's expression execution mechanisms that can allow unauthenticated remote attackers to achieve server-side template injection (SSTI) when unvalidated user input is passed directly to the template engine.
A critical server-side template injection vulnerability in Thymeleaf 3.1.3 and earlier that allows bypass of built-in protections via whitespace parsing and incomplete type blocklisting, enabling arbitrary expression execution, file writes, and potential remote code execution in Spring-based applications.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.