Security

A converter that builds objects: Thymeleaf restricted expression mode bypass (CVE-2026-136410)

Artem Safonov
Artem Safonov , Threat Analyst
A converter that builds objects: Thymeleaf restricted expression mode bypass (CVE-2026-136410)
Cover © Anonhaven

Thymeleaf 3.1.6.RELEASE closes a critical bypass of the template engine's restricted expression mode, now tracked as CVE-2026-136410. VulnCheck assigned the number on November 24, 2026 and scored the bug 9.5 under CVSS 4.0. The maintainer's own advisory, published on November 8, rates it 9.0 under CVSS 3.1.

Exploitation has a hard precondition. The application must already pass unvalidated user input into a Thymeleaf expression, which is a server-side template injection (SSTI) bug in that application. No account is needed, and both score vectors set attack complexity to high.

The Thymeleaf advisory GHSA-2wmw-5fmc-m25v names no object and gives no reproduction steps. The commits between 3.1.5 and 3.1.6 point at one helper, #conversions, which could load any class by name inside restricted expressions. That link between the advisory and the helper is our reading of the code, not a vendor statement.

What restricted mode promises to stop

Thymeleaf is a server-side Java template engine. Spring Boot ships it through spring-boot-starter-thymeleaf and pins its version in the Boot dependency list. Expressions inside templates run on the Spring Expression Language (SpEL) in Spring applications and on OGNL (Object-Graph Navigation Language) everywhere else.

Restricted mode switches on by itself in the places where injected text tends to land. The project's SECURITY.md lists preprocessing __...__, unescaped output th:utext, th:on* event handlers and arbitrary-name attribute creation. Template and fragment names, fragment parameters, URL bases and all expressions in TEXT template mode are covered too.

Inside those contexts the engine forbids five things. They are object instantiation, static access, request parameters via ${param.*}, bean access via @beanName and certain context-level utility objects. The CVE record names a shorter set of contexts (preprocessing, th:utext, th:on* handlers, fragment names, TEXT templates) than the policy file does.

In code the mode is a set of four boolean flags. StandardExpressionExecutionContext.RESTRICTED in 3.1.5 (lines 42 and 43) sets the first two, restrictVariableAccess and restrictExternalAccess, to true. Lines 42 to 54 declare six mode constants, RESTRICTED, RESTRICTED_FORBID_UNSAFE_EXP_RESULTS, NORMAL and three WITH_TYPE_CONVERSION variants.

Thymeleaf's expressions fail to properly restrict the scope of specific accessible objects that could be indirectly used for performing actions forbidden in restricted mode.

— Thymeleaf advisory GHSA-2wmw-5fmc-m25v, published by maintainer Daniel Fernández

Where the fix points: Conversions.convert() loads any class name

#conversions is one of Thymeleaf's expression utility objects. Templates call it to turn a value into another type. In 3.1.5 the class behind it consists of a constructor and two methods.

    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);
            } catch (final ClassNotFoundException ex) {
                throw new IllegalArgumentException("Cannot convert to class '" + className + "'", e);
            }
        }

    }


    public Object convert(final Object target, final Class<?> clazz) {

        final IStandardConversionService conversionService =
                StandardExpressions.getConversionService(this.context.getConfiguration());
        return conversionService.convert(this.context, target, clazz);
    }

Conversions.java, lines 61 to 83, tag thymeleaf-3.1.5.RELEASE (commit 10f9dd2). Full path lib/thymeleaf/src/main/java/org/thymeleaf/expression/Conversions.java.

The string overload hands the caller's text straight to ClassLoaderUtils.loadClass(className). If that fails, it retries with a java.lang. prefix. The second overload fetches the configured conversion service and calls conversionService.convert(this.context, target, clazz). Neither method compares the class against any list.

The 3.1.5 class has one constructor, Conversions(IExpressionContext), on lines 52 to 56. Nothing tells the object whether the calling expression is restricted. StandardExpressionObjectFactory registers the name "conversions" on line 81 and lists it on line 117. Lines 215 to 217 build it with new Conversions(context), identically for all callers.

Five blocked names, and conversions was not among them

