Command Injection in bestzip
Critical severity
GitHub Reviewed
Published
Sep 2, 2020
to the GitHub Advisory Database
•
Updated Jan 9, 2023
Description
Reviewed
Sep 2, 2020
Published to the GitHub Advisory Database
Sep 2, 2020
Last updated
Jan 9, 2023
Versions of
bestzipprior to 2.1.7 are vulnerable to Command Injection. The package fails to sanitize input rules and passes it directly to anexeccall on thezipfunction . This may allow attackers to execute arbitrary code in the system as long as the values ofdestinationis user-controlled. This only affects users with a nativezipcommand 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