CVE-2025-59340 jinjava Sandbox Bypass via JavaType-Based Deserialization
- 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.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| 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
| Product | Affected versions | Fixed 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
- https://github.com/HubSpot/jinjava/security/advisories/GHSA-m49c-g9wr-hv6v vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com patch
- https://github.com/HubSpot/jinjava/commit/66df351e7e8ad71ca04dcacb4b65782af820b8b1 patch
- github.com product
- github.com
- https://github.com/HubSpot/jinjava/releases/tag/jinjava-2.8.1 release-notes
- github.com