CVE-2025-59340 jinjava Sandbox Bypass via JavaType-Based Deserialization

Critical 9.8 Published Updated

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.

PackageAffectedFixed in
com.hubspot.jinjava:jinjava MavenFrom 2.7.02.7.5
com.hubspot.jinjava:jinjava MavenFrom 2.7.02.7.5
com.hubspot.jinjava:jinjava MavenFrom 2.8.02.8.1
com.hubspot.jinjava:jinjava MavenFrom 2.8.02.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.

Sources

Also known as CLEANSTART-2026-ZM98216, GHSA-m49c-g9wr-hv6v, MINI-9v5w-fr43-g2jm.

Is CVE-2025-59340 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free