The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40477

CVE-2026-40477: Thymeleaf Auth Bypass Vulnerability

CVE-2026-40477 is an authentication bypass flaw in Thymeleaf Java template engine that enables Server-Side Template Injection attacks. This article covers the technical details, affected versions, security impact, and mitigation.

Published: April 23, 2026

CVE-2026-40477 Overview

CVE-2026-40477 is a critical Server-Side Template Injection (SSTI) vulnerability affecting Thymeleaf, a widely-used server-side Java template engine for web and standalone environments. The vulnerability exists in the expression execution mechanisms where the library fails to properly restrict the scope of accessible objects, allowing attackers to bypass built-in protections and reach potentially sensitive objects from within templates.

When application developers pass unvalidated user input directly to the Thymeleaf template engine, unauthenticated remote attackers can exploit this security bypass to achieve Server-Side Template Injection. This vulnerability class (CWE-917: Improper Neutralization of Special Elements used in an Expression Language Statement) is particularly dangerous as it can lead to remote code execution on the underlying server.

Critical Impact

Unauthenticated remote attackers can bypass Thymeleaf's expression injection protections to achieve Server-Side Template Injection (SSTI), potentially leading to remote code execution with the privileges of the application server.

Affected Products

  • Thymeleaf versions 3.1.3.RELEASE and prior
  • Java web applications using vulnerable Thymeleaf versions for template rendering
  • Spring-based applications with Thymeleaf integration on affected versions

Discovery Timeline

  • 2026-04-17 - CVE-2026-40477 published to NVD
  • 2026-04-20 - Last updated in NVD database

Technical Details for CVE-2026-40477

Vulnerability Analysis

This Server-Side Template Injection vulnerability stems from an incomplete security control implementation in Thymeleaf's expression execution mechanisms. While the library includes protections designed to prevent expression injection attacks, these safeguards fail to properly restrict the scope of objects accessible from within template expressions.

The vulnerability is classified under CWE-917 (Improper Neutralization of Special Elements used in an Expression Language Statement), indicating that user-controlled input processed by the template engine is not adequately sanitized or restricted. This allows attackers to craft malicious expressions that can access sensitive objects and methods that should be restricted.

The attack requires network access and does not require authentication, though exploitation complexity is higher due to the need for specific conditions—namely, the application must pass unsanitized user input to the template engine. Successful exploitation can impact confidentiality, integrity, and availability of the target system, with the potential for scope change affecting resources beyond the vulnerable component.

Root Cause

The root cause of CVE-2026-40477 lies in insufficient object scope restrictions within Thymeleaf's expression evaluation context. Although the template engine implements mechanisms intended to prevent expression injection, the restriction logic does not comprehensively block access to all potentially dangerous objects.

Specifically, the expression sandbox allows certain Java objects and their methods to be reached through template expressions. When user-controlled data is incorporated into template expressions without proper validation, attackers can leverage these accessible objects to escape the intended sandbox and execute arbitrary code on the server.

Attack Vector

The attack vector requires an application that passes user-controlled input directly into Thymeleaf template expressions without proper sanitization. An unauthenticated attacker can submit crafted input through network-accessible endpoints such as form fields, URL parameters, or API requests.

The malicious input contains specially constructed Thymeleaf expression syntax designed to:

  1. Navigate through accessible object references in the expression context
  2. Reach Java reflection APIs or other dangerous classes not properly restricted
  3. Execute arbitrary code or access sensitive system resources

The exploitation mechanism leverages the gap between the intended expression restrictions and the actual objects reachable through the expression evaluation context. For detailed technical information on the exploitation technique, refer to the GitHub Security Advisory.

Detection Methods for CVE-2026-40477

Indicators of Compromise

  • Unusual Thymeleaf expression syntax in application logs, particularly containing object traversal patterns
  • Unexpected system command execution originating from the Java application server process
  • Application errors related to template parsing with suspicious expression content
  • Network traffic containing potential SSTI payloads targeting Thymeleaf expression syntax

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block common SSTI payload patterns targeting Thymeleaf
  • Monitor application logs for template parsing errors or exceptions that may indicate exploitation attempts
  • Deploy runtime application self-protection (RASP) solutions to detect malicious expression evaluation
  • Conduct regular code reviews to identify locations where user input flows to template expressions

Monitoring Recommendations

  • Enable verbose logging for the Thymeleaf template engine to capture expression evaluation details
  • Monitor for outbound network connections or unusual process spawning from the application server
  • Implement alerting for repeated template parsing failures from single source IPs
  • Track application behavior anomalies that may indicate successful post-exploitation activity

How to Mitigate CVE-2026-40477

Immediate Actions Required

  • Upgrade Thymeleaf to version 3.1.4.RELEASE or later, which contains the security fix
  • Audit application code to identify all locations where user input is passed to template expressions
  • Implement strict input validation and sanitization for any user-controlled data used in templates
  • Consider implementing a Content Security Policy and additional defense-in-depth measures

Patch Information

The Thymeleaf development team has addressed this vulnerability in version 3.1.4.RELEASE. Organizations using affected versions should prioritize upgrading to this patched release immediately. The fix properly restricts the scope of accessible objects within template expressions, preventing unauthorized access to sensitive classes and methods.

For additional details on the security advisory and patch information, see the GitHub Security Advisory.

Workarounds

  • Avoid passing any user-controlled input directly to Thymeleaf template expressions until patching is complete
  • Implement server-side input validation using allowlists for acceptable values before template processing
  • Deploy WAF rules specifically designed to block Thymeleaf SSTI attack patterns
  • Consider running the application with reduced privileges to limit post-exploitation impact
bash
# Maven dependency update example
# Update pom.xml to use patched Thymeleaf version
# Replace existing thymeleaf dependency version with 3.1.4.RELEASE

# For Maven projects, update the version in pom.xml:
# <dependency>
#     <groupId>org.thymeleaf</groupId>
#     <artifactId>thymeleaf</artifactId>
#     <version>3.1.4.RELEASE</version>
# </dependency>

# Verify the update
mvn dependency:tree | grep thymeleaf

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechThymeleaf

  • SeverityCRITICAL

  • CVSS Score9.0

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-917
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-40478: Thymeleaf Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English