GHSA-4qqc-mp5f-ccv4: Command Injection in bestzip
N/A
CVSS Score
Basic Information
CVE ID
-
GHSA ID
EPSS Score
-
CWE
Published
9/2/2020
Updated
1/9/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
-
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 stems from the nativeZip
function constructing a shell command by concatenating user-controlled 'destination' and 'source' parameters. The patch shows a transition from dangerous cp.exec
(which spawns a shell) to safe cp.spawn
(which avoids shell interpretation) with explicit argument arrays. The original function's command string construction (visible in the removed code in the patch) lacked any input sanitization, making it vulnerable to injection when user-controlled values contain shell metacharacters.