Description
Thymeleaf is a server-side Java template engine for web and standalone environments. Versions 3.1.3.RELEASE and prior contain a security bypass vulnerability in the expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly restrict the scope of accessible objects, allowing specific potentially sensitive objects to be reached from within a template. If an application developer passes unvalidated user input directly to the template engine, an unauthenticated remote attacker can bypass the library's protections to achieve Server-Side Template Injection (SSTI). This issue has ben fixed in version 3.1.4.RELEASE.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| thymeleaf | thymeleaf | < 3.1.4.RELEASE | — |
| thymeleaf | org.thymeleaf:thymeleaf-spring5 | < 3.1.4.RELEASE | — |
| thymeleaf | org.thymeleaf:thymeleaf-spring6 | < 3.1.4.RELEASE | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 1 repository
-
xiaoqiMikko/thymeleaf-check ★ 0 · Sep 4, 2026
Offline checker for Thymeleaf CVE-2026-40477 / CVE-2026-41901 — tells you which of the two CVSS 9.0 SSTI flaws you are exposed to, and whether your version line has a fix at all (3.0.x: it does not)
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Maven | org.thymeleaf:thymeleaf | < 3.1.4.RELEASE | 3.1.4.RELEASE | GHSA-r4v4-5mwr-2fwr |
| Maven | org.thymeleaf:thymeleaf-spring5 | < 3.1.4.RELEASE | 3.1.4.RELEASE | GHSA-r4v4-5mwr-2fwr |
| Maven | org.thymeleaf:thymeleaf-spring6 | < 3.1.4.RELEASE | 3.1.4.RELEASE | GHSA-r4v4-5mwr-2fwr |