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

<br />
<b>Warning</b>:  Undefined variable $photo in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
<br />
<b>Warning</b>:  Trying to access array offset on value of type null in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
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

OpenAI Breach

Everyone Read the OpenAI Breach as a Model Story, But It Was a Runtime Story

Key Takeaways Autonomous AI agents can now break out of a sandbox, cross an internal network, and breach a production system with no human at the keyboard. OpenAI's evaluation that hacked Hugging Face this month is the clearest proof on record. Most of the coverage read it as a story about a model turning dangerous.…
upwind-identities

Introducing the Upwind Identity Graph: End-to-End Identity Security

Identity used to be treated as a directory problem: find the user, inspect the groups, review the assigned roles, and decide whether the account has too much access. That model no longer matches the cloud. A single person may authenticate through Okta, inherit permissions from multiple groups, receive role assignments in more than one cloud,…
AI-Graph

Introducing the Upwind AI Graph: Extending AI Inventory Beyond Cloud Infrastructure

As enterprise adoption of artificial intelligence accelerates, modern AI infrastructure has expanded far beyond traditional cloud perimeters. Securing enterprise AI today requires complete visibility across four distinct operational layers: Traditional cloud security tools stop at the cloud provider boundary. When enterprise teams connect directly to external AI Providers, security teams lose sight of access paths,…
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