Get a Demo
Under Attack?
A warning sign labeled DJL DeepJavaLibrary CVE-2024-37902 stands on a sandy beach with palm trees. In the background, a large wave crashes, and a surfboard is visible in the surf.

Deep Dive: CVE-2024-37902 and Potential Impact on DeepJavaLibrary Users

Eliad Mualem June 17, 2024

AWS announced today, June 17, that there is a potential security issue with archive extraction utilities in DeepJavaLibrary versions 0.1.0 through 0.27.0 that could allow an attacker to tamper with your system.

What is DeepJavaLibrary?

DJL is a free, open-source library by AWS used for building deep learning models in Java. It provides easy-to-use tools for training, testing, and deploying your models. This project enjoys strong community support with over 4,000 stars and hundreds of forks on GitHub.

Understanding CVE-2024-37902

DJL versions prior to 0.28.0 are susceptible to a vulnerability concerning absolute paths within archived artifacts (compressed files like ZIP or JAR). An absolute path specifies the complete location of a file on a system. When processing these archived files, DJL might attempt to extract them based on the absolute paths contained within the archive. If these paths target system files, the extraction process could overwrite critical system files, potentially compromising system stability.

Deep dive into the code

The problem resides inside the file api/src/main/java/ai/djl/util/TarUtils.java

<strong>String entryName = entry.getName();</strong>
<strong>if(entryName.contains("..")){</strong>
<strong>thrownewIOException("Maliciouszipentry:"+entryName);</strong>
<strong> }</strong>

While it checks if the file name contains “..” thus preventing a file by the name of ../../../bin/echo from replacing system files, it does not check for files starting with “/” such as /bin/echo that will overwrite system files

The latest DJL versions fix the vulnerability by removing leading separators from filenames during archive extraction, preventing absolute path exploitation:

String entryName = ZipUtils.removeLeadingFileSeparator(entry.getName());
if (entryName.contains("..")) {
      throw new IOException("Malicious zip entry: " + entryName);
}

Which versions are affected?

  • DJL versions 0.1.0 through 0.27.0 are affected by this vulnerability.

How do you fix affected versions of DJL?

If you are using an affected version of DJL, it is recommended that you upgrade to version 0.28.0 or higher. Upgrading will ensure that you are protected from this vulnerability.

How Upwind protects against critical CVEs

Issues-1-1024x576

The Upwind Cloud Security Platform offers several solutions to CVE-2024-37902 and other critical vulnerabilities by providing the following:

  1. Vulnerability management: Upwind’s vulnerability management helps you reduce noise and prioritize critical vulnerabilities. View the immediate impact vulnerabilities have on your environment including package dependencies, all affected resources, and available fixes.
  2. Threat detection: Upwind’s threat detection system proactively identifies and alerts you to anomalous activity within your environment, helping you go beyond malware signature recognition to identify advanced threats.
  3. Critical Issues Prioritization: Upwind Issues intelligently identifies open attack paths and “toxic combinations” of threats, vulnerabilities and posture issues, helping you to efficiently address your most relevant security concerns.

Learn More

Want to learn more about how Upwind protects you against critical vulnerabilities? Visit the Upwind Documentation Center (login required) or schedule a demo.

Contents

Further Reading

Yuval_ArgoCD Research

ArgoCD repoURL XSS: How a Missing Scheme Check Becomes Cluster Takeover 

Executive Summary  This stored cross-site scripting (XSS) vulnerability in ArgoCD [versions <= 3.4.4] allows an attacker who can create or modify an Application to persist a malicious repoURL, which is subsequently executed in an administrator's browser within the Argo CD origin. Because the payload executes in the context of the administrator's authenticated session, and because…
Custom-Reporting-Hero

Security Reporting Built Around Your Program

We've all been there: it's 3:00 PM on a Friday, and you get that "quick" request for a specific security status report. Suddenly, your afternoon is gone as you juggle filters, export CSVs, and try to explain to someone outside the security team why these numbers actually matter. Reporting shouldn't feel like a fire drill…
Blue-agent-blog

Introducing the Upwind Blue Agent: Autonomous Threat Investigation for the SOC

We’re excited to announce that the Upwind Blue Agent is now available in Beta. Blue is an AI-powered SOC investigator that autonomously investigates Upwind Threat Stories end to end. It gathers and correlates security context across the customer environment, evaluates the available evidence, and delivers one of three clear verdicts: Each verdict includes supporting reasoning…
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Threat RSS
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Main RSS