CVE-2026-40478 Details
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 the expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly neutralize specific syntax patterns that allow for the execution of unauthorized expressions. 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.
A security bypass vulnerability has been identified in Thymeleaf, a Java template engine, in versions through 3.1.3.RELEASE. This vulnerability arises from improper neutralization of certain syntax patterns in the expression execution mechanisms, allowing for unauthorized expressions to be executed. Although Thymeleaf provides safeguards against expression injection, these protections can be bypassed if application developers pass unvalidated user input directly to the template engine. This creates an opportunity for unauthenticated remote attackers to exploit the vulnerability, leading to Server-Side Template Injection (SSTI).
Users are advised to upgrade to Thymeleaf version 3.1.4.RELEASE or later. For applications using Thymeleaf with Spring, the same version upgrade applies to the 'thymeleaf-spring5' and 'thymeleaf-spring6' packages.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 21, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://access.redhat.com/errata/RHSA-2026:21772 | redhat-SADP | |
| https://access.redhat.com/security/cve/CVE-2026-40478 | redhat-SADP | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2459349 | redhat-SADP | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40478.json | redhat-SADP | |
| https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-xjw8-8c5c-9r79 | [email protected] | Vendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1336 | Improper Neutralization of Special Elements Used in a Template Engine | [email protected] |
| CWE-917 | Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') | redhat-SADP |
| CWE-917 | Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| thymeleaf thymeleaf | < 3.1.4 |
CPE
Remediation
| |
Change History
8 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 18, 2026 | CVE Modified | redhat-SADP |
| Aug 4, 2026 | CVE Modified | redhat-SADP |
| Jul 15, 2026 | CVE Modified | redhat-SADP |
| Jun 30, 2026 | CVE Modified | redhat-SADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Apr 24, 2026 | Initial Analysis | [email protected] |
| Apr 17, 2026 | New CVE Received | [email protected] |