CVE-2025-59340
jinjava has Sandbox Bypass via JavaType-Based Deserialization
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD, GHSA.
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.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| maven::GitHub Security Advisory Maven | com.hubspot.jinjava:jinjava | 2.8.1, 2.7.5 |
| minimos | airbyte-server | 2.2.0-r0 |
References
- https://github.com/HubSpot/jinjava
- https://github.com/HubSpot/jinjava/commit/66df351e7e8ad71ca04dcacb4b65782af820b8b1
- https://github.com/HubSpot/jinjava/releases/tag/jinjava-2.7.5
- https://github.com/HubSpot/jinjava/releases/tag/jinjava-2.8.1
- https://github.com/HubSpot/jinjava/security/advisories/GHSA-m49c-g9wr-hv6v
- https://github.com/github/advisory-database/pull/8141
- https://nvd.nist.gov/vuln/detail/CVE-2025-59340