CVE-2026-40478: Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf
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.
Security readout for executives and security teams
Plain-English summary
CVE-2026-40478 affects Thymeleaf, a Java server-side template engine. In unsafe application designs where unvalidated user input is passed directly into template evaluation, an unauthenticated remote attacker may bypass expression protections and trigger server-side template injection. Thymeleaf fixed the issue in 3.1.4.RELEASE.
Executive priority
Treat as urgent for Java services using Thymeleaf because successful exploitation could compromise confidentiality, integrity, and availability. Prioritize internet-facing services and any application accepting user-controlled template input. No active exploitation is confirmed in the provided sources.
Technical view
Thymeleaf 3.1.3.RELEASE and earlier, including org.thymeleaf:thymeleaf-spring5 and thymeleaf-spring6 before 3.1.4.RELEASE, fail to neutralize specific syntax patterns in expression execution controls. The issue maps to CWE-1336 and CWE-917 and carries CVSS 3.1 score 9.1 with high confidentiality, integrity, and availability impact.
Likely exposure
Exposure requires both a vulnerable Thymeleaf dependency and application code that passes unvalidated user input directly to the template engine. Systems using Red Hat-packaged Thymeleaf should verify their package status against Red Hat’s CVE, CSAF VEX, and errata sources.
Exploitation context
The source bundle does not show CISA KEV listing or cited evidence of active exploitation. The reported path is unauthenticated remote SSTI, but attack complexity is rated high because exploitation depends on unsafe application integration with Thymeleaf expression evaluation.
Researcher notes
Key uncertainty is reachability: vulnerable library presence alone is not enough without unsafe input-to-template flow. The advisory describes a bypass of expression execution protections, but the provided bundle does not include exploit details, proof-of-concept material, or broader product impact beyond listed Thymeleaf artifacts.
Mitigation direction
Upgrade Thymeleaf dependencies to 3.1.4.RELEASE or later.
Update thymeleaf-spring5 and thymeleaf-spring6 artifacts to fixed versions.
Apply relevant Red Hat errata if using Red Hat-distributed packages.
Remove direct unvalidated user input from template evaluation paths.
Check vendor guidance for any product-specific remediation details.
Validation and detection
Inventory all Thymeleaf, thymeleaf-spring5, and thymeleaf-spring6 dependency versions.
Confirm no deployed artifact uses versions earlier than 3.1.4.RELEASE.
Review application code for user input passed into template evaluation.
Check Red Hat CSAF VEX and RHSA-2026:21772 for packaged status.
Verify CI dependency scanning flags CVE-2026-40478 correctly.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-1336: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
6Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-1336 · source CWE mapping
Improper Neutralization of Special Elements Used in a Template Engine
Improper Neutralization of Special Elements Used in a Template Engine represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection')
Improper Neutralization of Special Elements used in an Expression Language Statement ('Expression Language Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.