CVE-2026-136410 in Spring Framework
Summary
by MITRE • 11/24/2026
Thymeleaf before 3.1.6.RELEASE contains a restricted expression mode bypass vulnerability that allows unauthenticated remote attackers to perform forbidden actions through improperly scoped expression objects. Attackers can inject input into restricted contexts like preprocessing, th:utext, th:on* handlers, fragment names, or TEXT templates to escalate server-side template injection.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/24/2026
The Thymeleaf templating engine for Java, prior to version 3.1.6.RELEASE, contains a critical security flaw related to the enforcement of its restricted expression mode. This vulnerability stems from an improper scoping mechanism within the framework's expression evaluation logic, which allows unauthenticated remote attackers to bypass intended restrictions and execute arbitrary server-side template injection attacks. Thymeleaf is widely used in enterprise Java applications for rendering dynamic web content, and it provides a security feature known as restricted expression mode designed to prevent code execution by limiting the methods and properties accessible during template processing. However, due to insufficient validation of context boundaries, this protection mechanism can be circumvented under specific conditions involving how input data is processed within certain template directives.
The technical root cause lies in the handling of user-supplied input when it enters restricted contexts such as preprocessing blocks, th:utext attributes, event handlers like th:on*, fragment name evaluations, or TEXT templates. In these scenarios, the framework fails to correctly isolate the expression evaluation scope from external inputs. An attacker can craft malicious payloads that exploit this scoping error to inject expressions that are normally forbidden in restricted mode. By injecting input into these specific areas, an adversary can effectively escalate a standard template injection vulnerability into a full remote code execution vector. This bypass allows the attacker to invoke dangerous Java methods or access sensitive internal objects that should remain inaccessible under normal security policies.
The operational impact of this vulnerability is severe for any application relying on Thymeleaf versions earlier than 3.1.6.RELEASE without proper mitigation layers. Since the attack can be performed by unauthenticated remote users, it presents a high-risk entry point for compromise. Successful exploitation enables attackers to execute arbitrary commands on the server hosting the vulnerable application, potentially leading to complete system takeover, data exfiltration, or lateral movement within the network infrastructure. The ability to bypass restricted expression mode undermines the fundamental security assumptions of using Thymeleaf in sensitive environments where input sanitization is critical for preventing injection-based attacks.
To mitigate this risk, organizations must immediately upgrade their Thymeleaf dependencies to version 3.1.6.RELEASE or later, which includes patches addressing these scoping issues and strengthening the enforcement of restricted expression modes. For applications that cannot be updated instantly due to compatibility constraints, implementing a Web Application Firewall with rules specifically targeting server-side template injection patterns can provide temporary protection. Additionally, developers should review codebases for any direct usage of th:utext or similar directives with untrusted input and ensure that all user-supplied data is strictly validated against allowlists before being passed into templates. This vulnerability aligns with CWE-94 Improper Control of Generation of Code (Code Injection) and maps to the ATT&CK technique T1059 Command and Scripting Interpreter, highlighting its potential for direct system compromise through injected script execution.