Server-Side Template Injection in Thymeleaf by Thymeleaf
CVE-2026-40478
What is CVE-2026-40478?
Thymeleaf is a widely used server-side Java template engine that allows developers to create dynamic web pages. However, earlier versions, specifically 3.1.3.RELEASE and prior, contain a critical vulnerability that could allow unauthorized expression execution. This flaw resides in the expression execution mechanisms, where despite built-in protections against expression injection, certain syntax patterns can be exploited. If unvalidated user input is directly fed into the template engine, an attacker may perform Server-Side Template Injection (SSTI), enabling them to execute arbitrary code within the server environment. This issue has been addressed in version 3.1.4.RELEASE.
Affected Version(s)
org.thymeleaf:thymeleaf-spring5 < 3.1.4.RELEASE
org.thymeleaf:thymeleaf-spring6 < 3.1.4.RELEASE
thymeleaf < 3.1.4.RELEASE
