Patchfirst
CVE-2026-41901 Public exploit Critical · 9.0 EPSS 0.4%

Thymeleaf: Improper recognition of unauthorized syntax patterns in sandboxed Thymeleaf expressions

Patch now:upgrade thymeleaf to 3.1.5.RELEASE or later also fixes CVE-2026-40477, CVE-2026-40478 Details ↓

thymeleaf · thymeleaf

Summary

The Thymeleaf server-side Java template engine contains a flaw in its expression execution mechanisms, where specific constructs are not properly neutralized in sandboxed (restricted) contexts, allowing expressions meant to be blocked to run. An attacker who can supply unsanitized expression content that the application passes to the template engine, and whose values are rendered inside a sandboxed context of a template, can achieve server-side template injection, with a high attack complexity and no privileges or user interaction required.

Official description · CVE.org

Thymeleaf is a server-side Java template engine for web and standalone environments. Prior to 3.1.5.RELEASE, a security bypass vulnerability exists in the expression execution mechanisms of Thymeleaf. Although the library provides mechanisms to avoid the execution of potentially dangerous expressions in some specific sandboxed (restricted) contexts, it fails to properly neutralize specific constructs that allow this kind of expressions to be executed. If an application developer passes to the template engine unsanitized variables that contain such expressions, and these values are used in sandboxed contexts inside the templates, these expressions can be executed achieving Server-Side Template Injection (SSTI). This vulnerability is fixed in 3.1.5.RELEASE.

Breakdown
65.8 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

First seen exploited 5 months after disclosure. Public exploit code (PoC-in-GitHub) appeared 11 days after disclosure.

  1. Disclosedday 0
  2. Public exploit codePoC-in-GitHub+11 days
  3. First seen exploitedVulnCheck KEV evidenceEU database marks exploited+5 mo

3 fixes in thymeleaf over 4 weeks. The latest fix listed for thymeleaf is 3.1.5.RELEASE.

Fixes in thymeleafMaven package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 3.1.4.RELEASECVE-2026-4047717 Apr 2026
  2. 3.1.4.RELEASECVE-2026-4047817 Apr 2026
  3. 3.1.5.RELEASECVE-2026-4190112 May 2026Latest listed

Affected versions and fixes

as published in the CVE record

thymeleaf thymeleaf

Affected: < 3.1.5.RELEASE

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

3 packages in 1 ecosystem. Main package: org.thymeleaf:thymeleaf.

Mavenorg.thymeleaf:thymeleafGHSA-c9ph-gxww-7744

Upgrade to 3.1.5.RELEASE or later

Fixes this CVE and 2 other known vulnerabilities in this package (CVE-2026-40477, CVE-2026-40478).

Set the version to 3.1.5.RELEASE or later in your pom.xml or build.gradle.

The first fix for CVE-2026-41901.

Affected versions

If you runUpgrade to
All versions before 3.1.5.RELEASE3.1.5.RELEASE

“Up to” means the second version is the fix and is not affected.

Other packages that bundle this code (2)

Forks, repackagings and products that include the affected code. Each has its own fixed version.

  • Mavenorg.thymeleaf:thymeleaf-spring5
    Affected: All versions before 3.1.5.RELEASEUpgrade to 3.1.5.RELEASE or later
  • Mavenorg.thymeleaf:thymeleaf-spring6
    Affected: All versions before 3.1.5.RELEASEUpgrade to 3.1.5.RELEASE or later

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 6 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

1 link, grouped by NVD tag
↑ ↓ chooseEnter openEsc close