CVE-2020-7730: Command injection in bestzip
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.91656%
CWE
Published
5/6/2021
Updated
2/1/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
bestzip | npm | < 2.1.7 | 2.1.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from constructing a system command via string interpolation of user-controlled 'options.source' input passed to child_process.exec()
. The pre-patch implementation in nativeZip()
concatenated sources into a shell command without proper escaping. The commit 45d4a90 shows the fix: replacing exec()
with spawn()
and handling arguments as an array via expandSources()
, which prevents shell interpretation. The use of exec()
with unsanitized input in command strings is a well-known pattern for CWE-78 vulnerabilities.