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.
Published: 2026-07-09
Score: 6.2 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The decompress package (npm) contains a path traversal weakness (CWE‑22) before version 4.2.2. Its containment check relies on String.indexOf() without enforcing a path separator boundary, allowing a crafted entry such as "/tmp/app_config" to pass validation against "/tmp/app" and be extracted outside the intended directory. Coupled with unvalidated symbolic‑link creation, an attacker can arbitrarily write files to locations adjacent to the extraction target, potentially overwriting configuration files or deploying malicious code.

Affected Systems

Any Node.js application or environment that depends on the decompress npm package version 4.2.1 or earlier may be vulnerable, especially when the library is used to unpack archives without additional sanitization or dependency isolation. The flaw exists in all installations of the package unless the code has been modified to use a stricter path check.

Risk and Exploitability

The CVSS score of 6.2 indicates moderate severity, and the EPSS score of <1% suggests a low probability of widespread exploitation at this time. The flaw is not listed in the CISA KEV catalog. The likely attack vector is an attacker supplying a crafted archive to a vulnerable decompress invocation; if extraction is performed with elevated privileges or the environment permits overwrites of critical system files, the arbitrary file write could be escalated to remote code execution or a persistent compromise.

Generated by OpenCVE AI on July 29, 2026 at 12:55 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the decompress package to version 4.2.2 or later, which implements a corrected path containment check that appends a directory separator.
  • Run the extraction process under a non‑privileged user or within an isolated sandbox so that even if an arbitrary file is written, it cannot affect critical system files.
  • Add a runtime validation step that ensures the resolved extraction path begins with the intended destination directory, rejecting any entries that resolve outside it.

Generated by OpenCVE AI on July 29, 2026 at 12:55 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 14 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress npm Package decompress: decompress: path traversal via indexOf containment bypass allows arbitrary file write (bypass of CVE-2020-12265 fix)
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 13 Jul 2026 21:15:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress npm Package

Mon, 13 Jul 2026 02:00:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write via Improper Path Check in decompress

Sun, 12 Jul 2026 07:45:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write via Improper Path Check in decompress

Sat, 11 Jul 2026 19:45:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress Package
Weaknesses CWE-20

Fri, 10 Jul 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 6.2, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 10 Jul 2026 14:45:00 +0000

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress Package
Weaknesses CWE-20
CWE-22

Thu, 09 Jul 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Kevva
Kevva decompress
Vendors & Products Kevva
Kevva decompress

Thu, 09 Jul 2026 21:45:00 +0000

Type Values Removed Values Added
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.
References

Subscriptions

Kevva Decompress
cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-07-10T15:27:09.755Z

Reserved: 2026-04-06T00:00:00.000Z

Link: CVE-2026-39245

cve-icon Vulnrichment

Updated: 2026-07-10T15:18:19.220Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-09T00:00:00Z

Links: CVE-2026-39245 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-29T13:00:16Z

Weaknesses
  • CWE-22

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