CyberSecBulletin
CVE-2026-40477NVD status: Modified

thymeleaf: Improper Neutralization of Special Elements used in an Expression Language Statement

CVE-2026-40477 is a critical-severity improper neutralization of special elements used in an expression language statement vulnerability in thymeleaf, with a CVSS 3.1 base score of 9.0 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected thymeleaf versions: < 3.1.4.RELEASE. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 0.87% chance of exploitation within 30 days, higher than 59% of scored CVEs.

Patch this week

Critical severity: a successful attack would have severe impact.

What to do

  1. Check which version of thymeleaf you run against the affected versions below, and install the vendor's latest release.
  2. Read the advisory on github.com for workarounds and exact fixed builds.
  3. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Thymeleafthymeleaf< 3.1.4.RELEASENot stated
Thymeleaforg.thymeleaf:thymeleaf-spring5< 3.1.4.RELEASENot stated
Thymeleaforg.thymeleaf:thymeleaf-spring6< 3.1.4.RELEASENot stated
Red HatRed Hat OpenShift Dev Spaces 3.28Not specified in the recordNot stated
Red HatRed Hat build of Apache Camel for Spring Boot 4Not specified in the recordNot stated
Red HatRed Hat Fuse 7Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform 7Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform 8Not specified in the recordNot stated
Red HatRed Hat JBoss Enterprise Application Platform Expansion PackNot specified in the recordNot stated
Red HatRed Hat Single Sign-On 7Not specified in the recordNot stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
HighSuccess depends on conditions outside the attacker's control.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
ChangedThe attack can reach beyond the vulnerable component into other systems.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H. Scored by CNA (github.com).

Scoring systemScoreSeverityScored by
CVSS 3.19.0CriticalCNA (github.com)
CVSS 3.18.5HighCNA

Official description

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 expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly restrict the scope of accessible objects, allowing specific potentially sensitive objects to be reached from within a template. 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Improper Neutralization of Special Elements used in an Expression Language Statement

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 developers prevent this class of flaw

  • Avoid adding user-controlled data into an expression interpreter when possible.
  • If user-controlled data must be added to an expression interpreter, one or more of the following should be performed: Validate that the user input will not evaluate as an expression Encode the user input in a way that ensures it is not evaluated as an expression
  • The framework or tooling might allow the developer to disable or deactivate the processing of EL expressions, such as setting the isELIgnored attribute for a JSP page to true.

More Improper Neutralization of Special Elements used in an Expression Language Statement vulnerabilities (CWE-917)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Other vulnerabilities in thymeleaf

All thymeleaf vulnerabilities

Recent Improper Neutralization of Special Elements used in an Expression Language Statement vulnerabilities

Spotted an error? Tell us.