CVE
CVE-2026-136410
CWE
CWE-917, CWE-1336, CWE-693, CWE-79, CWE-116
Affected Surface
- Maven `org.thymeleaf:thymeleaf`, `org.thymeleaf:thymeleaf-spring5` and `org.thymeleaf:thymeleaf-spring6` 3.1.5.RELEASE and earlier (GHSA-2wmw-5fmc-m25v / CVE-2026-136410 and seven more advisories), and 3.1.6.RELEASE (GHSA-f79q-9862-cq4c)
- Maven `org.thymeleaf.extras:thymeleaf-extras-springsecurity5` and `-springsecurity6` 3.1.5.RELEASE and earlier (GHSA-w6gj-rhv6-hwgj)
- Spring Boot applications on 4.0.9, 4.1.2 or earlier, and on Boot 3.5.x (3.5.16 manages Thymeleaf 3.1.5.RELEASE), unless `thymeleaf.version` is overridden
TL;DR
Thymeleaf, a Java server-side template engine widely used with Spring MVC and Spring Boot, shipped 3.1.6.RELEASE on 8 November 2026 and 3.1.7.RELEASE on 11 November. Together they fix nine advisories in thymeleaf, thymeleaf-spring5, thymeleaf-spring6 and the Spring Security extras. Seven of them weaken or bypass Thymeleaf’s restricted expression evaluation mode, the guard that’s supposed to contain template injection (SSTI) when user input ends up inside an expression.
The critical one is GHSA-2wmw-5fmc-m25v. Thymeleaf didn’t restrict “the scope of specific accessible objects that could be indirectly used for performing actions forbidden in restricted mode.” VulnCheck assigned it CVE-2026-136410 on 24 November with a CVSS 4.0 score of 9.5, and lists the injection points it applies to: preprocessing (__${...}__), th:utext, th:on* handlers, fragment names and TEXT templates. Two high-severity advisories go further: some inlined expressions (GHSA-mvwv-34qr-qx5x) and parts of link expressions (GHSA-6xr7-8ph3-q2g2) were evaluated with no restrictions at all.
Every one of these needs an app that already passes unvalidated input into a template or expression, which Thymeleaf’s security policy forbids. That’s a real bug class, though. Thymeleaf already had three critical restricted-mode fixes in April (CVE-2026-40477, CVE-2026-40478, CVE-2026-41901), and this release reopens the same ground.
The GitHub Advisory Database still only lists the April advisories for org.thymeleaf:thymeleaf. Dependabot and scanners that rely on it won’t alert on 3.1.5 or 3.1.6.
What to do now:
- Move to
thymeleaf,thymeleaf-spring6(or-spring5) andthymeleaf-extras-springsecurity6(or5) 3.1.7.RELEASE. On Spring Boot that means 4.0.10, 4.1.3 or 4.2.0. On Boot 3.5.x, setthymeleaf.versionandthymeleaf-extras-springsecurity.versionyourself. - Upgrade the core
thymeleaf-spring*artifacts together with the Spring Security extras. Thymeleaf warns that upgrading only the extras doesn’t apply the fix for GHSA-w6gj-rhv6-hwgj. - Search controllers and templates for view names, fragment names and preprocessing built from request data (commands below). Those are the apps where these bypasses turn into code execution.
Affected packages and projects
| Ecosystem | Package | Affected versions | Fixed or safe version |
|---|---|---|---|
| Maven | org.thymeleaf:thymeleaf (CVE-2026-136410 / GHSA-2wmw-5fmc-m25v, critical) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | org.thymeleaf:thymeleaf-spring5, thymeleaf-spring6 (GHSA-2wmw-5fmc-m25v) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | org.thymeleaf:thymeleaf (GHSA-mvwv-34qr-qx5x, high) | 3.0.0.RELEASE to 3.1.5.RELEASE | 3.1.6.RELEASE |
| Maven | org.thymeleaf:thymeleaf (GHSA-6xr7-8ph3-q2g2, high) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | thymeleaf-spring5/6, thymeleaf-extras-springsecurity5/6 (GHSA-w6gj-rhv6-hwgj, medium) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | org.thymeleaf:thymeleaf (GHSA-fhmg-2q5h-6v7w medium, GHSA-3q42-4cjm-hg9p medium, GHSA-77qc-v5v5-29hc medium) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | thymeleaf-spring5/6 (GHSA-wwq2-cvmm-4x5q, low) | 3.1.5.RELEASE and earlier | 3.1.6.RELEASE |
| Maven | thymeleaf, thymeleaf-spring5/6 (GHSA-f79q-9862-cq4c, low) | 3.1.6.RELEASE and earlier | 3.1.7.RELEASE |
| Maven | org.springframework.boot:spring-boot-dependencies | 4.0.9, 4.1.2 and earlier manage 3.1.5.RELEASE; 3.5.16 manages 3.1.5.RELEASE | 4.0.10, 4.1.3, 4.2.0 (19 November, manage 3.1.7.RELEASE) |
GHSA-fhmg-2q5h-6v7w only affects apps that don’t use the Spring integration (OGNL expressions). GHSA-w6gj-rhv6-hwgj and GHSA-wwq2-cvmm-4x5q only affect apps that do (Spring EL). GHSA-77qc-v5v5-29hc also needs Unbescape 1.1.8.RELEASE, which 3.1.6 depends on.
Technical analysis
What restricted mode is for
Thymeleaf evaluates some expressions in a restricted mode because they’re places where user input tends to leak in. Among other things, restricted mode forbids access to request parameters and to the template context object (#ctx, #root). If a developer writes th:utext="${__${param.section}__}", or builds a view name like "user/" + lang + "/welcome" from a request parameter, an attacker gets SSTI. Restricted mode is what’s meant to stop that injection from reaching Java classes. Thymeleaf calls it defense in depth and says apps must never pass unvalidated input to the engine. Each bypass below matters only in apps that break that rule, and in those apps it’s the difference between a contained injection and code execution.
GHSA-2wmw-5fmc-m25v (CVE-2026-136410): #conversions could target any class
Thymeleaf doesn’t say which commits fix which advisory. The 3.1.6 commits that match the critical advisory’s wording (“restrict the scope of specific accessible objects”) are fc91b5e and 4ccfba6, both titled as conversions-utility scope changes. They lock down the #conversions expression object.
In 3.1.5, Conversions.convert(target, className) loaded whatever class name the expression gave it, retried with a java.lang. prefix, and handed the value to the configured conversion service. Nothing checked the target type against the type restrictions that apply to the rest of the expression language:
// lib/thymeleaf/src/main/java/org/thymeleaf/expression/Conversions.java, 3.1.5.RELEASE
public Object convert(final Object target, final String className) {
try {
final Class<?> clazz = ClassLoaderUtils.loadClass(className);
return convert(target, clazz);
} catch (final ClassNotFoundException e) {
try {
final Class<?> clazz = ClassLoaderUtils.loadClass("java.lang." + className);
return convert(target, clazz);
} ...
Expressions are subject to type restrictions, but conversion targets weren’t, so an injected expression could ask the conversion service to produce an object of a type it wasn’t allowed to touch directly. The first commit applies the normal “forbidden type” list to every conversion target (“Conversion target types are subject to the same type restrictions as expressions”). The second adds a separate restricted instance that only accepts an allowlist of value types, and also checks array component types, because converting to Foo[] converts each element to Foo:
public Object convert(final Object target, final Class<?> clazz) {
checkConversionAllowed(clazz.getName());
+ Class<?> componentType = clazz.getComponentType();
+ while (componentType != null) {
+ checkConversionAllowed(componentType.getName());
+ componentType = componentType.getComponentType();
+ }
...
- private static void checkConversionAllowed(final String className) {
- if (ExpressionUtils.isTypeForbidden(className)) {
+ private void checkConversionAllowed(final String className) {
+ // In restricted mode, only an allowlist of value types can be used as conversion targets.
+ if (this.restricted) {
+ if (!ExpressionUtils.isTypeAllowedForRestrictedInstantiation(className)) {
+ throw new TemplateProcessingException(...);
+ }
+ } else if (ExpressionUtils.isTypeForbidden(className)) {
In the Spring integrations, ThymeleafEvaluationContext.lookupVariable() now returns the restricted variant whenever restricted mode asks for conversions:
+ static final Set<String> RESTRICTED_VARIANT_VARIABLE_NAMES =
+ Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
+ StandardExpressionObjectFactory.CONVERSIONS_EXPRESSION_OBJECT_NAME)));
...
if (this.variableAccessRestricted) {
if (RESTRICTED_VARIABLE_NAMES.contains(name)) {
throw new EvaluationException(...);
}
+ if (RESTRICTED_VARIANT_VARIABLE_NAMES.contains(name)) {
+ return lookupRestrictedVariant(this.expressionObjects, name);
+ }
}
The advisory credits LHeiakim and Daniel Birtwhistle. Thymeleaf hasn’t published a proof of concept, and we found no public exploit repository for CVE-2026-136410 on 25 November.
GHSA-mvwv-34qr-qx5x and GHSA-6xr7-8ph3-q2g2: restricted mode not applied at all
Thymeleaf documents that unescaped inlined expressions ([(${...})]) and every output expression in TEXT template mode run in restricted mode. Depending on where an inlined expression sat in the template and which dialects were configured, some ran unrestricted. Commit 415e031 (“Apply expression execution modes consistently in inlined expressions”) makes inlined expressions always use the same mode as the equivalent th:text or th:utext. This bug goes back to 3.0.0.
The link-expression bug is the same idea. When @{...} appeared inside a restricted context, parts of it were evaluated without the restrictions. Commit 557041b (“Apply expression execution modes consistently in link expression parameters”) fixes it.
Both are rated high (CVSS 3.1 8.1). In an app with injection into a restricted context, they skip the guard entirely instead of finding a gap in it.
The rest
- GHSA-w6gj-rhv6-hwgj (medium). The April fix for CVE-2026-40477 blocked
#ctxby name. In Spring apps, an expression object from the Spring Security extras exposes the same context object another way, and restricted mode didn’t stop calls on it. - GHSA-fhmg-2q5h-6v7w (medium) completes the CVE-2026-40477 fix for OGNL (non-Spring) apps. GHSA-wwq2-cvmm-4x5q (low) closes request-parameter access from restricted Spring EL.
- GHSA-3q42-4cjm-hg9p (medium, XSS). Thymeleaf evaluates
th:on*event-handler attributes under extra restrictions, but its list of event-handler names was incomplete. Commitab73306adds dozens, includingonanimationend,onauxclick,onbeforeinput,oncopyandoncut. In HTML mode, any otheron*attribute set through Thymeleaf’s default attribute processor now runs with unsafe results forbidden too. - GHSA-77qc-v5v5-29hc (medium, XSS). Escaped JavaScript inlining (
[[${...}]]insideth:inline="javascript") didn’t escape<in string literals, so text output inside a<script>element could change how the browser parses the rest of the page. All serializers now emit\u003C. Thymeleaf says apps with Jackson on the classpath, which includes most Spring Boot apps, can only fix this by upgrading Thymeleaf. - GHSA-f79q-9862-cq4c (low, fixed in 3.1.7). Cached parsed expressions could keep the evaluation state of a less restrictive context and reuse it in a restricted one.
IOCs
These are library vulnerabilities, not a malware campaign, and there are no reports of exploitation. When hunting for SSTI attempts against Thymeleaf apps, look in access logs and WAF logs for request parameters or path segments that contain:
__${or}__(preprocessing)#conversions,#ctx,#root,#requestorT((expression objects and type references)[(or[[(inlining syntax) and~{or::(fragment expressions) in values that should be plain text
Detection and remediation
Find the Thymeleaf versions you ship:
# Maven
mvn -q dependency:tree -Dincludes=org.thymeleaf,org.thymeleaf.extras
# Gradle
./gradlew -q dependencyInsight --dependency org.thymeleaf:thymeleaf
./gradlew -q dependencyInsight --dependency org.thymeleaf.extras:thymeleaf-extras-springsecurity6
# Built Spring Boot jars and container images
unzip -l app.jar | grep -E 'BOOT-INF/lib/thymeleaf[^/]*\.jar'
Anything older than 3.1.7.RELEASE needs an upgrade. On Spring Boot 4.x, move to 4.0.10, 4.1.3 or 4.2.0. On Boot 3.5.x, override the managed versions:
<!-- Maven, Spring Boot parent -->
<properties>
<thymeleaf.version>3.1.7.RELEASE</thymeleaf.version>
<thymeleaf-extras-springsecurity.version>3.1.7.RELEASE</thymeleaf-extras-springsecurity.version>
</properties>
// Gradle with the Spring dependency-management plugin
ext['thymeleaf.version'] = '3.1.7.RELEASE'
ext['thymeleaf-extras-springsecurity.version'] = '3.1.7.RELEASE'
Find the code that makes these bypasses reachable:
# View or fragment names built from input (the classic Spring + Thymeleaf SSTI)
grep -rnE 'return\s+"[^"]*"\s*\+' src/main/java --include='*Controller*.java'
grep -rnE 'new ModelAndView\([^)]*\+' src/main/java
# Preprocessing, unescaped output, inlining and dynamic fragments in templates
grep -rnE '__\$\{|th:utext|\[\(\$\{|~\{\$\{|th:(replace|insert)="\$\{' src/main/resources/templates
grep -rnE 'th:on[a-z]+=' src/main/resources/templates
Any match where the value comes from a request parameter, header, path variable or stored user content is worth fixing directly, even after upgrading: validate the value against an allowlist before it reaches the template engine.
Timeline
- 2026-04-15 and 2026-04-29: Thymeleaf publishes three critical restricted-mode advisories (CVE-2026-40477, CVE-2026-40478, CVE-2026-41901), fixed in 3.1.4 and 3.1.5.
- 2026-11-02 and 2026-11-03: The restricted-mode, conversions and event-handler fixes are committed.
- 2026-11-08 20:11 UTC: Thymeleaf 3.1.6.RELEASE is released. Eight GitHub security advisories follow between 21:42 and 21:46 UTC.
- 2026-11-10: Spring Boot’s maintenance branches pick up Thymeleaf 3.1.6.RELEASE.
- 2026-11-11: Thymeleaf 3.1.7.RELEASE is released at 19:48 UTC with GHSA-f79q-9862-cq4c published at 20:54 UTC.
- 2026-11-12: Spring Boot’s branches move to 3.1.7.RELEASE.
- 2026-11-19: Spring Boot 4.0.10, 4.1.3 and 4.2.0 are published with Thymeleaf 3.1.7.RELEASE.
- 2026-11-24 18:45 UTC: VulnCheck publishes CVE-2026-136410 for GHSA-2wmw-5fmc-m25v. NVD adds it at 19:18 UTC.
- 2026-11-25: The GitHub Advisory Database still lists only the April advisories for
org.thymeleaf:thymeleaf.
References
- GHSA-2wmw-5fmc-m25v (CVE-2026-136410)
- VulnCheck advisory for CVE-2026-136410
- NVD: CVE-2026-136410
- GHSA-mvwv-34qr-qx5x
- GHSA-6xr7-8ph3-q2g2
- GHSA-f79q-9862-cq4c
- thymeleaf commit fc91b5e
- thymeleaf commit 4ccfba6
- Thymeleaf 3.1.6.RELEASE
- Thymeleaf 3.1.7.RELEASE
- Spring Boot commit 878289c: Upgrade to Thymeleaf 3.1.7.RELEASE
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.
References
- GHSA-2wmw-5fmc-m25v: Improper restriction of the scope of specific potentially harmful objects in Thymeleaf expressions (critical)
- VulnCheck: Thymeleaf before 3.1.6.RELEASE restricted expression mode bypass via expression objects (CVE-2026-136410)
- NVD: CVE-2026-136410
- GHSA-mvwv-34qr-qx5x: Incomplete application of restricted mode to inlined expressions (high)
- GHSA-6xr7-8ph3-q2g2: Incomplete application of restricted mode to link expressions (high)
- GHSA-f79q-9862-cq4c: Inconsistent application of expression restrictions to cached expressions (fixed in 3.1.7)
- thymeleaf/thymeleaf commit fc91b5e: Improve scope in conversions utility
- thymeleaf/thymeleaf commit 4ccfba6: Conversions utility scope
- Thymeleaf 3.1.6.RELEASE
- Thymeleaf 3.1.7.RELEASE
- spring-projects/spring-boot commit 878289c: Upgrade to Thymeleaf 3.1.7.RELEASE