{"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-40478 in the wild and no public exploit code.","fix":"Upgrade org.thymeleaf:thymeleaf-spring5 to 3.1.4.RELEASE or later.","what":"CVE-2026-40478 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-40478 and fix it if it is affected.\n\nWhat it is: CVE-2026-40478 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-40478 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-40478/ (Markdown: https://insights.sbomify.com/CVE-2026-40478/index.md)","id":"CVE-2026-40478","markdown":"https://insights.sbomify.com/CVE-2026-40478/index.md","name":"CVE-2026-40478","record":{"aliases":["GHSA-xjw8-8c5c-9r79"],"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 by bypassing expression protections in Thymeleaf.","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 the expression execution mechanisms. Although the library provides mechanisms to prevent expression injection, it fails to properly neutralize specific syntax patterns that allow for the execution of unauthorized expressions. 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":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Improper neutralization of specific syntax patterns for unauthorized expressions in Thymeleaf","id":"CVE-2026-40478","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":"Kimai: Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget","id":"CVE-2026-40479"},"packages":[{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf","purl":null,"source":"GHSA-xjw8-8c5c-9r79"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf","purl":"pkg:maven/org.thymeleaf/thymeleaf","source":"GHSA-xjw8-8c5c-9r79"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring5","purl":null,"source":"GHSA-xjw8-8c5c-9r79"},{"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-xjw8-8c5c-9r79"},{"ecosystem":"Maven","fixed":["3.1.4.RELEASE"],"introduced":["0"],"last_affected":[],"package":"org.thymeleaf:thymeleaf-spring6","purl":null,"source":"GHSA-xjw8-8c5c-9r79"},{"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-xjw8-8c5c-9r79"}],"prev":{"headline":"Improper restriction of the scope of accessible objects in Thymeleaf expressions","id":"CVE-2026-40477"},"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 restriction of the scope of accessible objects in Thymeleaf expressions","id":"CVE-2026-40477","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)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-08-18","vendors":["thymeleaf"]},"summary":"An unauthenticated remote attacker can achieve Server-Side Template Injection and execute arbitrary code by bypassing expression protections in Thymeleaf.","url":"https://insights.sbomify.com/CVE-2026-40478/"}