Security Digest · Vulnerability record

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.

CVSS 9.1 Critical EPSS 0.9% · p61

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
  • EPSS 0.9%, percentile 61: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 61% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes org.thymeleaf:thymeleaf (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE; org.thymeleaf:thymeleaf-spring5 (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE; org.thymeleaf:thymeleaf-spring6 (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE. Check your lockfile, including transitive dependencies.

What it is

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.

From the GitHub advisory

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.

Weakness type: CWE-917, CWE-1336.

Product: org.thymeleaf:thymeleaf (Maven) · Assigned by: GitHub_M · Published: 2026-04-17

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
Mavenorg.thymeleaf:thymeleaf<= 3.1.3.RELEASE3.1.4.RELEASE
Mavenorg.thymeleaf:thymeleaf-spring5<= 3.1.3.RELEASE3.1.4.RELEASE
Mavenorg.thymeleaf:thymeleaf-spring6<= 3.1.3.RELEASE3.1.4.RELEASE
VendorProductAffected versions (per CVE record)
thymeleafthymeleaf< 3.1.4.RELEASE
thymeleaforg.thymeleaf:thymeleaf-spring5< 3.1.4.RELEASE
thymeleaforg.thymeleaf:thymeleaf-spring6< 3.1.4.RELEASE

Severity scores

Scored byCVSSScoreVector
GitHub_M3.19.1 CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
redhat-SADP3.18.5 HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub3.19.0 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: high (needs special conditions)
  • Privileges required: none (no login)
  • User interaction: none
  • Scope: changed (can affect other components)

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation none, automatable no, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.94% probability of exploitation activity in the next 30 days; percentile 61.

Timeline

  • — GitHub-reviewed advisory GHSA-r4v4-5mwr-2fwr published (critical)
  • — CVE record published by GitHub_M
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vendor and project advisories, patches

  1. access.redhat.com access.redhat.com

Vulnerability records

  1. GitHub Advisory GHSA-r4v4-5mwr-2fwr github.com
  2. CVE.org record CVE-2026-40477 cve.org
  3. NVD entry CVE-2026-40477 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. access.redhat.com access.redhat.com
  3. RHBZ#2459344 bugzilla.redhat.com
  4. security.access.redhat.com security.access.redhat.com

Critical Maven advisories · Today’s Security Digest