{"answers":{"affected":"6 open source packages ship an affected version, including org.thymeleaf:thymeleaf-spring5, org.thymeleaf:thymeleaf and org.thymeleaf:thymeleaf-spring6. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-40477 in the wild and no public exploit code.","fix":"Upgrade org.thymeleaf:thymeleaf-spring5 to 3.1.4.RELEASE or later.","what":"CVE-2026-40477 is a critical code injection vulnerability in org.thymeleaf:thymeleaf-spring5, published on 17 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40477 and fix it if it is affected.\n\nWhat it is: CVE-2026-40477 is a critical code injection vulnerability in org.thymeleaf:thymeleaf-spring5, published on 17 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-40477 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.thymeleaf:thymeleaf-spring5 (Maven): affected all versions; fixed in 3.1.4.RELEASE\n- org.thymeleaf:thymeleaf-spring5 (Maven): affected all versions; fixed in 3.1.4.RELEASE\n- org.thymeleaf:thymeleaf (Maven): affected all versions; fixed in 3.1.4.RELEASE\n- org.thymeleaf:thymeleaf (Maven): affected all versions; fixed in 3.1.4.RELEASE\n- org.thymeleaf:thymeleaf-spring6 (Maven): affected all versions; fixed in 3.1.4.RELEASE\n- org.thymeleaf:thymeleaf-spring6 (Maven): affected all versions; fixed in 3.1.4.RELEASE\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40477/ (Markdown: https://insights.sbomify.com/CVE-2026-40477/index.md)","id":"CVE-2026-40477","markdown":"https://insights.sbomify.com/CVE-2026-40477/index.md","name":"CVE-2026-40477","record":{"aliases":["GHSA-r4v4-5mwr-2fwr"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Java template engine","requires_auth":"none","summary":"An unauthenticated remote attacker can achieve Server-Side Template Injection and execute arbitrary code if unvalidated user input is passed to the Thymeleaf template engine.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"thymeleaf","vendor":"thymeleaf"}],"cvss":{"score":9.1,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-917","name":"Improper Neutralization of Special Elements used in an Expression Language Statement"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"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.","ecosystems":["Maven"],"exploits":{"exploitdb":0,"first_seen":"2026-09-04","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-09-04T09:59:01Z","kind":"github_poc","ref":"https://github.com/xiaoqiMikko/thymeleaf-check","stars":0,"title":"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)"}],"tier":"poc_unverified"},"has_fix":true,"headline":"Improper restriction of the scope of accessible objects in Thymeleaf expressions","id":"CVE-2026-40477","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Maven","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":6,"n_references":1,"next":{"headline":"Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf","id":"CVE-2026-40478"},"packages":[{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf","purl":null,"source":"GHSA-r4v4-5mwr-2fwr"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf","purl":"pkg:maven/org.thymeleaf/thymeleaf","source":"GHSA-r4v4-5mwr-2fwr"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring5","purl":null,"source":"GHSA-r4v4-5mwr-2fwr"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring5","purl":"pkg:maven/org.thymeleaf/thymeleaf-spring5","source":"GHSA-r4v4-5mwr-2fwr"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring6","purl":null,"source":"GHSA-r4v4-5mwr-2fwr"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring6","purl":"pkg:maven/org.thymeleaf/thymeleaf-spring6","source":"GHSA-r4v4-5mwr-2fwr"}],"prev":{"headline":"graphql-php: Denial of Service via quadratic complexity in OverlappingFieldsCanBeMerged validation","id":"CVE-2026-40476"},"products":["org.thymeleaf:thymeleaf-spring5","org.thymeleaf:thymeleaf-spring6","thymeleaf"],"published":"2026-04-17","related":[{"cvss_score":9.8,"headline":"Template injection in thymeleaf-spring5","id":"CVE-2021-43466","kev_date_added":null,"published":"2021-11-09"},{"cvss_score":9.1,"headline":"Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf","id":"CVE-2026-40478","kev_date_added":null,"published":"2026-04-17"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-08-17","vendors":["thymeleaf"]},"summary":"An unauthenticated remote attacker can achieve Server-Side Template Injection and execute arbitrary code if unvalidated user input is passed to the Thymeleaf template engine.","url":"https://insights.sbomify.com/CVE-2026-40477/"}