Thousands of websites are at risk due to security vulnerability in HubSpot's Jinjava Engine, making them susceptible to Remote Code Execution (RCE) attacks.
========================================================================================================================
A critical vulnerability has been identified in the Jinjava template engine, a popular tool used in thousands of content management systems, email template renderers, and custom web applications. This flaw, tracked as CVE-2025-59340, has a CVSS v3.1 score of 10.0, making it a highly severe security issue.
The vulnerability allows attackers to bypass sandbox restrictions and achieve remote code execution (RCE) on affected systems. This is primarily due to a flaw in the deserialization process, specifically involving JavaType-based deserialization. This issue enables threat actors to instantiate arbitrary classes despite existing protections.
One of the key exploits involves the built-in variable in Jinjava. Attackers can navigate to the internal ObjectMapper and invoke its unrestricted method, thus gaining control over the system.
Another point of attack is the variable discovered in the Jinjava class. This variable allows an attacker to bypass sandbox restrictions and instantiate arbitrary classes.
To address this issue, HubSpot has released Jinjava version 2.8.1. Administrators are urged to upgrade to this latest version immediately to protect their systems.
In addition to upgrading, several best practices can help harden defenses against similar template engine bypasses. These include strict input validation, auditing template code for direct or indirect use of , and implementing runtime instrumentation to detect suspicious deserialization calls.
Moreover, disabling default typing where feasible can further enhance security. Strictly reviewing your dependency graphs for libraries exposing Jackson's ObjectMapper without adequate type restrictions is also recommended.
It's important to note that because JavaType construction is not blacklisted, the sandbox escape enables the instantiation of semi-arbitrary classes. Attackers can deserialize attacker-controlled input into instances like and read local files, opening paths for Server-Side Request Forgery (SSRF), arbitrary file reads, and, when chained with additional gadgets, RCE.
This vulnerability serves as a reminder of the importance of maintaining up-to-date software and following best practices for secure coding. By taking these steps, we can help ensure the security of our digital ecosystem.