### Key Information #### Vulnerability Overview - **Vulnerability Name**: Sandbox Bypass via JavaType-Based Deserialization - **Severity**: Critical (CVSS v3.1: 9.8/10) - **CVE ID**: CVE-2025-59340 - **CWE**: CWE-1336 #### Affected Scope - **Affected Versions**: < 2.8.1 - **Fixed Version**: 2.8.1 - **Package**: com.hubspot.jinjava:jinjava (Maven) #### Vulnerability Description - **Summary**: Jinjava’s current sandbox restrictions prevent direct access to dangerous methods (e.g., `getClass()`) and instantiation of Class objects. However, these protections can be bypassed. - **Details**: - Jinjava templates expose a built-in variable `__int3pr3t3r__`, which provides direct access to a JinjavaInterpreter instance. - By interacting with properties of the JinjavaInterpreter instance, an attacker can traverse to the `config` field, which exposes an ObjectMapper. - Using the `readValue(String content, JavaType valueType)` method, attackers can instantiate arbitrary classes, including those specified via JavaType. - Although Jinjava explicitly restricts dangerous classes (e.g., Class, ClassLoader), the JavaType class itself is not restricted within JinjavaBeanELResolver. #### Impact - **Consequences**: Attackers can bypass the sandbox and instantiate a wide range of classes using JavaType. This may lead to arbitrary file reading and SSRF. In certain environments, this could even result in Remote Code Execution (RCE).