thymeleaf: Improper Neutralization of Special Elements used in an Expression Language Statement
CVE-2026-40477 is a critical-severity improper neutralization of special elements used in an expression language statement vulnerability in thymeleaf, with a CVSS 3.1 base score of 9.0 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected thymeleaf versions: < 3.1.4.RELEASE. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.87% chance of exploitation within 30 days, higher than 59% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Check which version of thymeleaf you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Thymeleaf | thymeleaf | < 3.1.4.RELEASE | Not stated |
| Thymeleaf | org.thymeleaf:thymeleaf-spring5 | < 3.1.4.RELEASE | Not stated |
| Thymeleaf | org.thymeleaf:thymeleaf-spring6 | < 3.1.4.RELEASE | Not stated |
| Red Hat | Red Hat OpenShift Dev Spaces 3.28 | Not specified in the record | Not stated |
| Red Hat | Red Hat build of Apache Camel for Spring Boot 4 | Not specified in the record | Not stated |
| Red Hat | Red Hat Fuse 7 | Not specified in the record | Not stated |
| Red Hat | Red Hat JBoss Enterprise Application Platform 7 | Not specified in the record | Not stated |
| Red Hat | Red Hat JBoss Enterprise Application Platform 8 | Not specified in the record | Not stated |
| Red Hat | Red Hat JBoss Enterprise Application Platform Expansion Pack | Not specified in the record | Not stated |
| Red Hat | Red Hat Single Sign-On 7 | Not specified in the record | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- HighSuccess depends on conditions outside the attacker's control.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- ChangedThe attack can reach beyond the vulnerable component into other systems.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H. Scored by CNA (github.com).
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.0 | Critical | CNA (github.com) |
| CVSS 3.1 | 8.5 | High | CNA |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Neutralization of Special Elements used in an Expression Language Statement
The product constructs all or part of an expression language (EL) statement in a framework such as a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.
How developers prevent this class of flaw
- Avoid adding user-controlled data into an expression interpreter when possible.
- If user-controlled data must be added to an expression interpreter, one or more of the following should be performed: Validate that the user input will not evaluate as an expression Encode the user input in a way that ensures it is not evaluated as an expression
- The framework or tooling might allow the developer to disable or deactivate the processing of EL expressions, such as setting the isELIgnored attribute for a JSP page to true.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Other references
Other vulnerabilities in thymeleaf
- 9.0 Critical severity
- 9.0 Critical severity
- 7.5 High severity
Recent Improper Neutralization of Special Elements used in an Expression Language Statement vulnerabilities
- 9.8 Critical severity
- 8.6 High severity
- 9.8 Critical severity
- 8.8 High severity
- 7.5 High severity
- 9.0 Critical severity
Spotted an error? Tell us.