Skip to content

Command Injection in bestzip

Critical severity GitHub Reviewed Published Sep 2, 2020 to the GitHub Advisory Database • Updated Jan 9, 2023

Package

npm bestzip (npm)

Affected versions

< 2.1.7

Patched versions

2.1.7

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

References

Reviewed Sep 2, 2020
Published to the GitHub Advisory Database Sep 2, 2020
Last updated Jan 9, 2023

Severity

Critical

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-4qqc-mp5f-ccv4

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.