Skip to main content

CVE-2026-40477 — Vulnerability in thymeleaf-spring6 — CVE Details

CRITICAL

Improper restriction of the scope of accessible objects in Thymeleaf expressions

Published April 15, 2026Updated May 5, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.98%). Schedule for your next planned update.

Does your project use an affected org.thymeleaf:thymeleaf-spring6 version?

Paste your pom.xml to check it for CVE-2026-40477 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my pom.xml

Summary

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.

Advisory Timeline

  • First published April 15, 2026 (225 days ago).
  • Last revised May 5, 2026 — 20 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update org.thymeleaf:thymeleaf-spring6 to 3.1.4.RELEASE or later
<!-- Update pom.xml dependency version to 3.1.4.RELEASE for org.thymeleaf:thymeleaf-spring6 -->
Maven
Update org.thymeleaf:thymeleaf to 3.1.4.RELEASE or later
<!-- Update pom.xml dependency version to 3.1.4.RELEASE for org.thymeleaf:thymeleaf -->
Maven
Update org.thymeleaf:thymeleaf-spring5 to 3.1.4.RELEASE or later
<!-- Update pom.xml dependency version to 3.1.4.RELEASE for org.thymeleaf:thymeleaf-spring5 -->

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: Maven (3).

PackageFixed In
org.thymeleaf:thymeleaf-spring6 Maven · Affected: 3.1.0.M1, 3.1.0.M2, 3.1.0.M3, 3.1.0.RC1 (+5 more)3.1.4.RELEASE
org.thymeleaf:thymeleaf Maven · Affected: 1.0.0, 1.0.0-beta1, 1.0.0-beta2, 1.0.0-beta3 (+77 more)3.1.4.RELEASE
org.thymeleaf:thymeleaf-spring5 Maven · Affected: 3.0.10.RELEASE, 3.0.11.RELEASE, 3.0.12.RELEASE, 3.0.13.RELEASE (+18 more)3.1.4.RELEASE

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.0 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-40477?
Improper restriction of the scope of accessible objects in Thymeleaf expressions. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.0/10).
How do I check if my project is affected by CVE-2026-40477?
CVE-2026-40477 affects org.thymeleaf:thymeleaf-spring6, org.thymeleaf:thymeleaf and org.thymeleaf:thymeleaf-spring5. It has a 1.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40477 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.0

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.98%
EPSS percentile: 61

This is an above-median EPSS score — 61% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-r4v4-5mwr-2fwr

Related CVEs

  • CVE-2026-107726
    CRITICAL

    Hazelcast allows arbitrary member memory access by low-privileged client

  • CVE-2026-41901
    CRITICAL

    Sandboxed Thymeleaf expressions vulnerable to improper recognition of unauthorized syntax patterns

  • CVE-2026-107282
    CRITICAL

    AsyncHttpClient: Replay to a different host sends the original host request and credentials to the new host

  • CVE-2026-40478
    CRITICAL

    Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my pom.xml