Vulnerabilities in pkg:maven/org.thymeleaf/thymeleaf-spring5

PACKAGE
Advisory Identifier: GHSA-c9ph-gxww-7744
Advisory Summary

CVE-2026-41901 is a CRITICAL (CVSS 9.0) sandboxed thymeleaf expressions vulnerable to vulnerability (CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')) affecting Thymeleaf libraries in the Maven ecosystem. The issue involves sandboxed thymeleaf expressions vulnerable to improper recognition of unauthorized syntax patterns. Remediation is available by upgrading affected packages to version 3.1.5.RELEASE.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.thymeleaf/thymeleaf-spring5

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.thymeleaf/thymeleaf-spring5. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c9ph-gxww-7744 CVE-2026-41901 CRITICAL Sandboxed Thymeleaf expressions vulnerable to improper recognition of unauthorized syntax patterns
GHSA-xjw8-8c5c-9r79 CVE-2026-40478 CRITICAL Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf
GHSA-r4v4-5mwr-2fwr CVE-2026-40477 CRITICAL Improper restriction of the scope of accessible objects in Thymeleaf expressions
GHSA-qcj6-jqrg-4wp2 CVE-2021-43466 CRITICAL Template injection in thymeleaf-spring5

CVE-2026-41901 at a Glance

CVE Identifier CVE-2026-41901
GHSA Identifier GHSA-c9ph-gxww-7744
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Affected Product Thymeleaf
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-41901

To remediate this vulnerability, upgrade all affected Thymeleaf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.thymeleaf:thymeleaf fixed: 3.1.5.RELEASE
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>3.1.5.RELEASE</version>
</dependency>
org.thymeleaf:thymeleaf-spring5 fixed: 3.1.5.RELEASE
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    <version>3.1.5.RELEASE</version>
</dependency>
org.thymeleaf:thymeleaf-spring6 fixed: 3.1.5.RELEASE
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring6</artifactId>
    <version>3.1.5.RELEASE</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.thymeleaf

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-41901, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.thymeleaf

Analyze the terminal output to locate any version of Thymeleaf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.5.RELEASE), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.thymeleaf command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection'), where the product constructs all or part of an expression language (el) statement in a framework such as a java server page (jsp) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended el statement before it is executed. In Thymeleaf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact A security bypass vulnerability exists in the expression execution mechanisms of Thymeleaf up to and including 3.1.4.RELEASE. 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). ### Patches This has been fixed in Thymeleaf 3.1.5.RELEASE. All users are advised to upgrade immediately. ### Workarounds No workaround is available beyond ensuring applications do not pass unvalidated/unsanitized data directly to the template engine. Upgrading to 3.1.5.RELEASE is strongly recommended in any case.

CVE-2026-41901 Affected Thymeleaf Versions

3 component(s)
Fixed Versions:
3.1.5.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.thymeleaf:thymeleaf
Maven
< 3.1.5.RELEASE
3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring5
Maven
< 3.1.5.RELEASE
3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring6
Maven
< 3.1.5.RELEASE
3.1.5.RELEASE

References

Frequently Asked Questions

What is CVE-2026-41901?
CVE-2026-41901 is a security vulnerability in Thymeleaf involving Sandboxed Thymeleaf expressions vulnerable to improper recognition of unauthorized syntax patterns under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection').
Which Thymeleaf versions are affected?
Affected versions include releases prior to 3.1.5.RELEASE across affected packages: org.thymeleaf:thymeleaf, org.thymeleaf:thymeleaf-spring5, org.thymeleaf:thymeleaf-spring6.
What version fixes CVE-2026-41901?
Upgrading to 3.1.5.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is thymeleaf affected?
Yes, org.thymeleaf:thymeleaf is affected in releases prior to 3.1.5.RELEASE. Upgrade your dependency to 3.1.5.RELEASE or later.
Is thymeleaf-spring5 affected?
Yes, org.thymeleaf:thymeleaf-spring5 is affected in releases prior to 3.1.5.RELEASE. Upgrade your dependency to 3.1.5.RELEASE or later.
What is the CVSS score of CVE-2026-41901?
CVE-2026-41901 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-41901?
CVE-2026-41901 is classified under CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') (The product constructs all or part of an expression language (EL) statement in a framework such as a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.).
How can I check Maven dependencies for CVE-2026-41901?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.thymeleaf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c9ph-gxww-7744",
  "modified" : "2026-05-13T16:43:36Z",
  "published" : "2026-05-04T21:15:20Z",
  "aliases" : [ "CVE-2026-41901" ],
  "summary" : "Sandboxed Thymeleaf expressions vulnerable to improper recognition of unauthorized syntax patterns",
  "details" : "### Impact\n\nA security bypass vulnerability exists in the expression execution mechanisms of Thymeleaf up to and including 3.1.4.RELEASE. 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).\n\n### Patches\n\nThis has been fixed in Thymeleaf 3.1.5.RELEASE. All users are advised to upgrade immediately.\n\n### Workarounds\n\nNo workaround is available beyond ensuring applications do not pass unvalidated/unsanitized data directly to the template engine. Upgrading to 3.1.5.RELEASE is strongly recommended in any case.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.thymeleaf:thymeleaf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.5.RELEASE"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.4.RELEASE"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.thymeleaf:thymeleaf-spring5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.5.RELEASE"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.4.RELEASE"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.thymeleaf:thymeleaf-spring6"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.5.RELEASE"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.4.RELEASE"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-c9ph-gxww-7744"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41901"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thymeleaf/thymeleaf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-917" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-04T21:15:20Z",
    "nvd_published_at" : "2026-05-12T23:16:17Z"
  }
}