CVE-2026-40477
Improper restriction of the scope of accessible objects in Thymeleaf expressions
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
9.1
Improper restriction of the scope of accessible objects in Thymeleaf expressions
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.
- Record
CVE-2026-40477- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - CVSS 3.1
- 8.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-917, CWE-1336, CWE-917
- Updated
- 2026-11-02
EUVDEUVD-2026-23571
9.1
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.
- Record
EUVD-2026-23571- CVSS 3.1
- 9.1 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-r4v4-5mwr-2fwr
9.0
Improper restriction of the scope of accessible objects in Thymeleaf expressions
Impact
A security bypass vulnerability exists in the expression execution mechanisms of Thymeleaf up to and including 3.1.3.RELEASE. 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).
Patches
This has been fixed in Thymeleaf 3.1.4.RELEASE.
Workarounds
No workaround is available beyond ensuring applications do not pass unvalidated user input directly to the template engine. Upgrading to 3.1.4.RELEASE is strongly recommended in any case.
Credits
Thanks to Thomas Reburn (Praetorian) for responsible disclosure.
- Record
GHSA-r4v4-5mwr-2fwr- CVSS 3.1
- 9.0 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-917, CWE-1336
- Updated
- 2026-11-02
NVD
9.0
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.
- Record
CVE-2026-40477- CVSS 3.1
- 9.0 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - CVSS 3.1
- 8.5 High
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-917, CWE-1336
- Updated
- 2026-11-02
OSV
9.0
Improper restriction of the scope of accessible objects in Thymeleaf expressions
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.
- Record
CVE-2026-40477- CVSS 3.1
- 9.0 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-1336, CWE-917
- Updated
- 2026-11-02
OSVGHSA-r4v4-5mwr-2fwr
9.0
Improper restriction of the scope of accessible objects in Thymeleaf expressions
Impact
A security bypass vulnerability exists in the expression execution mechanisms of Thymeleaf up to and including 3.1.3.RELEASE. 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).
Patches
This has been fixed in Thymeleaf 3.1.4.RELEASE.
Workarounds
No workaround is available beyond ensuring applications do not pass unvalidated user input directly to the template engine. Upgrading to 3.1.4.RELEASE is strongly recommended in any case.
Credits
Thanks to Thomas Reburn (Praetorian) for responsible disclosure.
- Record
GHSA-r4v4-5mwr-2fwr- CVSS 3.1
- 9.0 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - Weakness
- CWE-1336, CWE-917
- Updated
- 2026-11-02
OSVRHLW-2026-e0e5640c50ceea84
9.0
Lightwell Security Advisory: thymeleaf 3.0.15.RELEASE-rhlw-00009
Red Hat Lightwell has released org.thymeleaf:thymeleaf 3.0.15.RELEASE-rhlw-00009 with backported fixes for CVE-2026-40477, CVE-2026-40478, and CVE-2026-41901.
CVE-2026-40477: Improper restriction of the scope of accessible objects in Thymeleaf expressions
CVE-2026-40478: Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf
CVE-2026-41901: Thymeleaf: Improper recognition of unauthorized syntax patterns in sandboxed Thymeleaf expressions
This patched artifact is a drop-in replacement for org.thymeleaf:thymeleaf 3.0.15.RELEASE-rhlw-00009 from Maven Central.
- Record
RHLW-2026-e0e5640c50ceea84- CVSS 3.1
- 9.0 Critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H - Updated
- 2026-11-06
Affected products
- thymeleaf
- thymeleaf org.thymeleaf:thymeleaf-spring5
- thymeleaf org.thymeleaf:thymeleaf-spring6
- red hat build of apache camel for spring boot 4
- red hat fuse 7
- red hat jboss enterprise application platform 7
- red hat jboss enterprise application platform 8
- red hat jboss enterprise application platform expansion pack
- red hat openshift dev spaces 3.28
- red hat single sign-on 7
Affected packages
| Package | Affected | Fixed |
|---|---|---|
org.thymeleaf:thymeleafMaven |
through 3.1.3.RELEASE | 3.1.4.RELEASE |
org.thymeleaf:thymeleaf-spring5Maven |
through 3.1.3.RELEASE | 3.1.4.RELEASE |
org.thymeleaf:thymeleaf-spring6Maven |
through 3.1.3.RELEASE | 3.1.4.RELEASE |
org.thymeleaf:thymeleafMaven |
before 3.1.4.RELEASE, plus listed versions 1.0.01.0.0-beta11.0.0-beta21.0.0-beta31.0.0-beta4 Show 45 moreShow less1.0.0-beta51.0.11.1.01.1.11.1.21.1.31.1.41.1.52.0.02.0.0-beta12.0.0-beta22.0.12.0.102.0.112.0.122.0.132.0.142.0.152.0.162.0.172.0.182.0.192.0.22.0.202.0.212.0.32.0.42.0.52.0.62.0.72.0.82.0.92.1.0-beta12.1.0-beta22.1.0-m12.1.0-m22.1.0-m32.1.0.RELEASE2.1.1.RELEASE2.1.2.RELEASE2.1.3.RELEASE2.1.4.RELEASE2.1.5.RELEASE2.1.6.RELEASE3.0.0.ALPHA01 |
3.1.4.RELEASE |
org.thymeleaf:thymeleaf-spring5Maven |
before 3.1.4.RELEASE, plus listed versions 3.0.10.RELEASE3.0.11.RELEASE3.0.12.RELEASE3.0.13.RELEASE3.0.14.RELEASE Show 17 moreShow less3.0.15.RELEASE3.0.3.M13.0.4.M23.0.5.M33.0.6.M43.0.7.RC13.0.8.RELEASE3.0.9.RELEASE3.1.0.M13.1.0.M23.1.0.M33.1.0.RC13.1.0.RC23.1.0.RELEASE3.1.1.RELEASE3.1.2.RELEASE3.1.3.RELEASE |
3.1.4.RELEASE |
org.thymeleaf:thymeleaf-spring6Maven |
before 3.1.4.RELEASE, plus listed versions 3.1.0.M13.1.0.M23.1.0.M33.1.0.RC13.1.0.RC2 Show 4 moreShow less3.1.0.RELEASE3.1.1.RELEASE3.1.2.RELEASE3.1.3.RELEASE |
3.1.4.RELEASE |
org.thymeleaf:thymeleafRed Hat Lightwell:Maven From an advisory covering 3 CVEs |
before 3.0.15.RELEASE-rhlw-00009, plus listed versions 1.0.01.0.0-beta11.0.0-beta21.0.0-beta31.0.0-beta4 Show 45 moreShow less1.0.0-beta51.0.11.1.01.1.11.1.21.1.31.1.41.1.52.0.02.0.0-beta12.0.0-beta22.0.12.0.102.0.112.0.122.0.132.0.142.0.152.0.162.0.172.0.182.0.192.0.22.0.202.0.212.0.32.0.42.0.52.0.62.0.72.0.82.0.92.1.0-beta12.1.0-beta22.1.0-m12.1.0-m22.1.0-m32.1.0.RELEASE2.1.1.RELEASE2.1.2.RELEASE2.1.3.RELEASE2.1.4.RELEASE2.1.5.RELEASE2.1.6.RELEASE3.0.0.ALPHA01 |
3.0.15.RELEASE-rhlw-00009 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | xiaoqiMikko/thymeleaf-check | 2026-09-04 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | OSV | |
| affected | ||
| exploitation, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-40477 is a critical vulnerability (CVSS 9.1) in Thymeleaf, published April 15, 2026. EUVD reports exploitation since October 10, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.85%, the 58th percentile. Fixed in org.thymeleaf:thymeleaf 3.1.4.RELEASE.
References
github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr
access.redhat.com/security/cve/CVE-2026-40477
bugzilla.redhat.com/show_bug.cgi?id=2459344
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40477.json
access.redhat.com/errata/RHSA-2026:21772
nvd.nist.gov/vuln/detail/CVE-2026-40477
Show 13 moreShow less
github.com/advisories/GHSA-r4v4-5mwr-2fwr
github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40477.json
github.com/thymeleaf/thymeleaf
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40478.json
access.redhat.com/security/cve/CVE-2026-40478
github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40478.json
github.com/thymeleaf/thymeleaf/security/advisories/GHSA-xjw8-8c5c-9r79
nvd.nist.gov/vuln/detail/CVE-2026-40478
github.com/advisories/GHSA-xjw8-8c5c-9r79
github.com/CVEProject/cvelistV5/tree/main/cves/2026/41xxx/CVE-2026-41901.json
github.com/thymeleaf/thymeleaf/security/advisories/GHSA-c9ph-gxww-7744
nvd.nist.gov/vuln/detail/CVE-2026-41901
github.com/advisories/GHSA-c9ph-gxww-7744
Left out here: 53 versions. The JSON record has them.