CVE-2026-40477
Published: 17 April 2026
Summary
CVE-2026-40477 is a critical-severity Expression Language Injection (CWE-917) vulnerability in Thymeleaf Thymeleaf. Its CVSS base score is 9.0 (Critical).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked at the 46.5th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-10 (Information Input Validation) and SI-2 (Flaw Remediation).
Deeper analysis
CVE-2026-40477 is a security bypass vulnerability in the expression execution mechanisms of Thymeleaf, a server-side Java template engine used in web and standalone environments. It affects versions 3.1.3.RELEASE and prior. Although Thymeleaf provides mechanisms to prevent expression injection, it fails to properly restrict the scope of accessible objects, allowing potentially sensitive objects to be reached from within a template. Published on 2026-04-17, the vulnerability carries a CVSS v3.1 base score of 9.0 (AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H) and maps to CWE-917 (Expression/Command Injection with Improper Escaping) and CWE-1336 (Improper Neutralization of Special Elements).
An unauthenticated remote attacker can exploit this vulnerability if an application developer passes unvalidated user input directly to the Thymeleaf template engine. By injecting crafted expressions, the attacker bypasses the library's protections to achieve Server-Side Template Injection (SSTI), potentially leading to high-impact confidentiality, integrity, and availability compromises across a changed scope.
The vulnerability has been fixed in Thymeleaf version 3.1.4.RELEASE. Additional details are available in the GitHub security advisory at https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr.
OWASP Top 10 for Web (2025)
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-23571
Vulnerability details
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…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
CVE enables Server-Side Template Injection (SSTI) in a public-facing web application component (Thymeleaf), directly mapping to T1221 (Template Injection) and T1190 (Exploit Public-Facing Application).
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly mitigates CVE-2026-40477 by requiring timely patching of Thymeleaf to version 3.1.4.RELEASE, which fixes the failure to restrict scope of accessible objects.
Prevents SSTI exploitation by validating and sanitizing unvalidated user input before it is passed directly to the Thymeleaf template engine.
Enforces logical access controls to limit reachability of sensitive objects from within injected Thymeleaf expressions, mitigating the security bypass.