LiveActive security incident?Get immediate response
CVE Record

CVE-2026-40477: Improper restriction of the scope of accessible objects in Thymeleaf expressions

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.

CriticalCVSS 9.1Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

Affected Thymeleaf versions can mistake attacker-controlled input for executable template logic when an application passes that input directly into the template engine. This can bypass Thymeleaf’s safeguards and expose sensitive server-side objects. The issue is critical but conditional: applications that never evaluate unvalidated user input as templates may not be directly exploitable.

Executive priority

Triage immediately and remediate promptly where the vulnerable data flow exists, especially on internet-facing services. The possible impact is critical, but organizational risk depends on whether unvalidated user input reaches template evaluation. Prioritize confirming both deployed versions and application data flows rather than relying on dependency scanning alone.

Technical view

CVE-2026-40477 is an object-scope restriction bypass in Thymeleaf expression execution, classified under CWE-1336 and CWE-917. Versions before 3.1.4.RELEASE may permit unauthenticated remote SSTI when unvalidated user input reaches template evaluation. CVSS 3.1 is 9.1 with high confidentiality, integrity, and availability impacts; attack complexity is rated high.

Likely exposure

Potentially exposed systems use thymeleaf, thymeleaf-spring5, or thymeleaf-spring6 below 3.1.4.RELEASE and pass unvalidated user-controlled content directly to template evaluation. Internet-facing template customization, dynamic template creation, or similar flows deserve immediate review. Dependency presence alone does not prove exploitability.

Exploitation context

The supplied record is not listed in CISA KEV and provides no evidence of active exploitation. Exploitation requires an application-specific path that sends unvalidated attacker input into the template engine. The high attack-complexity rating reflects this prerequisite, while no authentication or user interaction is required once such a path exists.

Researcher notes

The source bundle establishes a protection bypass enabling SSTI but does not identify the specific accessible objects, demonstrate downstream execution effects, or report exploitation in the wild. No CPEs are supplied. Assessment should distinguish ordinary variable interpolation from application-controlled template or expression evaluation and should avoid assuming every installation is reachable.

Mitigation direction

  • Upgrade affected Thymeleaf components to 3.1.4.RELEASE or later.
  • Stop passing unvalidated user input directly into template evaluation.
  • Treat user-controlled content as data rather than executable template source.
  • Apply applicable Red Hat remediation documented in RHSA-2026:21772.
  • Check current vendor guidance for deployment-specific remediation details.

Validation and detection

  • Inventory direct and transitive Thymeleaf dependencies and record resolved runtime versions.
  • Trace user-controlled input flows into template parsing and expression evaluation.
  • Confirm deployed artifacts resolve all affected components to 3.1.4.RELEASE or later.
  • Verify untrusted content is rendered as data and never evaluated as template logic.
  • For Red Hat deployments, confirm installed package status against the cited errata.
Prepared
Confidence
high
Sources
5

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.

Open ATT&CK lookup
cwe · low confidence lookup

CWE-917: 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.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2026-40477 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.1 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

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.

ScoreVersionSeverityVectorExploitImpactSource
9.1CVSS 3.1CriticalCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H2.26GitHub_M
8.5CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H1.86redhat-SADP

Vulnerability scoring details

Base CVSS 3.1 score

9.1Critical
CVSS 3.1 vector shape for CVE-2026-40477Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. ADP timelineredhat-SADP

    Made public.

  3. CVE publishedCVE Program

    The CVE record was published.

  4. ADP timelineredhat-SADP

    Reported to Red Hat.

  5. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc
redhat-SADPthymeleaf: Thymeleaf: Server-Side Template Injection via security bypass in expression execution
other:Red Hat severity ratingcvssV3_1
  • 2026-04-17T23:00:52.793Z: Reported to Red Hat.
  • 2026-04-17T21:53:47.271Z: Made public.

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
thymeleafthymeleaf< 3.1.4.RELEASEListed
thymeleaforg.thymeleaf:thymeleaf-spring5< 3.1.4.RELEASEListed
thymeleaforg.thymeleaf:thymeleaf-spring6< 3.1.4.RELEASEListed
Weakness

CWE details

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.

CWE-917 · source CWE mapping

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.