CVE-2026-40477
Improper restriction of the scope of accessible objects in Thymeleaf expressions
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
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.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | Critical9.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
| redhat-SADPADP (enrichment) | 3.1 | High8.5 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H |
| NVDNVD · Modified | 3.1 | Critical9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
- EPSS (exploitation in 30 days)
- 0.85% · top 42% of all CVEs (5 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Critical 9.1.
Weakness
- CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') (opens in a new tab)All about CWE-917 and its CVEs
- CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (opens in a new tab)All about CWE-1336 and its CVEs
Affected products
- affected < 3.1.4.RELEASE
thymeleaf · org.thymeleaf:thymeleaf-spring5
- affected < 3.1.4.RELEASE
thymeleaf · org.thymeleaf:thymeleaf-spring6
- affected < 3.1.4.RELEASE
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- Mavenorg.thymeleaf:thymeleafGHSA-r4v4-5mwr-2fwr (opens in a new tab)
- Mavenorg.thymeleaf:thymeleaf-spring5GHSA-r4v4-5mwr-2fwr (opens in a new tab)
- Mavenorg.thymeleaf:thymeleaf-spring6GHSA-r4v4-5mwr-2fwr (opens in a new tab)
References (5)
- https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr (opens in a new tab)x_refsource_CONFIRM
- https://access.redhat.com/security/cve/CVE-2026-40477 (opens in a new tab)vdb-entryx_refsource_REDHAT
- RHBZ#2459344 (opens in a new tab)issue-trackingx_refsource_REDHAT
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40477.json (opens in a new tab)x_sadp-csaf-vex
- https://access.redhat.com/errata/RHSA-2026:21772 (opens in a new tab)vendor-advisoryx_refsource_REDHAT
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-r4v4-5mwr-2fwr (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2026-40477)Record last updated .