Code injectionin thymeleaf.
Proof of concept public (GitHub).
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.
- Upgrade thymeleaf to 3.1.4.RELEASE or later.
- Upgrade org.thymeleaf:thymeleaf-spring5 to 3.1.4.RELEASE or later.
- Upgrade org.thymeleaf:thymeleaf-spring6 to 3.1.4.RELEASE or later.
- Upgrade org.thymeleaf:thymeleaf (Maven) to 3.1.4.RELEASE or later.
Affected and fixed versions
From the CVE record, NVD and package advisories. When no source has versions yet, this table says "not confirmed" instead of guessing.
From first report to first attacks
- 13 Apr 2026CVE ID reserved by GitHub_M.
- 17 Apr 2026Published in the CVE List.
- 17 Aug 2026CVE record last updated.
- 4 Sep 2026First public proof of concept on GitHub.
Attack code anyone can find
Exploit maturity: Proof of concept (GitHub). CISA assessment (SSVC): exploitation none.
Listed so defenders can judge how urgent this is and test systems they are authorised to test. Patchminder does not host exploit code; links open the source page. Labels for GitHub repositories come from their public details and are never a promise about the code. Run anything only in an isolated lab.
Report a link
Other thymeleaf vulnerabilities
Same weakness: Expression language injection
- github.com x_refsource_CONFIRM
- access.redhat.com vdb-entry, x_refsource_REDHAT
- bugzilla.redhat.com issue-tracking, x_refsource_REDHAT
- security.access.redhat.com x_sadp-csaf-vex
- access.redhat.com vendor-advisory, x_refsource_REDHAT
Patchminder. CVE-2026-40477: Code injection in thymeleaf. https://patchminder.com/cve/cve-2026-40477/ (accessed 5 December 2026).