Skip to content
OpenAdvisories
Critical · 9.8 CVE-2025-59340 EUVD-2025-29780GHSA-m49c-g9wr-hv6v

jinjava Sandbox Bypass via JavaType-Based Deserialization

Published Sep 17, 2025 · Updated Sep 18, 2025 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
HubSpot jinjava < 2.8.1 —

Affected packages

EcosystemPackageAffectedFixedRecord
Maven com.hubspot.jinjava:jinjava >= 2.8.0, < 2.8.1 2.8.1 GHSA-m49c-g9wr-hv6v
Maven com.hubspot.jinjava:jinjava >= 2.7.0, < 2.7.5 2.7.5 GHSA-m49c-g9wr-hv6v

References