CVE-2020-7730: bestzip command injection in options parameter

CVE-2020-7730 · Severity: low · CVSS 3.1 · Published 2021-05-06

bestzip is a Node.js library for creating ZIP archives programmatically. A command injection vulnerability in the options parameter allows attackers to execute arbitrary shell commands with the privileges of the application using the library. This could lead to complete system compromise if the application processes untrusted input.

Technologies: bestzip (npm). Vendors: npm.

Quick answers

Is CVE-2020-7730 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-7730 being exploited in the wild.
How severe is CVE-2020-7730?
Low severity, with a CVSS score of 3.1, published 6 May 2021.
Which products and versions are affected?
bestzip (npm) SEMVER:introduced=0,fixed=2.1.7.
Is there a fix for CVE-2020-7730?
Yes. bestzip (npm): upgrade to 2.1.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2020-7730 attacked?
It is attacked over the network.
Am I affected by CVE-2020-7730?
Check whether you run bestzip (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • bestzip (npm): upgrade to 2.1.7 or later
    npm install bestzip@2.1.7

Technical details

The vulnerability is a command injection flaw (CWE-78) in bestzip versions before 2.1.7, stemming from unsafe use of shell execution via child_process.exec() when processing the options parameter. An attacker can inject shell metacharacters into the options parameter to break out of the intended command context and execute arbitrary OS commands. No authentication or user interaction is required; exploitation occurs if an application passes untrusted data to bestzip's options. The fix migrated from cp.exec() to cp.spawn() to avoid shell interpretation and applied path expansion logic to prevent injection while maintaining feature parity.

Affected products

  • bestzip bestzip < 2.1.7

Identifiers

  • CVE-2020-7730
  • GHSA-6xv6-jpvw-cx6q

Timeline

  • 2020-09-04: disclosed
  • 2021-05-06: advisory
  • 2021-05-04: patched: Version 2.1.7 released with fix

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.