Spring builds resolve each #name reference in ThymeleafEvaluationContext.lookupVariable(). Before each evaluation, SPELVariableExpressionEvaluator copies the restricted flag into that context on line 259 with setVariableAccessRestricted(expContext.getRestrictVariableAccess()). The lookup then consults a fixed set of five names.

    static final Set<String> RESTRICTED_VARIABLE_NAMES =
            Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
                    StandardExpressionObjectFactory.CONTEXT_EXPRESSION_OBJECT_NAME,
                    StandardExpressionObjectFactory.VARIABLES_EXPRESSION_OBJECT_NAME,
                    StandardExpressionObjectFactory.ROOT_EXPRESSION_OBJECT_NAME,
                    StandardExpressionObjectFactory.THIS_EXPRESSION_OBJECT_NAME,
                    StandardExpressionObjectFactory.EXECUTION_INFO_OBJECT_NAME)));
    @Override
    public Object lookupVariable(final String name) {
        if (this.variableAccessRestricted) {
            if (RESTRICTED_VARIABLE_NAMES.contains(name)) {
                throw new EvaluationException(
                        String.format("Access to variable '%s' is forbidden in this context.", name));
            }
        }
        if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) {
            final Object result = this.expressionObjects.getObject(name);
            if (result != null) {
                return result;
            }
        }
        // fall back to superclass
        return super.lookupVariable(name);
    }

ThymeleafEvaluationContext.java, lines 91 to 97 and lines 194 to 210, tag thymeleaf-3.1.5.RELEASE. Full path lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/ThymeleafEvaluationContext.java.

The five constants stand for #ctx, #vars, #root, #this and #execInfo. Any other name falls through to this.expressionObjects.getObject(name). A restricted expression that asked for #conversions received the same unrestricted instance a trusted template gets.

The SpEL side of the same class was locked down with care. Its constructor (lines 160 to 167) builds a second, stripped-down SimpleEvaluationContext for restricted expressions. A code comment says it provides no constructor resolution, no type references T(...) and no bean references @bean.

Lines 232 to 270 then override five getters. In restricted mode getConstructorResolvers(), getMethodResolvers(), getPropertyAccessors(), getTypeLocator() and getBeanResolver() all return the stripped-down versions.

One getter is absent from that group. The 3.1.5 file never overrides getTypeConverter(), so restricted expressions keep the converter set on lines 136 and 137, new StandardTypeConverter(conversionService). That object wraps the Spring application's own ConversionService.

From a class name to a constructor call

SpringStandardConversionService.convertOther() is where Thymeleaf hands the work to Spring. Its helper getSpringConversionService() (lines 100 to 112) pulls the TypeConverter from the evaluation context.

    @Override
    protected <T> T convertOther(
            final IExpressionContext context,
            final Object object, final Class<T> targetClass) {

        if (object == null) {
            return null;
        }
        final TypeDescriptor objectTypeDescriptor = TypeDescriptor.forObject(object);
        final TypeDescriptor targetTypeDescriptor = TypeDescriptor.valueOf(targetClass);
        final TypeConverter typeConverter = getSpringConversionService(context);
        if (typeConverter == null || !typeConverter.canConvert(objectTypeDescriptor, targetTypeDescriptor)) {
            return super.convertOther(context, object, targetClass);
        }
        return (T) typeConverter.convertValue(object, objectTypeDescriptor, targetTypeDescriptor);

    }

SpringStandardConversionService.java, lines 76 to 92, tag thymeleaf-3.1.5.RELEASE. Full path lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/SpringStandardConversionService.java.

