CVE-2024-49771: Mpxj Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-j945-c44v-97g6
CVSS 5.3
CWE-22
Published
Advisory Summary

CVE-2024-49771 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Mpxj libraries in the Maven ecosystem. The issue involves mpxj has a potential path traversal vulnerability. Remediation is available by upgrading affected packages to version 13.5.1.

CVE-2024-49771 at a Glance

CVE Identifier CVE-2024-49771
GHSA Identifier GHSA-j945-c44v-97g6
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Mpxj
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:U/C:N/I:L/A:N).

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

How to Fix CVE-2024-49771

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

net.sf.mpxj:mpxj fixed: 13.5.1
<dependency>
    <groupId>net.sf.mpxj</groupId>
    <artifactId>mpxj</artifactId>
    <version>13.5.1</version>
</dependency>
mpxj fixed: 13.5.1
Upgrade mpxj to 13.5.1
mpxj fixed: 13.5.1
pip install mpxj>=13.5.1
net.sf.mpxj fixed: 13.5.1
Upgrade net.sf.mpxj to 13.5.1
net.sf.mpxj-for-csharp fixed: 13.5.1
Upgrade net.sf.mpxj-for-csharp to 13.5.1
net.sf.mpxj-for-vb fixed: 13.5.1
Upgrade net.sf.mpxj-for-vb to 13.5.1
MPXJ.Net fixed: 13.5.1
Upgrade MPXJ.Net to 13.5.1
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=net.sf.mpxj

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=net.sf.mpxj

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

Note: The mvn dependency:tree -Dincludes=net.sf.mpxj 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 Mpxj, 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

### Impact The patch for the historical vulnerability CVE-2020-35460 in MPXJ is incomplete as there is still a possibility that a malicious path could be constructed which would not be picked up by the original fix and allow files to be written to arbitrary locations. ### Patches The issue is addressed in MPXJ version 13.5.1 ### Workarounds Do not pass zip files to MPXJ. ### References N/A ### Credits Issue report and patch provided by yyjLF and sprinkle

CVE-2024-49771 Affected Mpxj Versions

7 component(s)
Fixed Versions:
13.5.1
Product / Package Ecosystem Affected Versions Fixed Version
net.sf.mpxj:mpxj
Maven
≥ 8.3.5
< 13.5.1
13.5.1
mpxj
RubyGems
≥ 8.3.5
< 13.5.1
13.5.1
mpxj
PyPI
≥ 8.3.5
< 13.5.1
13.5.1
net.sf.mpxj
NuGet
≥ 8.3.5
< 13.5.1
13.5.1
net.sf.mpxj-for-csharp
NuGet
≥ 8.3.5
< 13.5.1
13.5.1
net.sf.mpxj-for-vb
NuGet
≥ 8.3.5
< 13.5.1
13.5.1
MPXJ.Net
NuGet
≥ 13.0.0
< 13.5.1
13.5.1

References

Frequently Asked Questions

What is CVE-2024-49771?
CVE-2024-49771 is a security vulnerability in Mpxj involving MPXJ has a Potential Path Traversal Vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Mpxj versions are affected?
Affected versions include releases prior to 13.5.1 across affected packages: net.sf.mpxj:mpxj, mpxj, net.sf.mpxj, net.sf.mpxj-for-csharp, net.sf.mpxj-for-vb, MPXJ.Net.
What version fixes CVE-2024-49771?
Upgrading to 13.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mpxj affected?
Yes, net.sf.mpxj:mpxj is affected in releases prior to 13.5.1. Upgrade your dependency to 13.5.1 or later.
Is net.sf.mpxj affected?
Yes, net.sf.mpxj is affected in releases prior to 13.5.1. Upgrade your dependency to 13.5.1 or later.
What is the CVSS score of CVE-2024-49771?
CVE-2024-49771 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-49771?
CVE-2024-49771 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-49771?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=net.sf.mpxj'. 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-j945-c44v-97g6",
  "modified" : "2024-10-30T14:35:21Z",
  "published" : "2024-10-28T18:30:32Z",
  "aliases" : [ "CVE-2024-49771" ],
  "summary" : "MPXJ has a Potential Path Traversal Vulnerability",
  "details" : "### Impact\nThe patch for the historical vulnerability CVE-2020-35460 in MPXJ is incomplete as there is still a possibility that a malicious path could be constructed which would not be picked up by the original fix and allow files to be written to arbitrary locations.\n\n### Patches\nThe issue is addressed in MPXJ version 13.5.1\n\n### Workarounds\nDo not pass zip files to MPXJ.\n\n### References\nN/A\n\n### Credits\nIssue report and patch provided by yyjLF and sprinkle",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "net.sf.mpxj:mpxj"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mpxj"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mpxj"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "net.sf.mpxj"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "net.sf.mpxj-for-csharp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "net.sf.mpxj-for-vb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.3.5"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "MPXJ.Net"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.0.0"
      }, {
        "fixed" : "13.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/joniles/mpxj/security/advisories/GHSA-j945-c44v-97g6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49771"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/joniles/mpxj/commit/8002802890dfdc8bc74259f37e053e15b827eea0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/joniles/mpxj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/mpxj/CVE-2024-49771.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-28T18:30:32Z",
    "nvd_published_at" : "2024-10-28T17:15:04Z"
  }
}