PT-2026-43627 · Npm+1 · Tmp+1
CVSS v4.0
8.7
High
| Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
Name of the Vulnerable Software and Affected Versions
tmp (affected versions not specified)
Description
The
tmp npm package contains a path traversal issue that allows escaping the intended temporary directory when untrusted data is passed into the prefix, postfix, or dir options. By embedding traversal sequences such as ../ or path separators, attackers can cause files to be created at attacker-controlled locations with the privileges of the running process. This occurs because the package directly concatenates user-supplied options into file paths without proper sanitization or validation, relying on path.join() which normalizes traversal sequences. The issue affects the tmp.file(), tmp.dir(), and tmp.tmpName() functions.Recommendations
At the moment, there is no information about a newer version that contains a fix for this vulnerability.
As a temporary workaround, sanitize the
prefix and postfix parameters by removing path separators and traversal sequences, and validate that the dir parameter is not an absolute path and does not escape the base directory.
Avoid passing user-controlled data to the tmp.file(), tmp.dir(), and tmp.tmpName() functions.Exploit
DoS
Path traversal
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Red Os
Tmp