CVE-2026-25526: JinJava Bypass through ForTag leads to Arbitrary Java Execution
Vulnerability Type: Sandbox Bypass / Remote Code Execution
Affected Component: Jinjava
Affected Users:
- Organizations using HubSpot’s Jinjava template rendering engine for user-provided template content
- Any system that renders untrusted Jinja templates using HubSpot’s Jinjava implementation
- Users with the ability to create or edit custom code templates
Severity: Critical - allows arbitrary Java class instantiation and file access bypassing built-in sandbox restrictions
Root Cause: Multiple security bypass vulnerabilities in Jinjava’s sandbox mechanism:
ForTag Property Access Bypass: The
ForTagclass does not enforceJinjavaBeanELResolverrestrictions when iterating over object properties usingIntrospector.getBeanInfo()and invoking getter methods viaPropertyDescriptor.getReadMethod()Restricted Class Instantiation: The sandbox’s type allowlist can be bypassed by using ObjectMapper to instantiate classes through JSON deserialization, including creating new
JinjavaELContextandJinjavaConfiginstances
Attack Vector: An attacker with the ability to create or edit Jinja templates can:
- Access arbitrary getter methods on objects in the template context
- Instantiate
ObjectMapperto enable default typing - Create arbitrary Java classes by bypassing type allowlists
- Read files from the server filesystem (demonstrated with
/etc/passwd) - Potentially execute arbitrary code
References
- github.com/HubSpot/jinjava
- github.com/HubSpot/jinjava/commit/3d02e504d8bbb13bf3fe019e9ca7b51dfce7a998
- github.com/HubSpot/jinjava/commit/c7328dce6030ac718f88974196035edafef24441
- github.com/HubSpot/jinjava/releases/tag/jinjava-2.7.6
- github.com/HubSpot/jinjava/releases/tag/jinjava-2.8.3
- github.com/HubSpot/jinjava/security/advisories/GHSA-gjx9-j8f8-7j74
- github.com/advisories/GHSA-gjx9-j8f8-7j74
- nvd.nist.gov/vuln/detail/CVE-2026-25526
Code Behaviors & Features
Detect and mitigate CVE-2026-25526 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →