On this page (7 sections)

Thymeleaf, a widely used Java template engine, has a critical flaw tracked as CVE-2026-136410. According to the NVD record, versions before 3.1.6.RELEASE contain a restricted expression mode bypass that lets unauthenticated remote attackers perform actions that restricted mode is meant to forbid.

If you run a Java web application, an internal portal or a store backend that renders pages with Thymeleaf (often through Spring Boot), you should find out which Thymeleaf version it ships with and plan an upgrade. Only one publisher covers this story so far, so some details below are marked as unconfirmed.

What happened

The CVE was published on 2026-11-24. The NVD description says the problem lies in how Thymeleaf scopes expression objects when it runs in restricted expression mode. That mode exists to limit what template expressions can do, particularly when part of the input may come from users. The flaw means those limits can be sidestepped.

The project has published a 3.1.6.RELEASE release and a security advisory. A VulnCheck advisory also exists. The research available here contains only the NVD description, so read the project advisory for the authoritative list of changes and any workarounds.

Technical details in plain terms

Server-side template injection (SSTI) happens when attacker-controlled text ends up being evaluated as part of a template rather than treated as plain data. Thymeleaf's restricted expression mode is a guardrail for exactly this: in contexts where input is more likely to be untrusted, expressions are limited so they cannot perform dangerous actions.

According to NVD, the bypass works through improperly scoped expression objects. The record names several contexts where injected input can be used to escalate an SSTI condition:

  • Preprocessing expressions
  • th:utext (unescaped text output)
  • th:on* event handler attributes
  • Fragment names
  • TEXT mode templates

The CVE record does not describe what an attacker can ultimately achieve, such as code execution, and this article does not speculate on that. It also does not say how many applications pass user input into these contexts. In practice, risk depends on whether your templates ever build expressions, fragment names or unescaped output from request data.

Who is realistically exposed

Exposure needs two things: a vulnerable Thymeleaf version, and a template path where untrusted input reaches one of the contexts above. The NVD text says attackers need no authentication, so a public-facing page is the highest concern.

  • Spring Boot and Spring MVC applications that use the Thymeleaf starter, where the Thymeleaf version may be set by the framework's dependency management rather than by your own build file.
  • Apps that choose a template or fragment name from a request parameter.
  • Apps that render user-supplied content with th:utext or generate TEXT mode templates such as email bodies.
  • Vendor products and internal tools written in Java that bundle Thymeleaf inside a jar or war file, where you may not know it is there.
Using Thymeleaf alone does not prove you are exploitable. The research does not confirm how easily the bypass can be triggered in a typical application, so treat the upgrade as the fix and the code review as a way to prioritize.

How to check your version

For a Maven project, this prints the dependency tree filtered to Thymeleaf artifacts. Run it from the project root and look for any thymeleaf version lower than 3.1.6.RELEASE.

List Thymeleaf versions in a Maven project (run in the project root)Shell
mvn dependency:tree -Dincludes=org.thymeleaf

For a Gradle project, this shows which Thymeleaf version is resolved at runtime. Look for the same version threshold in the output.

List Thymeleaf versions in a Gradle project (run in the project root)Shell
./gradlew dependencies --configuration runtimeClasspath | grep -i thymeleaf

For a deployed application where you only have the packaged file, list the jar names inside it. The version is usually part of the file name, such as thymeleaf-3.x.y.RELEASE.jar. Replace app.jar with your file; war files work the same way.

Find bundled Thymeleaf jars in a packaged app (read-only)Shell
unzip -l app.jar | grep -i thymeleaf

Remember that a Spring Boot fat jar may contain Thymeleaf under a nested library folder, and that third-party software you did not build may bundle it too. Ask those vendors whether they ship 3.1.6.RELEASE or later.

What to do now

  1. Inventory every Java application that uses Thymeleaf, including vendor products and internal tools.
  2. Upgrade Thymeleaf to 3.1.6.RELEASE or later. If the version comes from your Spring Boot dependency management, override the Thymeleaf version property or move to a framework release that includes the fix, and check the project advisory for guidance.
  3. Rebuild, run your tests and redeploy. Then re-run the dependency check to confirm the old jar is no longer on the classpath.
  4. Review templates for places where request data reaches preprocessing expressions, th:utext, th:on* attributes, fragment names or TEXT templates, and replace them with fixed values or an allowlist.
  5. Prefer escaped output (th:text) over th:utext wherever you do not need raw HTML.
  6. Where you cannot patch yet, reduce exposure: restrict access to affected endpoints and put a web application firewall in front of the app as a temporary layer, not as a substitute for the upgrade.
  7. Ask vendors of bundled software for their patch status and timeline.
Caution. Redeploying an upgraded dependency restarts your application. Test in staging first, since a framework or template engine upgrade can change rendering behavior.

Detection and monitoring afterwards

The research gives no indicators of compromise and no reports of exploitation, so there is no known signature to hunt for. Reasonable general steps are to review web and application logs for unusual values in parameters that feed template or fragment names, watch for unexpected errors from the template engine, and check for new or modified files and outbound connections from the application host.

A security scan of your public site can help you keep track of what is exposed, and monitoring can alert you to certificate, DNS and header changes after you redeploy. Neither can see inside your Java dependencies, so the version check above is still needed. If you suspect a compromise, follow the steps in Website hacked: what to do.

What is still unknown

  • Who assigned the 9.5 CVSS score and with which vector; the research gives only the number.
  • Whether the flaw is being exploited. The record shows no CISA KEV listing, which is not proof that nobody is using it.
  • The full set of affected branches below 3.1.6.RELEASE. NVD says only 'before 3.1.6.RELEASE'.
  • Any workarounds. Check the project advisory for these.

This article will need updating if the project or other sources add details. For more security news and analysis, browse the Webforta blog.

Sources

This article is based on the public sources below. Details can change as vendors and researchers publish more; check the original advisories before acting on version numbers.

  1. CVE-2026-136410: Thymeleaf before 3.1.6.RELEASE contains a restricted expression mode bypass vulnerability that allows unauthenticated remote attackers to perform forbidden…nvd.nist.gov ·
  • Thymeleaf
  • CVE-2026-136410
  • Java
  • SSTI
  • Spring Boot