cve.bz

CVE-2026-40478 thymeleaf thymeleaf: Expression Language Injection

9.0 criticalEPSS 1.1%Fix available

Critical (9.0) in thymeleaf thymeleaf. EPSS 1.1% estimated probability of exploitation activity in the next 30 days. Fixed in org.thymeleaf:thymeleaf 3.1.4.RELEASE.

On this page
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 the expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly neutralize specific syntax patterns that allow for the execution of unauthorized expressions. 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.

Severity

CVSS 3.1

9.0 critical
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS
1.1% (unchanged from 1.1% a week ago; 1.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 67th percentile. Scored 2026-11-23. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-04-21. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-917 Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection)
CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-40478 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-40478?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-40478?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-40478 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
thymeleaf:thymeleafbefore 3.1.4

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-xjw8-8c5c-9r79Mavenorg.thymeleaf:thymeleaf<3.1.4.RELEASE3.1.4.RELEASE
GHSA-xjw8-8c5c-9r79Mavenorg.thymeleaf:thymeleaf-spring5<3.1.4.RELEASE3.1.4.RELEASE
GHSA-xjw8-8c5c-9r79Mavenorg.thymeleaf:thymeleaf-spring6<3.1.4.RELEASE3.1.4.RELEASE

Red Hat

Red Hat rates this Important.

Red Hat's mitigation

The vulnerability arises when unvalidated user input is directly passed to the Thymeleaf template engine. To mitigate this, application developers should implement robust input validation and sanitization for all user-supplied data before it is processed by the Thymeleaf template engine. This ensures that malicious expressions cannot be executed.

ProductPackageStateAdvisory
Red Hat OpenShift Dev Spaces 3.28devspaces/openvsx-rhel9:1779528224Fixed 2026-05-28RHSA-2026:21772
Red Hat OpenShift Dev Spaces 3.28devspaces/pluginregistry-rhel9:1779359423Fixed 2026-05-28RHSA-2026:21772
Red Hat build of Apache Camel for Spring Boot 4camel-thymeleafNot affected
Red Hat build of Apache Camel for Spring Boot 4thymeleafNot affected
Red Hat Fuse 7thymeleafWill not fix
Red Hat JBoss Enterprise Application Platform 7smallrye-mutiny-vertx-web-templ-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform 7thymeleafNot affected
Red Hat JBoss Enterprise Application Platform 7vertx-web-templ-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform 8smallrye-mutiny-vertx-web-templ-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform 8thymeleafNot affected
Red Hat JBoss Enterprise Application Platform 8vertx-web-templ-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform Expansion Packsmallrye-mutiny-vertx-web-templ-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform Expansion Packspring-boot-starter-thymeleafNot affected
Red Hat JBoss Enterprise Application Platform Expansion PackthymeleafNot affected
Red Hat JBoss Enterprise Application Platform Expansion Packthymeleaf-extras-java8timeNot affected
Red Hat JBoss Enterprise Application Platform Expansion Packthymeleaf-spring5Not affected
Red Hat JBoss Enterprise Application Platform Expansion Packvertx-web-templ-thymeleafNot affected
Red Hat Single Sign-On 7spring-boot-starter-thymeleafWill not fix
Red Hat Single Sign-On 7thymeleafAffected
Red Hat Single Sign-On 7thymeleaf-extras-java8timeWill not fix
1 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-40478.

GitHub PoC (unverified)

Repositories on GitHub named after this CVE. Nobody has checked them and they are not scanned: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it.

References

Check your stackJSON