CVE-2026-40477: Improper restriction of the scope of accessible objects in Thymeleaf expressions
Vulnerability summary
CVE-2026-40477 is a critical (CVSS 9.1) vulnerability in Thymeleaf. It is known to be exploited: ENISA lists it, first on 10-10-2026. EPSS estimates a 0.87% chance of exploitation in the next 30 days, higher than 59.5% of scored vulnerabilities.
Listed as exploited by ENISA (10-10-2026)
Source freshness unavailable
How is this decided?Timeline
- 17-04-2026PublishedVulnerability first disclosed.
- 17-08-2026Last modifiedVulnerability information updated.
- 10-10-2026Added to ENISA KEVExploitedAdded to the ENISA known exploited vulnerabilities catalog.
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.
CVSS metrics
3 scores · 3 sources · 1 version- OSV · MavenEcosystem advisory · calculated9.0CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:HDiffers
- NVDNIST9.0CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:HDiffers
EPSS trend
Probability
0.87%
Chance of exploitation in the next 30 days
Percentile
60%
Versus all other CVEs
30-day change
Decrease -0.08 pp
From 0.94% on 22-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
- Added
- 10-10-2026
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-917Improper Neutralization of Special Elements used in an Expression Language StatementThe 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.
- CWE-1336Improper Neutralization of Special Elements Used in a Template EngineThe product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Org.thymeleaf3 products
- thymeleaf< 3.1.4.RELEASE
- thymeleaf-spring5< 3.1.4.RELEASE
- thymeleaf-spring6< 3.1.4.RELEASE
Thymeleaf3 products
- org.thymeleaf:thymeleaf-spring5< 3.1.4.RELEASE
- org.thymeleaf:thymeleaf-spring6< 3.1.4.RELEASE
- thymeleaf< 3.1.4.RELEASE | < 3.1.4
2 vendors · 6 products
References
7 links- github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwrX Refsource CONFIRMWEBVendor Advisory