Advisory

GHSA-4qqc-mp5f-ccv4

Also known as: None

Summary

Command Injection in bestzip

Details

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' })

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2020-09-02 15:05 UTC
Modified
2020-09-02 15:04 UTC

Affected packages and fixes

bestzip

npm · All systems

Affected

  • introduced 0, fixed 2.1.7 (semver)

Fixed versions

2.1.7

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences