Skip to content
Threat Feed
high advisory

Arbitrary Command Execution in bestzip Library via Argument Injection

The bestzip library improperly handles file paths passed to the system zip utility, allowing attackers to inject command line flags and execute arbitrary code by passing paths beginning with hyphens.

CVE search metadata

CVE search record: CVE-2026-80427. Severity: high. CVSS: 8.4. KEV: no. Product: bestzip. Brief: Arbitrary Command Execution in bestzip Library via Argument Injection. Brief link: https://feed.craftedsignal.io/briefs/2026-08-bestzip-command-injection/

The bestzip library, a Node.js utility for creating zip archives, contains a critical vulnerability (CVE-2026-80427) involving improper argument sanitization when invoking the underlying system 'zip' binary. The library constructs the command line arguments for the zip process without using the '--' delimiter to separate command options from source file operands.

An attacker who can influence the list of files or paths passed to the bestzip API can provide a file path starting with a hyphen. Because the zip utility processes arguments in order, these attacker-supplied strings are interpreted as command options. By supplying the '-T' and '-TT' flags followed by a malicious command string, an attacker can coerce the zip utility to execute that command via a shell upon completion of the archive operation. This impacts applications that allow users to influence file names or directory paths that are subsequently processed by the bestzip library. Versions 2.2.6 and 3.0.2 introduced a fix by implementing the mandatory '--' delimiter.

Impact

Successful exploitation allows for arbitrary command execution on the host system with the privileges of the application process running the bestzip library. This vulnerability affects any Node.js application relying on bestzip to process untrusted file inputs, potentially leading to full system compromise, exfiltration of sensitive data, or lateral movement within the environment.

Recommendation

  • Update the bestzip dependency to version 2.2.6 or 3.0.3 (or later) to ensure the '--' delimiter is correctly applied to system calls.
  • Audit applications using bestzip to identify if user-provided file names or directory paths are passed to the library functions without server-side validation.
  • Implement strict input validation or sanitization for all file paths before they are passed to archive-related APIs.
  • Monitor for suspicious child process spawning originating from Node.js applications, specifically targeting the execution of 'zip' or 'unzip' with unusual command line arguments.

Immediate actions

Update bestzip library to patched versions 2.2.6 or 3.0.3.

IT Operations 72h

Mitigations

Identify and sanitize all user-supplied paths passed to bestzip API.

immediate AppSec

CVE-2026-80427