Spring's ObjectToObjectConverter documents what a generic conversion to an arbitrary class does. The Javadoc below comes from Spring Framework 6.2.19, the version Thymeleaf 3.1.6 builds against (its pom.xml pins 6.2.19, 5.3.39 for Spring 5 and OGNL 3.4.17).

 * <h3>Conversion Algorithm</h3>
 * <ol>
 * <li>Invoke a non-static {@code to[targetType.simpleName]()} method on the
 * source object that has a return type assignable to {@code targetType}, if such
 * a method exists. For example, {@code org.example.Bar Foo#toBar()} is a
 * method that follows this convention.
 * <li>Otherwise invoke a <em>static</em> {@code valueOf(sourceType)} or Java
 * 8 style <em>static</em> {@code of(sourceType)} or {@code from(sourceType)}
 * method on the {@code targetType} that has a return type <em>related</em> to
 * {@code targetType}, if such a method exists. For example, a static
 * {@code Foo.of(sourceType)} method that returns a {@code Foo},
 * {@code SuperFooType}, or {@code SubFooType} is a method that follows this
 * convention. {@link java.time.ZoneId#of(String)} is a concrete example of
 * such a static factory method which returns a subtype of {@code ZoneId}.
 * <li>Otherwise invoke a constructor on the {@code targetType} that accepts
 * a single {@code sourceType} argument, if such a constructor exists.
 * <li>Otherwise throw a {@link ConversionFailedException} or
 * {@link IllegalStateException}.
 * </ol>

ObjectToObjectConverter.java, lines 41 to 59, Spring Framework tag v6.2.19. Third-party code, quoted to show the conversion algorithm. Full path spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java.

Read together, the two files describe object creation by another road. Spring may route a conversion through that converter. It first looks for a non-static to[TargetType]() method on the source object. Failing that, a static valueOf, of or from factory, or a single-argument constructor of the named class, then runs on the supplied value.

Restricted mode removes constructor resolution and type references from SpEL, yet the conversion path never touches either.

How that primitive becomes code execution is not public. Neither Thymeleaf nor VulnCheck names a target class. As of November 25, 2026 we found no published report by LHeiakim and Daniel Birtwhistle and no public proof of concept. We did not build or test an exploit.

Attack chain and prerequisites

Followed through the 3.1.5 Spring code, the chain has five links.

An application places unvalidated input into an expression evaluated in a restricted context. Examples are th:utext and __...__ preprocessing.

SPELVariableExpressionEvaluator marks the evaluation context as restricted on line 259. It then calls exp.expression.getValue(thymeleafEvaluationContext, …) on line 275, 289 or 294.

The injected expression references #conversions. lookupVariable("conversions") finds no match in RESTRICTED_VARIABLE_NAMES and returns the ordinary Conversions object.

A call to convert(target, className) loads the class named by the attacker's string. Lines 61 to 66 apply no check.

SpringStandardConversionService.convertOther() passes value and class to Spring's TypeConverter. For arbitrary classes, ObjectToObjectConverter can then invoke a static factory or constructor of the target.

Thymeleaf's advisory describes the outcome in one phrase. An injection escalates "beyond the limits restricted mode is designed to enforce". The attacker needs network access to the vulnerable application and no credentials. CVSS 4.0 adds AT:P, meaning a precondition outside the attacker's control must hold.

Builds without Spring behave differently at the last link. The base class AbstractStandardConversionService refuses all target types except String. Its convertOther() on lines 86 to 90 of the 3.1.5 file only throws an IllegalArgumentException.

The code shows the dangerous half of #conversions only where a Spring conversion service is plugged in. Whether OGNL-only applications were exploitable through this object in practice remains unconfirmed. The advisory still lists all three artifacts as affected, and the fix touches the OGNL path as well.

The patch: a denylist in September, an allowlist in October

Daniel Fernández wrote the first change on September 6, 2026. Commit fc91b5e3e2746d5cae37696d8cfba88a954c9c67, titled "feat: Improve scope in conversions utility", edits one file with 17 additions and one deletion. It ships no tests.

@@ -77,10 +82,21 @@ public Object convert(final Object target, final String className) {
 
     public Object convert(final Object target, final Class<?> clazz) {
 
+        checkConversionAllowed(clazz.getName());
         final IStandardConversionService conversionService =
                 StandardExpressions.getConversionService(this.context.getConfiguration());
         return conversionService.convert(this.context, target, clazz);
     }
 
 
+    private static void checkConversionAllowed(final String className) {
+        // Conversion target types are subject to the same type restrictions as expressions.
+        if (ExpressionUtils.isTypeForbidden(className)) {
+            throw new TemplateProcessingException(
+                    "Type \"" + className + "\" cannot be used as a target for type conversion operations " +
+                    "(#conversions): access to this type is forbidden in expressions.");
+        }
+    }
+
+

Commit fc91b5e, Conversions.java, third hunk. The second hunk adds the same call before each loadClass() in the string overload, and the first only adds imports.

The new checkConversionAllowed() reuses ExpressionUtils.isTypeForbidden(), the denylist that already guarded type references. In 3.1.6 that list blocks prefixes such as java., javax., jakarta., jdk., com.sun., sun., org.springframework. and ognl., with exceptions for value classes. The check runs in normal and restricted mode alike.

A denylist did not survive as the final answer. Commit 4ccfba685959c74439dbad8aace7657c97c89e79, "fix: Conversions utility scope", carries an author date of October 5, 2026 (22:35 UTC). It changes ten files with 173 additions and 18 deletions, all production code with no tests, on top of parent ab73306a8068cc3f14b0d3e6f6aef6315d59932f.

Both commits landed on the 3.1-master branch on November 2, at 15:01 and 15:07 UTC. They were direct pushes. GitHub's API returns no pull request for either one.

@@ -83,15 +111,29 @@ public Object convert(final Object target, final String className) {
     public Object convert(final Object target, final Class<?> clazz) {
 
         checkConversionAllowed(clazz.getName());
+        // When the target is an array, the conversion service will also convert the elements to its component type,
+        // so this component type (at any array dimension) is also a conversion target that needs to be checked.
+        Class<?> componentType = clazz.getComponentType();
+        while (componentType != null) {
+            checkConversionAllowed(componentType.getName());
+            componentType = componentType.getComponentType();
+        }
         final IStandardConversionService conversionService =
                 StandardExpressions.getConversionService(this.context.getConfiguration());
         return conversionService.convert(this.context, target, clazz);
     }
 
 
-    private static void checkConversionAllowed(final String className) {
+    private void checkConversionAllowed(final String className) {
         // Conversion target types are subject to the same type restrictions as expressions.
-        if (ExpressionUtils.isTypeForbidden(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(
+                        "Type \"" + className + "\" cannot be used as a target for type conversion operations " +
+                        "(#conversions) in a restricted expression execution context.");
+            }
+        } else if (ExpressionUtils.isTypeForbidden(className)) {
             throw new TemplateProcessingException(
                     "Type \"" + className + "\" cannot be used as a target for type conversion operations " +
                     "(#conversions): access to this type is forbidden in expressions.");

Commit 4ccfba6, lib/thymeleaf/src/main/java/org/thymeleaf/expression/Conversions.java, hunk at old line 83. The hunk before it, at old line 62, changes the string overload as described below.

Conversions gains a restricted field and a second constructor, Conversions(IExpressionContext, boolean), on lines 77 to 81 of the 3.1.6 file. A restricted instance accepts a conversion target only if a new allowlist function approves it.

@@ -234,6 +263,16 @@ public static boolean isTypeForbidden(final String typeName) {
     }
 
 
+    // Allowlist of the types that can be used as instantiation targets in certain scenarios of restricted expression
+    // execution mode: the allowed classes and interfaces, matched by fully qualified name, so implementations
+    // of an allowed interface are not allowed unless they are allowed classes themselves.
+    public static boolean isTypeAllowedForRestrictedInstantiation(final String typeName) {
+        Validate.notNull(typeName, "Type name cannot be null");
+        final String normalizedTypeName = normalize(typeName, false);
+        return ALLOWED_JAVA_CLASS_NAMES.contains(normalizedTypeName) || ALLOWED_JAVA_SUPERS_NAMES.contains(normalizedTypeName);
+    }

Commit 4ccfba6, lib/thymeleaf/src/main/java/org/thymeleaf/util/ExpressionUtils.java. In the 3.1.6 file the function starts on line 279.

The allowlist is ALLOWED_JAVA_CLASS_NAMES plus ALLOWED_JAVA_SUPERS_NAMES. It holds value types such as Integer, String, BigDecimal, UUID and Locale, common collections, and interfaces like List and Map. The commit adds 16 java.time classes, from LocalDate to ZoneOffset, so date conversions keep working. Matching is by fully qualified name, so an implementation of an allowed interface does not pass.

Arrays get their own treatment. convert(Object, Class) now walks getComponentType() at each dimension and checks each one, because Spring converts array elements too. A new ExpressionUtils.componentTypeName() (line 225 in 3.1.6) reduces both [[Ljava.lang.String; and java.lang.String[][] to the element type before the denylist runs. isJavaPackage() gained a length check for names shorter than five characters.

Simple names needed one special case. In restricted mode a bare 'String' cannot be matched against fully qualified entries before resolution. The 3.1.6 code (lines 87 to 92) skips the early check for names without a dot and always validates the resolved class.

The second half of the fix changes which object a restricted expression receives. IExpressionObjects.RESTRICTED_NAME_MODIFIER defines the suffix "[restricted]". StandardExpressionObjectFactory registers conversions[restricted] under RESTRICTED_CONVERSIONS_EXPRESSION_OBJECT_NAME (lines 88, 126, 227 and 228) and builds it with new Conversions(context, true).

+    static Object lookupRestrictedVariant(final IExpressionObjects expressionObjects, final String name) {
+        final String restrictedName = name + IExpressionObjects.RESTRICTED_NAME_MODIFIER;
+        return (expressionObjects != null && expressionObjects.containsObject(restrictedName) ?
+                    expressionObjects.getObject(restrictedName) : null);
+    }
+
+
     @Override
     public Object lookupVariable(final String name) {
         if (this.variableAccessRestricted) {
@@ -196,6 +208,9 @@ public Object lookupVariable(final String name) {
                 throw new EvaluationException(
                         String.format("Access to variable '%s' is forbidden in this context.", name));
             }
+            if (RESTRICTED_VARIANT_VARIABLE_NAMES.contains(name)) {
+                return lookupRestrictedVariant(this.expressionObjects, name);
+            }
         }
         if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) {
             final Object result = this.expressionObjects.getObject(name);

Commit 4ccfba6, lib/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/expression/ThymeleafEvaluationContext.java. In the 3.1.6 file these are lines 199 to 218 (added lines 199 to 203 and 213 to 215), with the new name set on line 102.

The lookup fails closed. If no restricted variant is registered, lookupRestrictedVariant() returns null and never falls back to the ordinary object. The commit applies the same edit to ThymeleafEvaluationContext in thymeleaf-spring5. Both ThymeleafEvaluationContextWrapper classes gain only the three-line lookup branch, which calls ThymeleafEvaluationContext.lookupRestrictedVariant().

A blocked conversion now throws a TemplateProcessingException. Its message says the type "cannot be used as a target for type conversion operations (#conversions) in a restricted expression execution context".

What changed for OGNL builds

OGNLExpressionObjectsWrapper carried the same five-name list on lines 43 to 49. Its get() method (lines 76 to 88) had the same gap. The 3.1.5 class learned that an expression was restricted in a fragile way. Its private restrictExpressionObjects() on lines 96 to 98 returned super.containsKey(OGNLContextPropertyAccessor.RESTRICT_EXPRESSION_OBJECTS).

The wrapper is itself the map behind the OgnlContext. OGNLVariableExpressionEvaluator created it on line 158 and then put or removed a marker key on lines 164 to 167. Whether restrictions applied therefore depended on an entry inside the map that expressions evaluate against.

Commit 4ccfba6 passes the flag through the constructor, new OGNLExpressionObjectsWrapper(context.getExpressionObjects(), expContext.getRestrictVariableAccess()). In 3.1.6 the variant set, field and constructor sit on lines 52 to 71, and the variant check in get() is on line 87. Fernández explains the reason in a code comment.

Set at construction (a wrapper is created for each evaluation) so that the restriction does not depend on the contents of this map, which backs the OgnlContext used during evaluation.

— Daniel Fernández, maintainer, Thymeleaf (code comment in commit 4ccfba6)

Reading the diff, the allowlist addresses the root cause for this object and not one payload. The design stays name-based, though. RESTRICTED_VARIANT_VARIABLE_NAMES holds a single entry, and the remaining utility objects still resolve to their normal instances in restricted mode.

Thymeleaf 3.1.5 swapped out five SpEL extension points for restricted expressions and left one helper that takes a class name as a string. A sandbox built on the expression parser is only as tight as the least-audited object reachable from it.

— AnonHaven Editorial Team

Fourth critical expression-restriction bypass since April

CVE-2026-136410 is the fourth critical bypass of Thymeleaf's expression restrictions in 2026. CVE-2026-40477, reported by Thomas Reburn of Praetorian, and CVE-2026-40478, reported by Dawid Bakaj of VIPentest.com, were published on April 15 and fixed in 3.1.4.RELEASE. CVE-2026-41901 followed on April 29, credited to GitHub user cristianstaicu, with a fix in 3.1.5.RELEASE. Each carries a CVSS 3.1 score of 9.0.

Release 3.1.6 arrived on November 8 with eight security advisories. The list below comes from the project's GitHub advisory feed. Only the first entry has a CVE number so far.

Advisory Fixed in 3.1.6.RELEASE CVSS 3.1
GHSA-2wmw-5fmc-m25v Scope of specific potentially harmful objects in expressions (CVE-2026-136410) 9.0 Critical
GHSA-6xr7-8ph3-q2g2 Restricted mode not fully applied to link expressions @{...} 8.1 High
GHSA-mvwv-34qr-qx5x Restricted mode not applied to some inlined expressions 8.1 High
GHSA-3q42-4cjm-hg9p Incomplete coverage of HTML event-handler attributes (XSS) 6.1 Medium
GHSA-w6gj-rhv6-hwgj Context object reachable through the Spring Security integration 5.9 Medium
GHSA-fhmg-2q5h-6v7w Context-level objects reachable in OGNL builds, completing the CVE-2026-40477 fix 5.9 Medium
GHSA-77qc-v5v5-29hc Escaping of < in JavaScript inlining 4.7 Medium
GHSA-wwq2-cvmm-4x5q Request parameter access in Spring restricted expressions 3.1 Low

GitHub counts 61 commits between the 3.1.5 and 3.1.6 tags. The compare API caps its file list at 300 entries, so the totals are a lower bound. They show at least 1,750 added and 260 removed lines of library code, plus 167 test files with 4,219 additions and 153 deletions. The release notes consist of a link to milestone 74.

The severity score sits awkwardly next to the project's own policy. Commit 166b77f of July 22, 2026 added a section to SECURITY.md on how such bypasses are scored. It calls the restrictions "defense-in-depth, not a primary security boundary".

Such a defect will not be scored as a standalone, unauthenticated, network-reachable framework Remote Code Execution.

— Thymeleaf security policy, SECURITY.md as shipped with 3.1.6.RELEASE

The same bullet limits its own reach. It calls itself "a statement about attribution and attack complexity, not about technical impact". The policy adds that "the code-execution potential of a bypass is acknowledged".

Advisory GHSA-2wmw-5fmc-m25v nevertheless sets privileges required to none and lands at 9.0 Critical. The policy calls itself "prospective" and covers only reports assessed after its publication. When LHeiakim's report reached the project is not public.

The GitHub repository has 2,984 stars and 519 forks. The deps.dev index counts 686 dependents of org.thymeleaf:thymeleaf 3.1.5.RELEASE in total. It reports 78 direct and 615 indirect dependents, and the two counts overlap. Download or install numbers were not available to us.

No attacks have been reported. The CISA Known Exploited Vulnerabilities (KEV) catalog does not list the bug. Its EPSS exploit-prediction score stood at 0.00911 as of November 25, 2026.

Affected versions and fixed builds

Parameter Value
CVE CVE-2026-136410, assigned by VulnCheck on November 24, 2026
Affected artifacts org.thymeleaf:thymeleaf, thymeleaf-spring5, thymeleaf-spring6, versions up to 3.1.5.RELEASE
Fixed in 3.1.6.RELEASE, November 8, 2026
Recommended 3.1.7.RELEASE, November 11, 2026
CVSS 3.1 9.0, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS 4.0 9.5, CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Weakness CWE-917, CWE-1336
Spring Boot 3.5.9 Manages Thymeleaf 3.1.3.RELEASE, vulnerable
Spring Boot 4.0.10, 4.1.3, 4.2.0 Manage Thymeleaf 3.1.7.RELEASE
Exploitation Not in CISA KEV, no public proof of concept found

The advisory marks all releases up to and including 3.1.5.RELEASE as vulnerable in all three artifacts. Its vector is CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H, and it lists CWE-917 (expression language injection) and CWE-1336. The CVE record carries CWE-917 alone and adds the 4.0 vector CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H.

Older branches get no separate statement. The CVE record marks everything from version 0 to below 3.1.6.RELEASE as affected. Thymeleaf's policy says that "in general, only the latest minor version" is supported and receives security patches. Users of 3.0.x should not count on a backport.

Release 3.1.6.RELEASE went out on November 8 at 20:11 UTC, and the advisory followed at 21:42 UTC. On GitHub the advisory page still reads "No known CVE". VulnCheck reserved and published the identifier 16 days later, on November 24 between 18:15 and 18:45 UTC.

Credit differs slightly between sources. The advisory text thanks LHeiakim and Daniel Birtwhistle, its structured credits field lists LHeiakim alone as reporter, and VulnCheck names both.

Version 3.1.7.RELEASE followed on November 11 at 19:48 UTC. It fixes GHSA-f79q-9862-cq4c, a low-severity (3.7) flaw in which cached expressions could run under the looser restrictions of an earlier evaluation. That advisory states that versions up to 3.1.6.RELEASE are affected.

What to do

Upgrade thymeleaf, thymeleaf-spring5 and thymeleaf-spring6 together, to 3.1.7.RELEASE where possible and to 3.1.6.RELEASE at minimum. Thymeleaf states that no workaround exists beyond keeping unvalidated input away from the template engine.

Spring Boot users should check which version their Boot release manages. Tags v4.0.10, v4.1.3 and v4.2.0 (November 19, 2026) declare library("Thymeleaf", "3.1.7.RELEASE"). Tag v3.5.9 of December 18, 2025, the latest open-source 3.5 tag we found, still declares 3.1.3.RELEASE for thymeleaf and thymeleaf-spring6.

On such a Boot line, override the managed version. Spring Boot's documentation lists the property thymeleaf.version for that purpose. Then confirm the result with mvn dependency:tree or gradle dependencies and look at the version of each thymeleaf-*.jar.

A patched jar is recognizable from its API. It contains the constructor Conversions(IExpressionContext, boolean) and the constant StandardExpressionObjectFactory.RESTRICTED_CONVERSIONS_EXPRESSION_OBJECT_NAME, both new in 3.1.6.

Thymeleaf publishes no indicators of compromise for this bug. After the upgrade, the exception text quoted above is the one signal the code itself produces. A TemplateProcessingException mentioning #conversions and "restricted expression execution context" in application logs means some expression asked for a non-allowlisted type.

The upgrade does not fix the injection itself. SECURITY.md puts validation of all external data on the application, "regardless of where or how it will eventually appear in a template". The file names template names, view names, fragment names, fragment parameters, expression fragments and template content as places to audit.

Primary sources are the Thymeleaf advisory, the VulnCheck advisory and the 3.1.6.RELEASE tag.

Table of Contents
  1. Contents are built when the page loads

Have a story? Become a contributor.

We work with independent researchers and cybersecurity professionals. Send us a tip or submit your article for editorial review.

Questions on the topic

What is CVE-2026-136410 in Thymeleaf?
CVE-2026-136410 is a critical bypass of Thymeleaf's restricted expression mode, scored 9.5 under CVSS 4.0. It lets an attacker who can already inject input into a Thymeleaf expression escape the limits that mode enforces.
Which Thymeleaf versions fix CVE-2026-136410?
Thymeleaf 3.1.6.RELEASE, released on November 8, 2026, fixes CVE-2026-136410 in thymeleaf, thymeleaf-spring5 and thymeleaf-spring6. Version 3.1.7.RELEASE adds a further fix for cached expressions and is the recommended target.
Is my Spring Boot application affected by the Thymeleaf CVE-2026-136410 bypass?
It is exposed only if it runs Thymeleaf 3.1.5.RELEASE or older and passes unvalidated user input into template expressions. Spring Boot 3.5.9 manages Thymeleaf 3.1.3.RELEASE, while 4.0.10, 4.1.3 and 4.2.0 manage the patched 3.1.7.RELEASE.