# CVE-2025-54798: tmp does not restrict arbitrary temporary file / directory write via symbolic link `dir` parameter

> Attackers can write arbitrary files or directories via symbolic link manipulation in the tmp library, potentially leading to code execution or data modification.

- **Severity:** Low 2.5 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/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:** 7 Aug 2025
- **Updated:** 3 Nov 2025
- **Also known as:** CLSA-2026-1775003179, CLSA-2026-1775003184, CLSA-2026-1775003185, CLSA-2026-1775608295, CLSA-2026-1776818190, CLSA-2026-1782694760, CLSA-2026-1784682766, CLSA-2026-1792490490, DEBIAN-CVE-2025-54798, DLA-4268-1, ECHO-9005-3017-0bea, GHSA-52f5-9888-hmc6, MINI-4hc2-vx7m-hgjq, MINI-8854-r47v-wfrh, MINI-c59g-g6x3-c32j, MINI-f9pj-cjhg-v2wm, MINI-g8xp-hmcq-rv44, MINI-gqvw-f5fg-hc82, MINI-jqcx-r88h-hv2v, MINI-pr35-rjwx-3rcr, MINI-pr7q-5jhf-83jc, MINI-qqvx-w279-w4m4, MINI-rmpr-92wq-x9pp, ROOT-APP-NPM-CVE-2025-54798, UBUNTU-CVE-2025-54798, openSUSE-SU-2025:15502-1, openSUSE-SU-2025:15506-1

## What is CVE-2025-54798?

CVE-2025-54798 is a low-severity path traversal vulnerability in raszi node-tmp, published on 7 Aug 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.

Weakness: CWE-59 (Improper Link Resolution Before File Access)

## Which versions are affected by CVE-2025-54798?

2 open source packages ship an affected version, including tmp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tmp` | npm | All versions | 0.2.4 |
| `tmp` | npm | All versions | 0.2.4 |
| `python-bqplot` | openSUSE:Tumbleweed | All versions | 0.12.45-13.1 |
| `python-nbdime` | openSUSE:Tumbleweed | All versions | 4.0.2-23.1 |

Products: Raszi Tmp.

## How do I fix CVE-2025-54798?

Upgrade tmp to 0.2.4 or later.

## Is CVE-2025-54798 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54798 exists.

## Other vulnerabilities in raszi node-tmp

- [CVE-2026-49982](https://insights.sbomify.com/CVE-2026-49982/): tmp: Type-confusion bypass of _assertPath in tmp@0.2.6 allows path traversal via non-string prefix/postfix/template (high 8.2)
- [CVE-2026-44705](https://insights.sbomify.com/CVE-2026-44705/): tmp: Path Traversal via unsanitized prefix/postfix enables directory escape (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54798 and fix it if it is affected.

What it is: CVE-2025-54798 is a low-severity path traversal vulnerability in raszi node-tmp, published on 7 Aug 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54798 exists.

Affected packages and fixed versions:
- tmp (npm): affected all versions; fixed in 0.2.4
- tmp (npm): affected all versions; fixed in 0.2.4

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-2025-54798/ (Markdown: https://insights.sbomify.com/CVE-2025-54798/index.md)
```

## Sources

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

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