CVE-2025-59340 jinjava Sandbox Bypass via JavaType-Based Deserialization
Attackers can bypass the sandbox in the jinjava template engine to instantiate arbitrary classes, potentially leading to remote code execution or local file access.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-59340?
CVE-2025-59340 is a critical unsafe deserialization vulnerability in HubSpot jinjava, published on 17 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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 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.
Weakness: CWE-1336
Which versions are affected by CVE-2025-59340?
4 open source packages ship an affected version, including com.hubspot.jinjava:jinjava. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
com.hubspot.jinjava:jinjava Maven | From 2.7.0 | 2.7.5 |
com.hubspot.jinjava:jinjava Maven | From 2.7.0 | 2.7.5 |
com.hubspot.jinjava:jinjava Maven | From 2.8.0 | 2.8.1 |
com.hubspot.jinjava:jinjava Maven | From 2.8.0 | 2.8.1 |
Products include Hubspot Jinjava.
How do I fix CVE-2025-59340?
Upgrade com.hubspot.jinjava:jinjava to a fixed version for your release line: 2.7.5 or 2.8.1.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2025-59340 being exploited?
There is no known exploitation of CVE-2025-59340 in the wild and no public exploit code.
Other vulnerabilities in HubSpot jinjava
Sources
Also known as CLEANSTART-2026-ZM98216, GHSA-m49c-g9wr-hv6v, MINI-9v5w-fr43-g2jm.