CVE-2026-39245

decompress: decompress: path traversal via indexOf containment bypass allows arbitrary file write (bypass of CVE-2020-12265 fix)

Published Jul 9, 2026 CVSS 3.1 · 6.2 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
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

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress npm Package
Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write via Improper Path Check in decompress
Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write via Improper Path Check in decompress
Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress Package
Weaknesses CWE-20
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'}

Type Values Removed Values Added
Title Directory Traversal and Arbitrary File Write in decompress Package
Weaknesses CWE-20
CWE-22
Type Values Removed Values Added
First Time appeared Kevva
Kevva decompress
Vendors & Products Kevva
Kevva decompress
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
Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Jul 10, 2026, 3:27 PM
Reserved
Apr 6, 2026, 12:00 AM
Status
Analyzed
Published
Jul 9, 2026, 10:17 PM
Modified
Jul 13, 2026, 12:56 PM
Severity
Moderate
Public date
Jul 9, 2026, 12:00 AM