chore(deps): update dependency tmp to v0.2.6 [security]#341
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency tmp to v0.2.6 [security]#341renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.2.4→0.2.6tmp allows arbitrary temporary file / directory write via symbolic link
dirparameterCVE-2025-54798 / GHSA-52f5-9888-hmc6
More information
Details
Summary
tmp@0.2.3is vulnerable to an Arbitrary temporary file / directory write via symbolic linkdirparameter.Details
According to the documentation there are some conditions that must be held:
Related issue: https://github.com/raszi/node-tmp/issues/207.
The issue occurs because
_resolvePathdoes not properly handle symbolic link when resolving paths:If the
dirparameter points to a symlink that resolves to a folder outside thetmpDir, it's possible to bypass the_assertIsRelativecheck used in_assertAndSanitizeOptions:PoC
The following PoC demonstrates how writing a tmp file on a folder outside the
tmpDiris possible.Tested on a Linux machine.
tmpDirthat points to a directory outside of it$HOME/mydir1(outside thetmpDir):main.jsA Potential fix could be to call
fs.realpathSync(or similar) that resolves also symbolic links.Impact
Arbitrary temporary file / directory write via symlink
Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
tmp has Path Traversal via unsanitized prefix/postfix that enables directory escape
CVE-2026-44705 / GHSA-ph9p-34f9-6g65
More information
Details
Summary
The tmp npm package contains a path traversal vulnerability that allows escaping the intended temporary directory when untrusted data flows into the
prefix,postfix, ordiroptions. 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.Details
Root Cause:
The vulnerability exists in tmp's path construction logic where user-supplied options are directly concatenated into file paths without sanitization or validation.
Technical Flow:
<prefix>-<pid>-<random>-<postfix>path.join(tmpDir, opts.dir, name)path.join()normalizes traversal sequences, allowing escapeVulnerable Pattern:
Path Traversal Mechanics:
../../../evilin prefix escapes directory structureopts.diris absolute,path.join()ignorestmpDircompletelypath.join()resolves../sequences regardless of surrounding text..\\), Unix (../), and mixed path systemsKey Vulnerability Points:
prefix,postfix, ordirparameterspath.join()normalization without containment checksPoC
Basic Path Traversal via prefix:
Directory Escape via postfix:
Absolute Path Bypass via dir:
Advanced Multi-Vector Attack:
Real-World Attack Simulation:
Impact
Arbitrary File Creation:
Attack Scenarios:
1. Web Application Configuration Poisoning:
2. Cache Poisoning:
3. Build Pipeline Compromise:
4. Container Escape Attempt:
5. Multi-Tenant Service Bypass:
Business Impact:
Affected Products
Component Impact:
tmp.file()function - vulnerable to prefix/postfix/dir traversaltmp.dir()function - vulnerable to same parameter manipulationtmp.tmpName()function - if using affected path constructionSeverity: High
CVSS v3.1: 8.1 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L)
CWE Classification:
Remediation
Input Validation and Sanitization:
Secure Implementation Pattern:
Workarounds
For Application Developers:
For Security Teams:
Detection and Monitoring
Static Analysis:
Runtime Detection:
File System Monitoring:
Acknowledgements
Reported by: Mapta / BugBunny_ai
Severity
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:PReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
raszi/node-tmp (tmp)
v0.2.6Compare Source
v0.2.5Compare Source
Configuration
📅 Schedule: (in timezone America/Los_Angeles)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.