CVE-2026-39245 Details
Description
decompress before 4.2.2 contains an improper path containment check that enables directory traversal and arbitrary file write. The safeMakeDir function (index.js line 29) and the extraction path validation (index.js line 106) use String.indexOf() to verify the resolved path is within the output directory: realDestinationDir.indexOf(realOutputPath) !== 0. This check is flawed because it does not enforce a path separator boundary. For example, "/tmp/app_config".indexOf("/tmp/app") returns 0, incorrectly passing the check even though /tmp/app_config is outside /tmp/app. Combined with the unvalidated symlink creation in the same package, an attacker can write arbitrary files to directories adjacent to the extraction target. This is a bypass of the fix for CVE-2020-12265. The correct check requires appending a path separator: realParentPath.indexOf(realOutputPath + path.sep) !== 0.
A directory traversal vulnerability has been identified in the 'decompress' package for Node.js, specifically in versions prior to 4.2.2. The issue arises from an improper path containment check that allows attackers to traverse directories and write arbitrary files outside the intended extraction target. This vulnerability exploits the 'safeMakeDir' function and the extraction path validation, which incorrectly verify the resolved path's containment within the output directory. The flaw lies in the use of 'String.indexOf()' for validation without enforcing a path separator boundary, enabling the exploitation of symlink creation within the same package to write files to adjacent directories.
Users are advised not to extract untrusted archives with the 'decompress' package until this vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 10, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/kevva/decompress/issues/115 | CISA-ADP | ExploitVendor Advisory |
| https://github.com/kevva/decompress | [email protected] | Product |
| https://github.com/kevva/decompress/issues/115 | [email protected] | ExploitVendor Advisory |
| https://nvd.nist.gov/vuln/detail/CVE-2020-12265 | [email protected] | US Government Resource |
| https://www.npmjs.com/package/decompress | [email protected] | Product |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| decompress project decompress | <= 4.2.1 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 13, 2026 | Initial Analysis | [email protected] |
| Jul 10, 2026 | CVE Modified | CISA-ADP |
| Jul 9, 2026 | New CVE Received | [email protected] |