Skip to content
Fencer Intel
critical —

GHSA-4qqc-mp5f-ccv4 json

Command Injection in bestzip

published 6y ago modified 6y ago

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

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: - `bestzip test.zip 'sourcefile; mkdir folder'` - `zip({ source: 'sourcefile', destination: './test.zip; mkdir folder' })`

Patch / fix

  • npm bestzip 2.1.7

Is GHSA-4qqc-mp5f-ccv4 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
npm bestzip
<2.1.7
2.1.7

Classification

Weakness
  • CWE-77 Improper Neutralization of Special Elements used in a Command

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.