CVE-2024-37902: Api Path Traversal Vulnerability

CRITICAL
Advisory Identifier: GHSA-w877-jfw7-46rj
CVSS 10.0
CWE-22
Published
Advisory Summary

CVE-2024-37902 is a CRITICAL (CVSS 10.0) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Api libraries in the Maven ecosystem. The issue involves deepjavalibrary api absolute path traversal. Remediation is available by upgrading affected packages to version 0.28.0.

CVE-2024-37902 at a Glance

CVE Identifier CVE-2024-37902
GHSA Identifier GHSA-w877-jfw7-46rj
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Api
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-37902

To remediate this vulnerability, upgrade all affected Api dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ai.djl:api fixed: 0.28.0
<dependency>
    <groupId>ai.djl</groupId>
    <artifactId>api</artifactId>
    <version>0.28.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=ai.djl

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-37902, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=ai.djl

Analyze the terminal output to locate any version of Api in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.28.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=ai.djl command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Api, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary DeepJavaLibrary(DJL) versions 0.1.0 through 0.27.0 do not prevent absolute path archived artifacts from inserting archived files directly into the system, overwriting system files. This is fixed in DJL 0.28.0 and patched in DJL Large Model Inference containers 0.27.0. **Impacted versions: 0.1.0 through 0.27.0** ## Patches Patched Deep Learning Containers: [v1.1-djl-0.27.0-inf-cpu-full](https://github.com/aws/deep-learning-containers/releases/tag/v1.1-djl-0.27.0-inf-cpu-full) [v1.4-djl-0.27.0-inf-ds-0.12.6](https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-ds-0.12.6) [v1.4-djl-0.27.0-inf-trt-0.8.0](https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-trt-0.8.0) [v1.3-djl-0.27.0-inf-neuronx-sdk2.18.1](https://github.com/aws/deep-learning-containers/releases/tag/v1.3-djl-0.27.0-inf-neuronx-sdk2.18.1) Patched Library: [v0.28.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.28.0)

CVE-2024-37902 Affected Api Versions

1 component(s)
Fixed Versions:
0.28.0
Product / Package Ecosystem Affected Versions Fixed Version
ai.djl:api
Maven
≥ 0.1.0
< 0.28.0
0.28.0

References

Frequently Asked Questions

What is CVE-2024-37902?
CVE-2024-37902 is a security vulnerability in Api involving DeepJavaLibrary API absolute path traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Api versions are affected?
Affected versions include releases prior to 0.28.0 across affected packages: ai.djl:api.
What version fixes CVE-2024-37902?
Upgrading to 0.28.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is api affected?
Yes, ai.djl:api is affected in releases prior to 0.28.0. Upgrade your dependency to 0.28.0 or later.
What is the CVSS score of CVE-2024-37902?
CVE-2024-37902 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-37902?
CVE-2024-37902 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for CVE-2024-37902?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=ai.djl'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w877-jfw7-46rj",
  "modified" : "2024-06-18T15:24:00Z",
  "published" : "2024-06-17T21:20:44Z",
  "aliases" : [ "CVE-2024-37902" ],
  "summary" : "DeepJavaLibrary API absolute path traversal",
  "details" : "## Summary\n\nDeepJavaLibrary(DJL) versions 0.1.0 through 0.27.0 do not prevent absolute path archived artifacts from inserting archived files directly into the system, overwriting system files. This is fixed in DJL 0.28.0 and patched in DJL Large Model Inference containers 0.27.0.\n\n**Impacted versions: 0.1.0 through 0.27.0**\n\n## Patches\n\nPatched Deep Learning Containers:\n[v1.1-djl-0.27.0-inf-cpu-full](https://github.com/aws/deep-learning-containers/releases/tag/v1.1-djl-0.27.0-inf-cpu-full)\n[v1.4-djl-0.27.0-inf-ds-0.12.6](https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-ds-0.12.6)\n[v1.4-djl-0.27.0-inf-trt-0.8.0](https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-trt-0.8.0)\n[v1.3-djl-0.27.0-inf-neuronx-sdk2.18.1](https://github.com/aws/deep-learning-containers/releases/tag/v1.3-djl-0.27.0-inf-neuronx-sdk2.18.1)\n\nPatched Library:\n[v0.28.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.28.0)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "ai.djl:api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.28.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/deepjavalibrary/djl/security/advisories/GHSA-w877-jfw7-46rj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37902"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/deep-learning-containers/releases/tag/v1.1-djl-0.27.0-inf-cpu-full"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/deep-learning-containers/releases/tag/v1.3-djl-0.27.0-inf-neuronx-sdk2.18.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-ds-0.12.6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/deep-learning-containers/releases/tag/v1.4-djl-0.27.0-inf-trt-0.8.0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/deepjavalibrary/djl"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/deepjavalibrary/djl/releases/tag/v0.28.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-17T21:20:44Z",
    "nvd_published_at" : "2024-06-17T20:15:14Z"
  }
}