---
title: "CVE-2026-40477: Improper restriction of the scope of accessible objects in Thymeleaf expressions"
url: https://erroneo.us/security/cve/CVE-2026-40477/
description: "CVE-2026-40477 (org.thymeleaf:thymeleaf (Maven)): Thymeleaf is a server-side Java template engine for web and standalone environments. Versions…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-04-17
date_modified: 2026-08-17
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-40477"
kev: false
cvss: 9.1
epss: 0.00944
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-40477: Improper restriction of the scope of accessible objects in Thymeleaf expressions

**Signal:** Critical and remotely reachable. No known exploitation yet, but it is network-reachable without credentials. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- No confirmed exploitation. It is not in CISA’s KEV catalog and CISA’s SSVC assessment records no known exploitation. That can change quickly after a public write-up; re-check if you are affected.
- EPSS 0.9% , percentile 61: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 61% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
- Only applies if your dependency tree includes org.thymeleaf:thymeleaf (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE ; org.thymeleaf:thymeleaf-spring5 (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE ; org.thymeleaf:thymeleaf-spring6 (Maven) <= 3.1.3.RELEASE, fixed in 3.1.4.RELEASE . Check your lockfile, including transitive dependencies.

## What it is

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 packages

- Maven `org.thymeleaf:thymeleaf` <= 3.1.3.RELEASE → fixed: 3.1.4.RELEASE
- Maven `org.thymeleaf:thymeleaf-spring5` <= 3.1.3.RELEASE → fixed: 3.1.4.RELEASE
- Maven `org.thymeleaf:thymeleaf-spring6` <= 3.1.3.RELEASE → fixed: 3.1.4.RELEASE

## Affected products (CVE record)

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

## Severity

- GitHub_M CVSS 3.1: 9.1 `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`
- redhat-SADP CVSS 3.1: 8.5 `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`
- GitHub CVSS 3.1: 9.0 `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation none , automatable no , technical impact total .
- FIRST EPSS (model of 2026-10-21): 0.94% probability of exploitation activity in the next 30 days; percentile 61.

## Sources

- [access.redhat.com](https://access.redhat.com/errata/RHSA-2026:21772)
- [GitHub Advisory GHSA-r4v4-5mwr-2fwr](https://github.com/advisories/GHSA-r4v4-5mwr-2fwr)
- [CVE.org record CVE-2026-40477](https://www.cve.org/CVERecord?id=CVE-2026-40477)
- [NVD entry CVE-2026-40477](https://nvd.nist.gov/vuln/detail/CVE-2026-40477)
- [github.com](https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr)
- [access.redhat.com](https://access.redhat.com/security/cve/CVE-2026-40477)
- [RHBZ#2459344](https://bugzilla.redhat.com/show_bug.cgi?id=2459344)
- [security.access.redhat.com](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40477.json)

---
Source page: https://erroneo.us/security/cve/CVE-2026-40477/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
