GHSA-gjx9-j8f8-7j74

Suggest an improvement
Source
https://github.com/advisories/GHSA-gjx9-j8f8-7j74
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-gjx9-j8f8-7j74/GHSA-gjx9-j8f8-7j74.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-gjx9-j8f8-7j74
Aliases
Related
Published
2026-02-03T17:52:55Z
Modified
2026-02-05T16:58:58.356279Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
JinJava Bypass through ForTag leads to Arbitrary Java Execution
Details

Impact

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:

  1. ForTag Property Access Bypass: The ForTag class does not enforce JinjavaBeanELResolver restrictions when iterating over object properties using Introspector.getBeanInfo() and invoking getter methods via PropertyDescriptor.getReadMethod()

  2. Restricted Class Instantiation: The sandbox's type allowlist can be bypassed by using ObjectMapper to instantiate classes through JSON deserialization, including creating new JinjavaELContext and JinjavaConfig instances

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 ObjectMapper to 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

Patches

Status: Patched - CVE-2026-25526

Users should upgrade to one of the following versions which contain fixes for this vulnerability:

  • JinJava 2.8.3 or later
  • JinJava 2.7.6 or later

Fix Components:

  1. ForTag Security Hardening

    • Added security checks to ForTag.renderForCollection() to enforce JinjavaBeanELResolver restrictions
    • Implemented property access validation against restricted properties/methods before invoking getter methods
    • Added checks for restricted class types before introspection
  2. Enhanced Type Validation

    • Improved validation in JinjavaBeanELResolver.isRestrictedClass() to prevent instantiation of sensitive types
    • Added additional restricted types to the denylist
    • Implemented deeper validation for types created via ObjectMapper deserialization
  3. Configuration Protection

    • Added checks to prevent creation of new JinjavaConfig or JinjavaELContext instances via ObjectMapper
    • Prevented modification of readOnlyResolver configuration from untrusted templates
    • Implemented additional safeguards around ELResolver configuration
  4. Collection Type Validation

    • Implemented proper type validation in HubLELResolver to prevent collection type wrapping bypasses
    • Added checks for wrapped types in collection deserialization
    • Implemented validation for all types within collections against allowlists
  5. ObjectMapper Restrictions

    • Added additional restrictions on ObjectMapper.enableDefaultTyping() to prevent enabling via less restrictive ELResolver
    • Ensured default typing cannot be enabled without proper authorization

Information for Users: Upgrade to version 2.8.3 or 2.7.6 or later to address this vulnerability.

References

Project Resources

Security Standards & Classifications

  • CWE-502: Deserialization of Untrusted Data
  • CWE-913: Improper Control of Dynamically-Managed Code Resources
  • CWE-94: Improper Control of Generation of Code ('Code Injection')
  • CVSS v3.1: Common Vulnerability Scoring System

Additional Resources

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-03T17:52:55Z",
    "severity": "CRITICAL",
    "nvd_published_at": "2026-02-04T22:15:59Z",
    "cwe_ids": [
        "CWE-1336"
    ]
}
References

Affected packages

Maven / com.hubspot.jinjava:jinjava

Package

Name
com.hubspot.jinjava:jinjava
View open source insights on deps.dev
Purl
pkg:maven/com.hubspot.jinjava/jinjava

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.8.0
Fixed
2.8.3

Affected versions

2.*
2.8.0
2.8.1
2.8.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-gjx9-j8f8-7j74/GHSA-gjx9-j8f8-7j74.json"

Maven / com.hubspot.jinjava:jinjava

Package

Name
com.hubspot.jinjava:jinjava
View open source insights on deps.dev
Purl
pkg:maven/com.hubspot.jinjava/jinjava

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.7.6

Affected versions

1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
2.*
2.0.0
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.0.7
2.0.8
2.0.9
2.0.10
2.0.11-java7
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.1.5
2.1.6
2.1.7
2.1.8
2.1.9
2.1.10
2.1.11
2.1.12
2.1.13
2.1.14
2.1.15
2.1.16
2.1.17
2.1.18
2.1.19
2.2.0
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.2.6
2.2.7
2.2.8
2.2.9
2.2.10
2.3.0
2.3.1
2.3.3
2.3.4
2.3.5
2.3.6
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.4.7
2.4.8
2.4.9
2.4.10
2.4.11
2.4.12
2.4.13
2.4.14
2.4.15
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
2.5.8
2.5.9
2.5.10
2.6.0
2.7.0
2.7.1
2.7.2
2.7.3
2.7.4
2.7.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/02/GHSA-gjx9-j8f8-7j74/GHSA-gjx9-j8f8-7j74.json"