# bestzip command injection vulnerability

Source: https://junglewise.ai/threats/bestzip-command-injection-vulnerability-f14dea5d  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-02. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2020-09-02

bestzip is a Node.js package used to create ZIP archives from files and directories. Versions before 2.1.7 fail to sanitize user input when constructing system commands, allowing attackers to inject arbitrary shell commands that execute with the privileges of the application. An attacker who controls the destination parameter can execute arbitrary code on the system where bestzip is running.

Technologies: [bestzip (npm)](https://junglewise.ai/threats/technologies/bestzip). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 2 September 2020.

**Which products and versions are affected?** bestzip (npm) < 2.1.7.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked over the network or with local access, in a software library.

**Am I affected?** 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.

## Technical details

This is a command injection vulnerability (CWE-77) in the bestzip npm package. The vulnerability exists in versions prior to 2.1.7, where user-supplied input to the destination parameter is passed directly to an exec() call without sanitization. An attacker can inject shell metacharacters and commands into the destination argument, which are then executed by the underlying zip command on systems where a native zip binary is available. The attack requires that the destination parameter value be under attacker control—either through CLI arguments or programmatic API calls. Exploitation results in arbitrary command execution with the privileges of the process running bestzip. The vulnerability was patched in version 2.1.7.

## Affected products

- npm bestzip < 2.1.7

## Timeline

- 2020-09-02: disclosed

## References

- [https://www.npmjs.com/advisories/1554](https://www.npmjs.com/advisories/1554)

## Related threats

- [bestzip command injection in options parameter](https://junglewise.ai/threats/cve-2020-7730-bestzip-command-injection-in-options-parameter)
