CVE-2025-59340
Published: 17 September 2025
Summary
CVE-2025-59340 is a critical-severity Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336) vulnerability in Hubspot Jinjava. Its CVSS base score is 9.8 (Critical).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked in the top 23.5% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 SI-10 (Information Input Validation) and SI-2 (Flaw Remediation).
Threat & Defense at a Glance
Threat & Defense Details
Mitigating Controls (NIST 800-53 r5)AI
Directly mitigates the vulnerability by requiring timely remediation through upgrading jinjava to version 2.8.1 or later where the deserialization flaw is fixed.
Requires validation of attacker-controlled template inputs to external sources, preventing malicious deserialization payloads from being processed by the ObjectMapper.
Enforces secure configuration settings for the ObjectMapper, such as disabling unsafe features like constructFromCanonical to limit arbitrary class instantiation.
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
Remote unauthenticated deserialization in public-facing jinjava template engine directly enables exploitation of exposed applications for sandbox escape and RCE.
NVD Description
jinjava is a Java-based template engine based on django template syntax, adapted to render jinja templates. Priori to 2.8.1, by using mapper.getTypeFactory().constructFromCanonical(), it is possible to instruct the underlying ObjectMapper to deserialize attacker-controlled input into arbitrary classes. This enables the…
more
creation of semi-arbitrary class instances without directly invoking restricted methods or class literals. As a result, an attacker can escape the sandbox and instantiate classes such as java.net.URL, opening up the ability to access local files and URLs(e.g., file:///etc/passwd). With further chaining, this primitive can potentially lead to remote code execution (RCE). This vulnerability is fixed in 2.8.1.
Deeper analysisAI
CVE-2025-59340 is a critical deserialization vulnerability in jinjava, a Java-based template engine that adapts Django template syntax to render Jinja templates. In versions prior to 2.8.1, attackers can exploit the underlying ObjectMapper by invoking mapper.getTypeFactory().constructFromCanonical() on controlled input, enabling the instantiation of arbitrary classes without directly calling restricted methods or class literals. This flaw, tied to CWE-1336 (Incorrect Handling of Deserialized Objects), carries a CVSS v3.1 base score of 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), allowing sandbox escapes such as instantiating java.net.URL to access local files (e.g., file:///etc/passwd).
The vulnerability can be exploited by any remote, unauthenticated attacker who supplies malicious input to a jinjava template rendering process. Successful exploitation grants the ability to create semi-arbitrary class instances, bypassing sandbox restrictions to read sensitive files or connect to arbitrary URLs. Further chaining of this primitive may enable remote code execution (RCE), resulting in high-impact confidentiality, integrity, and availability compromises on the affected system.
The issue is addressed in jinjava version 2.8.1, as detailed in the project's security advisory (GHSA-m49c-g9wr-hv6v), release notes, and the fixing commit (66df351e7e8ad71ca04dcacb4b65782af820b8b1). Security practitioners should upgrade to 2.8.1 or later and review applications using jinjava for untrusted input handling.
Details
- CWE(s)