CVE-2026-40477
Published: 17 April 2026
Description
Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts.
Security Summary
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.
Details
- CWE(s)
Affected Products
MITRE ATT&CK Enterprise Techniques
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).