HubSpot jinjava
jinjava Sandbox Bypass via JavaType-Based Deserialization
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- < 2.8.1
Fixed in 2.8.1
Mitigation
Upgrade jinjava to 2.8.1 or later.
References
- Vendor advisory github.com/HubSpot/jinjava/security/advisories…
- Patch github.com/HubSpot/jinjava/commit/66df351e7e8a…
- Release notes github.com/HubSpot/jinjava/releases/tag/jinjav…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.