Cyber Resilience

CVE-2026-40477

CriticalRCEUpdated

Published: 17 April 2026

Published
17 April 2026
Modified
30 June 2026
KEV Added
Patch
CVSS Score v3.1 9.0 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H
EPSS Score 0.0065 46.5th percentile
Risk Priority 70 floored blend · peak EPSS

Summary

CVE-2026-40477 is a critical-severity Expression Language Injection (CWE-917) vulnerability in Thymeleaf Thymeleaf. Its CVSS base score is 9.0 (Critical).

Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked at the 46.5th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified are NIST 800-53 SI-10 (Information Input Validation) and SI-2 (Flaw Remediation).

Deeper analysis

CVE-2026-40477 is a security bypass vulnerability in the expression execution mechanisms of Thymeleaf, a server-side Java template engine used in web and standalone environments. It affects versions 3.1.3.RELEASE and prior. Although Thymeleaf provides mechanisms to prevent expression injection, it fails to properly restrict the scope of accessible objects, allowing potentially sensitive objects to be reached from within a template. Published on 2026-04-17, the vulnerability carries a CVSS v3.1 base score of 9.0 (AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H) and maps to CWE-917 (Expression/Command Injection with Improper Escaping) and CWE-1336 (Improper Neutralization of Special Elements).

An unauthenticated remote attacker can exploit this vulnerability if an application developer passes unvalidated user input directly to the Thymeleaf template engine. By injecting crafted expressions, the attacker bypasses the library's protections to achieve Server-Side Template Injection (SSTI), potentially leading to high-impact confidentiality, integrity, and availability compromises across a changed scope.

The vulnerability has been fixed in Thymeleaf version 3.1.4.RELEASE. Additional details are available in the GitHub security advisory at https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability details

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise TechniquesAI

T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1221 Template Injection Stealth
Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts.
Why these techniques?

CVE enables Server-Side Template Injection (SSTI) in a public-facing web application component (Thymeleaf), directly mapping to T1221 (Template Injection) and T1190 (Exploit Public-Facing Application).

Confidence: HIGH · MITRE ATT&CK Enterprise v19.0

CVEs Like This One

CVE-2026-40478Same product: Thymeleaf Thymeleaf
CVE-2026-41901Shared CWE-1336, CWE-917
CVE-2025-14700Shared CWE-1336
CVE-2026-21450Shared CWE-1336
CVE-2025-60355Shared CWE-1336
CVE-2025-67843Shared CWE-1336
CVE-2025-68929Shared CWE-1336
CVE-2025-68454Shared CWE-1336
CVE-2025-64087Shared CWE-1336
CVE-2026-27629Shared CWE-1336

Affected Assets

thymeleaf
thymeleaf
≤ 3.1.4

Mitigating Controls

Mitigating Controls (NIST 800-53 r5) AI

prevent

Directly mitigates CVE-2026-40477 by requiring timely patching of Thymeleaf to version 3.1.4.RELEASE, which fixes the failure to restrict scope of accessible objects.

prevent

Prevents SSTI exploitation by validating and sanitizing unvalidated user input before it is passed directly to the Thymeleaf template engine.

prevent

Enforces logical access controls to limit reachability of sensitive objects from within injected Thymeleaf expressions, mitigating the security bypass.

References