# CVE-2024-49771: MPXJ has a Potential Path Traversal Vulnerability


- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 28 Oct 2024
- **Updated:** 29 Oct 2024
- **Also known as:** GHSA-j945-c44v-97g6, PYSEC-2026-1681

## What is CVE-2024-49771?

CVE-2024-49771 is a medium-severity vulnerability in joniles mpxj, published on 28 Oct 2024. 

### Official description

MPXJ is an open source library to read and write project plans from a variety of file formats and databases. 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. The issue is addressed in MPXJ version 13.5.1.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-49771?

15 open source packages ship an affected version, including mpxj, net.sf.mpxj:mpxj and MPXJ.Net.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mpxj` | PyPI | From 8.3.5 | 13.5.1 |
| `mpxj` | PyPI | From 8.3.5 | 13.5.1 |
| `mpxj` | PyPI | From 8.3.5 | 13.5.1 |
| `mpxj` | RubyGems | From 8.3.5 | 13.5.1 |
| `mpxj` | RubyGems | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj:mpxj` | Maven | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj:mpxj` | Maven | From 8.3.5 | 13.5.1 |
| `MPXJ.Net` | NuGet | From 13.0.0 | 13.5.1 |
| `MPXJ.Net` | NuGet | From 13.0.0 | 13.5.1 |
| `net.sf.mpxj` | NuGet | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj` | NuGet | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj-for-csharp` | NuGet | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj-for-csharp` | NuGet | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj-for-vb` | NuGet | From 8.3.5 | 13.5.1 |
| `net.sf.mpxj-for-vb` | NuGet | From 8.3.5 | 13.5.1 |

## How do I fix CVE-2024-49771?

Upgrade mpxj to 13.5.1 or later.

## Is CVE-2024-49771 being exploited?

There is no known exploitation of CVE-2024-49771 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-49771 and fix it if it is affected.

What it is: CVE-2024-49771 is a medium-severity vulnerability in joniles mpxj, published on 28 Oct 2024. 
Exploitation: There is no known exploitation of CVE-2024-49771 in the wild and no public exploit code.

Affected packages and fixed versions:
- mpxj (PyPI): affected from 8.3.5; fixed in 13.5.1
- mpxj (PyPI): affected from 8.3.5; fixed in 13.5.1
- mpxj (PyPI): affected from 8.3.5; fixed in 13.5.1
- mpxj (RubyGems): affected from 8.3.5; fixed in 13.5.1
- mpxj (RubyGems): affected from 8.3.5; fixed in 13.5.1
- net.sf.mpxj:mpxj (Maven): affected from 8.3.5; fixed in 13.5.1
- net.sf.mpxj:mpxj (Maven): affected from 8.3.5; fixed in 13.5.1
- MPXJ.Net (NuGet): affected from 13.0.0; fixed in 13.5.1
- MPXJ.Net (NuGet): affected from 13.0.0; fixed in 13.5.1
- net.sf.mpxj (NuGet): affected from 8.3.5; fixed in 13.5.1
- net.sf.mpxj (NuGet): affected from 8.3.5; fixed in 13.5.1
- net.sf.mpxj-for-csharp (NuGet): affected from 8.3.5; fixed in 13.5.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-49771/ (Markdown: https://insights.sbomify.com/CVE-2024-49771/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-49771
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-49771
- OSV: https://osv.dev/vulnerability/CVE-2024-49771

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-49771/
Summaries are generated and may contain mistakes; the official description above is the record.
