← Back to CVE Explorer

CVE-2026-40477

Full vulnerability record from the local CVENow database.

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.

Severity
CRITICAL
CVSS score
9.0 (v3.1)
Vulnerability status
Modified
Source identifier
Published
2026-04-17 22:16:33.500000
Last modified
2026-10-26 22:10:00.163000
View original CVE JSON
{
  "id": "CVE-2026-40477",
  "sourceIdentifier": "[email protected]",
  "published": "2026-04-17T22:16:33.500",
  "lastModified": "2026-10-26T22:10:00.163",
  "vulnStatus": "Modified",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "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."
    },
    {
      "lang": "es",
      "value": "Thymeleaf es un motor de plantillas Java del lado del servidor para entornos web y autónomos. Las versiones 3.1.3.RELEASE y anteriores contienen una vulnerabilidad de omisión de seguridad en los mecanismos de ejecución de expresiones. Aunque la biblioteca proporciona mecanismos para prevenir la inyección de expresiones, no logra restringir adecuadamente el alcance de los objetos accesibles, permitiendo que objetos específicos potencialmente sensibles sean alcanzados desde dentro de una plantilla. Si un desarrollador de aplicaciones pasa entrada de usuario no validada directamente al motor de plantillas, un atacante remoto no autenticado puede omitir las protecciones de la biblioteca para lograr la Inyección de Plantillas del Lado del Servidor (SSTI). Este problema ha sido corregido en la versión 3.1.4.RELEASE."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "thymeleaf",
          "product": "thymeleaf",
          "versions": [
            {
              "version": "< 3.1.4.RELEASE",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "thymeleaf",
          "product": "org.thymeleaf:thymeleaf-spring5",
          "versions": [
            {
              "version": "< 3.1.4.RELEASE",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "thymeleaf",
          "product": "org.thymeleaf:thymeleaf-spring6",
          "versions": [
            {
              "version": "< 3.1.4.RELEASE",
              "status": "affected"
            }
          ]
        }
      ]
    },
    {
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
      "affectedData": [
        {
          "vendor": "Red Hat",
          "product": "Red Hat OpenShift Dev Spaces 3.28",
          "defaultStatus": "affected",
          "collectionURL": "https://catalog.redhat.com/software/containers/",
          "packageName": "devspaces/openvsx-rhel9",
          "cpes": [
            "cpe:/a:redhat:openshift_devspaces:3.28::el9"
          ],
          "versions": [
            {
              "version": "1779528224",
              "lessThan": "*",
              "versionType": "rpm",
              "status": "unaffected"
            }
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat OpenShift Dev Spaces 3.28",
          "defaultStatus": "affected",
          "collectionURL": "https://catalog.redhat.com/software/containers/",
          "packageName": "devspaces/pluginregistry-rhel9",
          "cpes": [
            "cpe:/a:redhat:openshift_devspaces:3.28::el9"
          ],
          "versions": [
            {
              "version": "1779359423",
              "lessThan": "*",
              "versionType": "rpm",
              "status": "unaffected"
            }
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat build of Apache Camel for Spring Boot 4",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "camel-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:camel_spring_boot:4"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat build of Apache Camel for Spring Boot 4",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:camel_spring_boot:4"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat Fuse 7",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_fuse:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 7",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "smallrye-mutiny-vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 7",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 7",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 8",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "smallrye-mutiny-vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:8"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 8",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:8"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform 8",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jboss_enterprise_application_platform:8"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "smallrye-mutiny-vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "spring-boot-starter-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf-extras-java8time",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf-spring5",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat JBoss Enterprise Application Platform Expansion Pack",
          "defaultStatus": "unaffected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "vertx-web-templ-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:jbosseapxp"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat Single Sign-On 7",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "spring-boot-starter-thymeleaf",
          "cpes": [
            "cpe:/a:redhat:red_hat_single_sign_on:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat Single Sign-On 7",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf",
          "cpes": [
            "cpe:/a:redhat:red_hat_single_sign_on:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat Single Sign-On 7",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf-extras-java8time",
          "cpes": [
            "cpe:/a:redhat:red_hat_single_sign_on:7"
          ]
        },
        {
          "vendor": "Red Hat",
          "product": "Red Hat Single Sign-On 7",
          "defaultStatus": "affected",
          "collectionURL": "https://access.redhat.com/downloads/content/package-browser/",
          "packageName": "thymeleaf-spring5",
          "cpes": [
            "cpe:/a:redhat:red_hat_single_sign_on:7"
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
          "baseScore": 9.0,
          "baseSeverity": "CRITICAL",
          "attackVector": "NETWORK",
          "attackComplexity": "HIGH",
          "privilegesRequired": "NONE",
          "userInteraction": "NONE",
          "scope": "CHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 2.2,
        "impactScore": 6.0
      },
      {
        "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
          "baseScore": 8.5,
          "baseSeverity": "HIGH",
          "attackVector": "NETWORK",
          "attackComplexity": "HIGH",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "CHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 6.0
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-04-21T00:00:00+00:00",
          "id": "CVE-2026-40477",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-917"
        },
        {
          "lang": "en",
          "value": "CWE-1336"
        }
      ]
    },
    {
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-917"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:thymeleaf:thymeleaf:*:*:*:*:*:*:*:*",
              "versionEndExcluding": "3.1.4",
              "matchCriteriaId": "1719DA8A-E398-4802-AF24-0A2558214772"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/thymeleaf/thymeleaf/security/advisories/GHSA-r4v4-5mwr-2fwr",
      "source": "[email protected]",
      "tags": [
        "Vendor Advisory"
      ]
    },
    {
      "url": "https://access.redhat.com/errata/RHSA-2026:21772",
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
    },
    {
      "url": "https://access.redhat.com/security/cve/CVE-2026-40477",
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
    },
    {
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2459344",
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
    },
    {
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40477.json",
      "source": "0b0ca135-0b70-47e7-9f44-1890c2a1c46c"
    }
  ]
}