CVE-2018-18893: Jinjava getClass Method Vulnerability

com.hubspot.jinjava:jinjava Updated 02 Oct 2025

Summary

04/01/2019
Yes i
Moderate
5.3

CVE-2018-18893: Jinjava calls getClass. Affects com.hubspot.jinjava:jinjava versions < 2.4.6. Fixed in 2.4.6. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Jinjava is an open-source template engine for Java that allows developers to embed dynamic content in static HTML pages. It provides a powerful set of features for rendering templates and processing expressions. The vulnerability in Jinjava versions prior to 2.4.6 allows the execution of the getClass method, which can lead to potential security risks.

Vulnerability Detail

The vulnerability arises from the failure to block the getClass method in JinjavaBeanELResolver.java. This oversight enables an attacker to execute arbitrary code and potentially gain unauthorized access to sensitive information or perform malicious actions on the affected system. The vulnerability has a CVSS score of 5.3, indicating a moderate severity level.

How To Fix

Minimum fixed version

2.4.6

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can manually modify the JinjavaBeanELResolver.java file to block the getClass method. Here is an example of the code modification:

public class JinjavaBeanELResolver extends BeanELResolver {

  @Override
  public Object getValue(ELContext context, Object base, Object property) {
    if (property.equals("class")) {
      throw new PropertyNotFoundException();
    }
    return super.getValue(context, base, property);
  }

}

Conclusion

In conclusion, the Jinjava getClass Method Vulnerability (CVE-2018-18893) poses a moderate security risk. It is crucial to update the Jinjava library to version 2.4.6 or later to fix this vulnerability and prevent potential exploitation. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.hubspot.jinjava:jinjava →

Share this vulnerability

FAQ

Jinjava is an open-source template engine for Java that allows developers to embed dynamic content in static HTML pages. It provides a powerful set of features for rendering templates and processing expressions.

This vulnerability allows an attacker to execute arbitrary code and potentially gain unauthorized access to sensitive information or perform malicious actions on the affected system.

The CVSS score of this vulnerability is 5.3, indicating a moderate severity level.

To fix this vulnerability, it is recommended to update the Jinjava library to version 2.4.6 or later. This version includes the necessary security patches to block the getClass method and mitigate the associated risks.

Yes, as a temporary workaround, developers can manually modify the JinjavaBeanELResolver.java file to block the getClass method. Please refer to the 'workaround' section for the code modification.

Related vulnerabilities

Recent vulnerabilities recorded for com.hubspot.jinjava:jinjava.

How To Fix

Minimum fixed version

2.4.6

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback