CVE-2025-59340
Java vulnerability analysis and mitigation

Overview

CVE-2025-59340 affects jinjava, a Java-based template engine based on django template syntax. The vulnerability was discovered and disclosed in September 2025, affecting all versions prior to 2.8.1. The vulnerability exists in the template engine's sandbox implementation, which fails to properly restrict access to certain dangerous functionalities (GitHub Advisory).

Technical details

The vulnerability stems from insufficient sandbox restrictions in jinjava's implementation. While the sandbox prevents direct access to dangerous methods like getClass() and blocks Class object instantiation, it can be bypassed using mapper.getTypeFactory().constructFromCanonical(). This allows attackers to instruct the underlying ObjectMapper to deserialize attacker-controlled input into arbitrary classes. The vulnerability is rated as Critical with a CVSS score of 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) (GitHub Advisory).

Impact

The vulnerability enables attackers to escape the jinjava sandbox and instantiate a wide range of classes using JavaType. This capability can be used to read arbitrary files and perform full read Server-Side Request Forgery (SSRF) by creating network-related objects. In certain environments, depending on the available classes, this primitive can lead to complete remote code execution (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in jinjava version 2.8.1. Users should upgrade to this version to prevent exploitation. The fix includes additional restrictions on property accessing to disallow fetching properties from restricted bases (GitHub Release).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-59340CRITICAL9.8
  • JavaJava
  • com.hubspot.jinjava:jinjava
NoYesSep 17, 2025
CVE-2025-43808MEDIUM6.9
  • JavaJava
  • cpe:2.3:a:liferay:liferay_portal
NoYesSep 19, 2025
CVE-2025-43803MEDIUM6.9
  • JavaJava
  • cpe:2.3:a:liferay:liferay_portal
NoYesSep 19, 2025
CVE-2025-59476MEDIUM5.3
  • JavaJava
  • cpe:2.3:a:jenkins:jenkins
NoYesSep 17, 2025
CVE-2025-43809MEDIUM5.1
  • JavaJava
  • cpe:2.3:a:liferay:liferay_portal
NoYesSep 19, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management