# CVE-2022-41954: Temporary File Information Disclosure Vulnerability

> Local attackers can read sensitive project schedule data from insecurely created temporary files on Unix-like systems using the MPXJ library.

- **Severity:** Low 3.3 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Nov 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-jf2p-4gqj-849g, PYSEC-2022-42996

## What is CVE-2022-41954?

CVE-2022-41954 is a low-severity vulnerability in joniles mpxj, published on 25 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

MPXJ is an open source library to read and write project plans from a variety of file formats and databases. On Unix-like operating systems (not Windows or macos), MPXJ's use of `File.createTempFile(..)` results in temporary files being created with the permissions `-rw-r--r--`. This means that any other user on the system can read the contents of this file. When MPXJ is reading a schedule file which requires the creation of a temporary file or directory, a knowledgeable local user could locate these transient files while they are in use and would then be able to read the schedule being processed by MPXJ. The problem has been patched, MPXJ version 10.14.1 and later includes the necessary changes. Users unable to upgrade may set `java.io.tmpdir` to a directory to which only the user running the application has access will prevent other users from accessing these temporary files.

Weakness: CWE-668 (Exposure of Resource to Wrong Sphere), CWE-377 (DEPRECATED: Insecure Temporary File), CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor)

## Which versions are affected by CVE-2022-41954?

11 open source packages ship an affected version, including mpxj, net.sf.mpxj:mpxj and net.sf.mpxj. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mpxj` | PyPI | All versions | 10.14.1 |
| `mpxj` | PyPI | All versions | 10.14.1 |
| `mpxj` | PyPI | All versions | 10.14.1 |
| `net.sf.mpxj:mpxj` | Maven | All versions | 10.14.1 |
| `net.sf.mpxj:mpxj` | Maven | All versions | 10.14.1 |
| `net.sf.mpxj` | NuGet | All versions | 10.14.1 |
| `net.sf.mpxj` | NuGet | All versions | 10.14.1 |
| `net.sf.mpxj-for-csharp` | NuGet | All versions | 10.14.1 |
| `net.sf.mpxj-for-csharp` | NuGet | All versions | 10.14.1 |
| `net.sf.mpxj-for-vb` | NuGet | All versions | 10.14.1 |
| `net.sf.mpxj-for-vb` | NuGet | All versions | 10.14.1 |

Products: Mpxj Mpxj.

## How do I fix CVE-2022-41954?

Upgrade mpxj to 10.14.1 or later.

## Is CVE-2022-41954 being exploited?

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

## Other vulnerabilities in joniles mpxj

- [CVE-2020-25020](https://insights.sbomify.com/CVE-2020-25020/): Improper Restriction of XML External Entity Reference in MPXJ (critical 9.8)
- [CVE-2020-35460](https://insights.sbomify.com/CVE-2020-35460/): MPXJ path Traversal vulnerability (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-41954 and fix it if it is affected.

What it is: CVE-2022-41954 is a low-severity vulnerability in joniles mpxj, published on 25 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-41954 in the wild and no public exploit code.

Affected packages and fixed versions:
- mpxj (PyPI): affected all versions; fixed in 10.14.1
- mpxj (PyPI): affected all versions; fixed in 10.14.1
- mpxj (PyPI): affected all versions; fixed in 10.14.1
- net.sf.mpxj:mpxj (Maven): affected all versions; fixed in 10.14.1
- net.sf.mpxj:mpxj (Maven): affected all versions; fixed in 10.14.1
- net.sf.mpxj (NuGet): affected all versions; fixed in 10.14.1
- net.sf.mpxj (NuGet): affected all versions; fixed in 10.14.1
- net.sf.mpxj-for-csharp (NuGet): affected all versions; fixed in 10.14.1
- net.sf.mpxj-for-csharp (NuGet): affected all versions; fixed in 10.14.1
- net.sf.mpxj-for-vb (NuGet): affected all versions; fixed in 10.14.1
- net.sf.mpxj-for-vb (NuGet): affected all versions; fixed in 10.14.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-2022-41954/ (Markdown: https://insights.sbomify.com/CVE-2022-41954/index.md)
```

## Sources

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

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