Keyrook

Thymeleaf flaw lets attackers break out of restricted mode — update Spring apps to 3.1.6

A flaw in Thymeleaf, CVE-2026-136410, scored 9.5 out of 10, lets an unauthenticated attacker bypass the template engine's restricted mode. The fix is Thymeleaf 3.1.6.RELEASE, published on 24 November 2026.

Diagram of a web browser sending a form to a Thymeleaf Java server, with a green shield marked 3.1.6 for the patched version
The flaw is in Thymeleaf up to 3.1.5.RELEASE. Version 3.1.6.RELEASE closes it.

Affects

  • Thymeleaf

Tracked as

  • CVE-2026-136410Thymeleaf · CVSS 9.5

A serious flaw has been found in Thymeleaf, the template engine used by many Java web applications, and the fix is a version bump. The flaw, tracked as CVE-2026-136410 and scored 9.5 out of 10, lets an attacker who needs no login break out of the safety limits Thymeleaf places on template expressions. The record for the flaw was published in the vulnerability database on 24 November 2026, and the fixed version, 3.1.6.RELEASE, is out now.

The Thymeleaf logo
Image: Thymeleaf

What happened

Thymeleaf turns templates into web pages, filling in values and running small expressions written by the application’s developers. Some parts of a template run in a restricted mode, where only a narrow set of actions is allowed. That limit exists so that even if attacker-controlled text slips into an expression, the damage stays contained.

The flaw breaks that containment. Thymeleaf failed to limit the scope of certain objects that expressions can reach, so an attacker who can get input into a restricted expression can use those objects to carry out actions the restricted mode is meant to forbid. The result is a server-side template injection that escapes its cage: the attacker can push past the designed limits and run code on the server.

The weakness is classed as CWE-917, improper control of the scope of an expression. It affects Thymeleaf up to and including 3.1.5.RELEASE, including the thymeleaf-spring5 and thymeleaf-spring6 packages. The attack needs no account and no login, and it works remotely over the network. The advisory names the places where a restricted expression can be abused: preprocessing, th:utext attributes, th:on event handlers, fragment names, and TEXT templates.

There is no workaround beyond not feeding unvalidated user input straight into the template engine, and the advisory is clear that upgrading is strongly recommended in any case. Neither the advisory nor the vulnerability record mentions attacks using this flaw in the wild.

What this means for you

Thymeleaf sits behind a large share of Java web applications, and Spring Boot projects commonly use it to render pages, so the flaw touches a lot of ordinary business software. That said, not every application using Thymeleaf can be attacked this way. The attacker first needs a path for their own text to reach a template expression, which happens when an application passes user input into expressions without checking it. Applications that keep user input out of expressions are not exposed in the same way.

For teams that do pass user input into templates, the risk is direct: a single crafted request, with no login, can turn a template injection into code running on the server. The score of 9.5 reflects that combination of remote access, no authentication, and a full escape from the safety limits.

What to do

  1. Check which Thymeleaf version your application uses. Look in your Maven pom.xml or Gradle build file for the thymeleaf, thymeleaf-spring5 or thymeleaf-spring6 version. Anything up to and including 3.1.5.RELEASE is affected.
  2. Update to 3.1.6.RELEASE. That is the fixed version for all three packages. Rebuild and redeploy the application after the update.
  3. If Spring Boot manages the version, override it. In your pom.xml, add a property named thymeleaf.version set to 3.1.6.RELEASE, then rebuild.
  4. Stop passing unvalidated user input into template expressions. Treat template expressions as code, not as a place to drop user text. Validate and escape input before it can reach a template.
  5. Review templates that use the risky spots. Pay attention to preprocessing, th:utext attributes, th:on event handlers, fragment names and TEXT templates, and confirm that no user-controlled value flows into them unchecked.

A spoken summary of what to do · 0:57

Sources

  1. Improper restriction of the scope of specific potentially harmful objects in Thymeleaf expressionsGitHub
  2. Thymeleaf 3.1.6.RELEASEGitHub

More news

All the news
  1. Patch Notes2 min

    Database for Contact Form 7 flaw lets visitors plant scripts for admins — update to 1.5.7

    A stored cross-site scripting flaw in Database for Contact Form 7, disclosed 28 November, lets unauthenticated visitors plant scripts that run when an administrator views entries — update to 1.5.7.

    • WordPress
  2. Patch Notes3 min

    Tenda AC10U router carries three flaws scored 10.0 — no fix, so replace it

    Three flaws in the Tenda AC10U router, disclosed 27 November, all score the maximum 10.0 and let attackers run commands or open Telnet without logging in — and Tenda has released no fix, so owners should replace the router.

    • Tenda
  3. Patch Notes3 min

    Upsell Funnel Builder flaw lets anyone inject scripts into WooCommerce checkout pages — update to 3.1.8

    Wordfence disclosed on 27 November an unauthenticated stored cross-site scripting flaw (CVE-2026-136995, scored 7.2) in Upsell Funnel Builder for WooCommerce. Update to 3.1.8.

    • WooCommerce