Skip to content
OpenAdvisories
Critical · 9.1 Exploited (EU) Public exploit CVE-2026-40477 EUVD-2026-23571GHSA-r4v4-5mwr-2fwr

Improper restriction of the scope of accessible objects in Thymeleaf expressions

Published Apr 17, 2026 · Updated Aug 17, 2026 · Assigned by GitHub_M

Description

Thymeleaf is a server-side Java template engine for web and standalone environments. Versions 3.1.3.RELEASE and prior contain a security bypass vulnerability in the expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly restrict the scope of accessible objects, allowing specific potentially sensitive objects to be reached from within a template. If an application developer passes unvalidated user input directly to the template engine, an unauthenticated remote attacker can bypass the library's protections to achieve Server-Side Template Injection (SSTI). This issue has ben fixed in version 3.1.4.RELEASE.

Affected products

VendorProductAffectedFixed
thymeleaf thymeleaf < 3.1.4.RELEASE —
thymeleaf org.thymeleaf:thymeleaf-spring5 < 3.1.4.RELEASE —
thymeleaf org.thymeleaf:thymeleaf-spring6 < 3.1.4.RELEASE —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

  • xiaoqiMikko/thymeleaf-check ★ 0 · Sep 4, 2026

    Offline checker for Thymeleaf CVE-2026-40477 / CVE-2026-41901 — tells you which of the two CVSS 9.0 SSTI flaws you are exposed to, and whether your version line has a fix at all (3.0.x: it does not)

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
Maven org.thymeleaf:thymeleaf < 3.1.4.RELEASE 3.1.4.RELEASE GHSA-r4v4-5mwr-2fwr
Maven org.thymeleaf:thymeleaf-spring5 < 3.1.4.RELEASE 3.1.4.RELEASE GHSA-r4v4-5mwr-2fwr
Maven org.thymeleaf:thymeleaf-spring6 < 3.1.4.RELEASE 3.1.4.RELEASE GHSA-r4v4-5mwr-2fwr

References