Description
tmp is a temporary file and directory creator for node.js. Prior to 0.2.6, the tmp npm package contains a path traversal vulnerability that allows escaping the intended temporary directory when untrusted data flows into the prefix, postfix, or dir options. By embedding traversal sequences (e.g., ../) or path separators in these parameters, attackers can cause files to be created outside the configured temporary base directory at attacker-controlled locations with the privileges of the running process. This vulnerability affects applications that pass user-controlled data to tmp's file/directory creation functions without proper input sanitization. This vulnerability is fixed in 0.2.6.
Published: 2026-06-11
Score: 7.7 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability allows attackers to inject path traversal sequences such as "../" or path separators into the prefix, postfix, or dir options of the tmp package. This flaw results in files or directories being created outside the intended temporary base directory at locations controlled by the attacker. Because the files are written with the privileges of the running process, an attacker can overwrite critical system files, expose sensitive data, or potentially use the created files to facilitate further attacks such as code injection or privilege escalation. The weakness originates from improper validation of user-supplied path components and is classified as CWE‑22.

Affected Systems

The affected product is the node-tmp library authored by raszi, with all versions prior to 0.2.6 vulnerable. Applications built on Node.js that rely on these older versions and pass untrusted data to tmp’s file/directory creation functions are at risk. Any deployment that uses node-tmp without upgrading to the fixed version is susceptible.

Risk and Exploitability

The CVSS score of 7.7 marks this flaw as high severity, indicating substantial impact if exploited. The EPSS score is not available, but the absence from the CISA KEV catalog suggests exploiting this vulnerability is not yet widely reported. Based on the description, it is inferred that the likely attack vector is via untrusted user input supplied to the tmp functions, often in web application contexts. Attackers would need the ability to supply malicious input to the tmp functions, which is often possible in web applications or services that generate temporary files based on user data. If successfully exploited, the attacker could create arbitrary files in any directory reachable by the node process, effectively bypassing intended sandboxing and potentially leading to further compromise.

Generated by OpenCVE AI on June 11, 2026 at 21:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the node-tmp library to version 0.2.6 or later, which removes the path traversal flaw.
  • If upgrading immediately is not possible, sanitize all user-supplied values for the prefix, postfix, and dir options by rejecting path separators and traversal sequences before passing them to tmp.
  • Configure a protected temporary directory by passing an absolute path to the dir option and ensure the running process has minimal permissions required for file creation.

Generated by OpenCVE AI on June 11, 2026 at 21:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-ph9p-34f9-6g65 tmp has Path Traversal via unsanitized prefix/postfix that enables directory escape
History

Thu, 11 Jun 2026 19:45:00 +0000

Type Values Removed Values Added
First Time appeared Raszi
Raszi node-tmp
Vendors & Products Raszi
Raszi node-tmp

Thu, 11 Jun 2026 16:45:00 +0000

Type Values Removed Values Added
Description tmp is a temporary file and directory creator for node.js. Prior to 0.2.6, the tmp npm package contains a path traversal vulnerability that allows escaping the intended temporary directory when untrusted data flows into the prefix, postfix, or dir options. By embedding traversal sequences (e.g., ../) or path separators in these parameters, attackers can cause files to be created outside the configured temporary base directory at attacker-controlled locations with the privileges of the running process. This vulnerability affects applications that pass user-controlled data to tmp's file/directory creation functions without proper input sanitization. This vulnerability is fixed in 0.2.6.
Title tmp: Path Traversal via unsanitized prefix/postfix enables directory escape
Weaknesses CWE-22
References
Metrics cvssV4_0

{'score': 7.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-11T15:42:46.565Z

Reserved: 2026-05-07T17:07:09.317Z

Link: CVE-2026-44705

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-06-11T17:16:33.853

Modified: 2026-06-11T20:59:17.743

Link: CVE-2026-44705

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-11T21:15:07Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')