Every CVE Search/ Get API key

CVE-2026-40477

Improper restriction of the scope of accessible objects in Thymeleaf expressions

9.1 CriticalKnown exploitedPublic exploitFix available

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

0.85%Up 0.7 points since Apr 18, 2026
90%50%10%1%

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 CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS 3.1
8.5 HighCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS 3.1
8.5 HighCVSS: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 CriticalCVSS: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 CriticalCVSS: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 CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
Updated
2026-11-06

Affected products

Affected packages

Affected packages
PackageAffectedFixed
org.thymeleaf:thymeleaf
Maven
through 3.1.3.RELEASE
3.1.4.RELEASE
org.thymeleaf:thymeleaf-spring5
Maven
through 3.1.3.RELEASE
3.1.4.RELEASE
org.thymeleaf:thymeleaf-spring6
Maven
through 3.1.3.RELEASE
3.1.4.RELEASE
org.thymeleaf:thymeleaf
Maven
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 less
1.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-spring5
Maven
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 less
3.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-spring6
Maven
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 less
3.1.0.RELEASE3.1.1.RELEASE3.1.2.RELEASE3.1.3.RELEASE
3.1.4.RELEASE
org.thymeleaf:thymeleaf
Red 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 less
1.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.

Public exploits
SourceLinkDate
PoC in GitHubxiaoqiMikko/thymeleaf-check2026-09-04

History

History
RecordedChangedSources
affectedOSV
affected
exploitation, facts
first indexedCVE 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

Show 13 moreShow less
This page doesn't list everything

Left out here: 53 versions. The JSON record has them.

MoveEnter Open