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-40478

CVE-2026-40478: Thymeleaf Auth Bypass Vulnerability

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

Published: April 23, 2026

CVE-2026-40478 Overview

CVE-2026-40478 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 neutralize specific syntax patterns, allowing attackers to bypass built-in expression injection protections. When application developers pass unvalidated user input directly to the template engine, unauthenticated remote attackers can exploit this flaw to execute unauthorized expressions, potentially leading to remote code execution.

Critical Impact

Unauthenticated remote attackers can bypass Thymeleaf's expression injection protections to achieve Server-Side Template Injection, potentially enabling arbitrary code execution on the server.

Affected Products

  • Thymeleaf versions 3.1.3.RELEASE and prior

Discovery Timeline

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

Technical Details for CVE-2026-40478

Vulnerability Analysis

This vulnerability is classified under CWE-917 (Improper Neutralization of Special Elements used in an Expression Language Statement). Thymeleaf provides built-in mechanisms designed to prevent expression injection attacks by restricting the types of expressions that can be evaluated. However, the library contains a security bypass that fails to properly sanitize specific syntax patterns within user-controlled input.

When an application passes unvalidated user input to the Thymeleaf template engine, an attacker can craft malicious payloads that circumvent the protection mechanisms. This allows execution of arbitrary Spring Expression Language (SpEL) or Object-Graph Navigation Language (OGNL) expressions, depending on the Thymeleaf configuration and dialect in use.

Root Cause

The root cause of this vulnerability lies in incomplete input validation within Thymeleaf's expression parsing and execution logic. The library's protection mechanisms do not account for all possible syntax patterns that could be leveraged to inject malicious expressions. Specific character sequences or encoding variations can bypass the sanitization filters, allowing attackers to inject and execute arbitrary expressions.

Attack Vector

The attack vector is network-based and requires the attacker to identify an application endpoint where user input is processed by the Thymeleaf template engine without proper validation. The attacker crafts a specially formatted input string containing expression language syntax that bypasses the library's protections. When the vulnerable application processes this input, the malicious expression is evaluated on the server, potentially allowing the attacker to:

  • Execute arbitrary system commands
  • Read or modify sensitive files
  • Access environment variables and application secrets
  • Establish persistence or pivot to internal systems

The attack is particularly dangerous because it can be performed by unauthenticated remote attackers if the vulnerable endpoint is publicly accessible. The scope is changed (S:C in CVSS vector), meaning successful exploitation can impact resources beyond the vulnerable component.

The vulnerability occurs when user-controlled data flows into Thymeleaf template processing without adequate sanitization. Attackers can craft expression language payloads that exploit gaps in the library's protection mechanisms to achieve code execution. For detailed technical information regarding specific bypass techniques, refer to the GitHub Security Advisory.

Detection Methods for CVE-2026-40478

Indicators of Compromise

  • Unusual HTTP request parameters containing expression language syntax such as ${, *{, #{, @{, or ~{ patterns
  • Web server logs showing requests with encoded expression language payloads targeting template-rendered endpoints
  • Unexpected process spawning or outbound connections originating from Java application server processes
  • Error logs indicating template parsing failures with suspicious expression content

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block requests containing Thymeleaf expression language patterns in user input
  • Deploy runtime application self-protection (RASP) solutions capable of monitoring expression language evaluation
  • Configure application logging to capture and alert on template processing errors and exceptions
  • Use SentinelOne Singularity to monitor for behavioral indicators of post-exploitation activity

Monitoring Recommendations

  • Monitor Java application processes for suspicious child process creation, particularly shell interpreters
  • Track outbound network connections from web application servers for command-and-control communication attempts
  • Implement file integrity monitoring on application directories to detect unauthorized modifications
  • Review application logs for template parsing exceptions that may indicate exploitation attempts

How to Mitigate CVE-2026-40478

Immediate Actions Required

  • Upgrade Thymeleaf to version 3.1.4.RELEASE or later immediately
  • Audit application code to identify all locations where user input is passed to Thymeleaf template processing
  • Implement strict input validation and sanitization for any user-controlled data processed by templates
  • Consider implementing a content security policy and additional WAF rules as defense-in-depth measures

Patch Information

The Thymeleaf development team has addressed this vulnerability in version 3.1.4.RELEASE. Organizations using Thymeleaf versions 3.1.3.RELEASE or earlier should upgrade immediately. For Maven-based projects, update the dependency version in your pom.xml. For Gradle projects, update the version in your build.gradle file. Additional details are available in the GitHub Security Advisory.

Workarounds

  • Implement strict input validation to reject any user input containing expression language syntax patterns before template processing
  • Use allowlist-based validation for template variables where feasible, accepting only known-safe character sets
  • Consider sandboxing the Thymeleaf template engine by restricting the classes and methods accessible from expressions
  • Deploy network-level controls to limit the impact of potential compromise, including egress filtering
bash
# Maven dependency update example
# Update pom.xml to use patched version:
# <dependency>
#     <groupId>org.thymeleaf</groupId>
#     <artifactId>thymeleaf</artifactId>
#     <version>3.1.4.RELEASE</version>
# </dependency>

# Verify current Thymeleaf version in your project
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-40477: 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