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
bestzip
prior to 2.1.7 are vulnerable to Command Injection. The package fails to sanitize input rules and passes it directly to anexec
call on thezip
function . This may allow attackers to execute arbitrary code in the system as long as the values ofdestination
is user-controlled. This only affects users with a nativezip
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