Skip to content

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

CriticalCVSS 10.0 EPSS 2.1%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: total

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.

Upgrade path

2 packages: 2 fixed.

PackageAffectedFixed inStatus
com.hubspot.jinjava/jinjava(Maven) = 2.7.0; = 2.7.1; = 2.7.2; = 2.7.3 +4 more 2.7.5, 2.8.1 Fixed
HubSpot jinjava < 2.8.1; = < 2.8.1 2.8.1 Fixed

Affected products

ProductAffected versionsFixed in
com.hubspot.jinjava/jinjava(Maven) >= 2.8.0, < 2.8.1 2.8.1
com.hubspot.jinjava/jinjava(Maven) = 2.8.0 No fix listed
com.hubspot.jinjava/jinjava(Maven) >= 2.7.0, < 2.7.5 2.7.5
com.hubspot.jinjava/jinjava(Maven) = 2.7.0 No fix listed
com.hubspot.jinjava/jinjava(Maven) = 2.7.1 No fix listed
com.hubspot.jinjava/jinjava(Maven) = 2.7.2 No fix listed
com.hubspot.jinjava/jinjava(Maven) = 2.7.3 No fix listed
com.hubspot.jinjava/jinjava(Maven) = 2.7.4 No fix listed
HubSpot jinjava = < 2.8.1 No fix listed
HubSpot jinjava < 2.8.1 2.8.1

References