{"id":"GHSA-4qqc-mp5f-ccv4","aliases":["GHSA-4qqc-mp5f-ccv4"],"related":[],"kind":"vulnerability","state":"published","title":"Command Injection in bestzip","summary":"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:\n- `bestzip test.zip 'sourcefile; mkdir folder'`\n- `zip({ source: 'sourcefile', destination: './test.zip; mkdir folder' })`","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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:\n- `bestzip test.zip 'sourcefile; mkdir folder'`\n- `zip({ source: 'sourcefile', destination: './test.zip; mkdir folder' })`","format":"markdown","source":"ghsa"}],"published":"2020-09-02T15:05:51.000Z","modified":"2020-09-02T15:04:08.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-77"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.7"}],"ecosystem":"npm","package":"bestzip","purl":"pkg:npm/bestzip","source":"ghsa"}],"references":[{"url":"https://www.npmjs.com/advisories/1554","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4qqc-mp5f-ccv4","url":"https://github.com/advisories/GHSA-4qqc-mp5f-ccv4","licence":"CC-BY-4.0","modified":"2020-09-02T15:04:08.000Z"}],"updatedAt":"2026-11-25T22:56:44.048Z"}