# GHSA-4qqc-mp5f-ccv4: Command Injection in bestzip

- Severity: Critical (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-02T15:05:51.000Z
- Modified: 2020-09-02T15:04:08.000Z
- Weaknesses: CWE-77

## Description

Versions of `bestzip` prior to 2.1.7 are vulnerable to Command Injection. The package fails to sanitize input rules and passes it directly to an `exec` call on the `zip` function . This may allow attackers to execute arbitrary code in the system as long as the values of `destination` is user-controlled. This only affects users with a native `zip` command available. The following examples demonstrate the issue from the CLI and also programatically:
- `bestzip test.zip 'sourcefile; mkdir folder'`
- `zip({ source: 'sourcefile', destination: './test.zip; mkdir folder' })`

(As written by GitHub Advisory Database.)

## Affected

- bestzip (npm): before 2.1.7

## References

- <https://www.npmjs.com/advisories/1554> (web)

## Sources

- GitHub Advisory Database: [GHSA-4qqc-mp5f-ccv4](https://github.com/advisories/GHSA-4qqc-mp5f-ccv4), CC-BY-4.0, modified 2020-09-02

---

Page: https://cve.day/GHSA-4qqc-mp5f-ccv4 · Whole record: https://cve.day/GHSA-4qqc-mp5f-ccv4.json · Rebuilt by cve.day 2026-11-25T22:56:44.048Z
