CVE-2026-41901 Thymeleaf: Improper recognition of unauthorized syntax patterns in sandboxed Thymeleaf expressions

Critical 9.0 Published Updated

Attackers can achieve Server-Side Template Injection and execute arbitrary code if developers pass unsanitized input to sandboxed Thymeleaf contexts.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-41901?

CVE-2026-41901 is a critical code injection vulnerability in thymeleaf, published on 12 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-917, CWE-1336

Which versions are affected by CVE-2026-41901?

6 open source packages ship an affected version, including org.thymeleaf:thymeleaf, org.thymeleaf:thymeleaf-spring5 and org.thymeleaf:thymeleaf-spring6.

PackageAffectedFixed in
org.thymeleaf:thymeleaf MavenAll versions3.1.5.RELEASE
org.thymeleaf:thymeleaf MavenAll versions3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring5 MavenAll versions3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring5 MavenAll versions3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring6 MavenAll versions3.1.5.RELEASE
org.thymeleaf:thymeleaf-spring6 MavenAll versions3.1.5.RELEASE

How do I fix CVE-2026-41901?

Upgrade org.thymeleaf:thymeleaf to 3.1.5.RELEASE or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2026-41901 being exploited?

There is no known exploitation of CVE-2026-41901 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as CLSA-2026-1788881357, CLSA-2026-1788887721, CLSA-2026-1789561134, CLSA-2026-1789577899, GHSA-c9ph-gxww-7744.

Is CVE-2026-41901 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free