/

CVE-2026-110639

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in @mborne/extract Package

CVE-2026-110639

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical OS command injection vulnerability in @mborne/extract allows attacker-controlled values in archivePath or targetDir options to be interpreted as shell commands.

When these values reach unquoted shell execution strings in the archive extractors, an attacker may execute commands with the privileges of the Node.js process.

A critical OS command injection vulnerability in @mborne/extract allows attacker-controlled values in archivePath or targetDir options to be interpreted as shell commands.

When these values reach unquoted shell execution strings in the archive extractors, an attacker may execute commands with the privileges of the Node.js process.

Affected context

The vulnerability affects applications using vulnerable @mborne/extract functionality to process archives through its unzip, 7z, tar-bz2, or gz extractors. Risk increases when archivePath or targetDir values can be influenced by an untrusted user, uploaded artifact, external request, or other attacker-controlled source before being passed to extract().

The vulnerability affects applications using vulnerable @mborne/extract functionality to process archives through its unzip, 7z, tar-bz2, or gz extractors. Risk increases when archivePath or targetDir values can be influenced by an untrusted user, uploaded artifact, external request, or other attacker-controlled source before being passed to extract().

Exploit preconditions

  • Attack surface: The archive extraction API and its shell-backed extractor implementations
  • Required access: The ability to influence the archivePath or targetDir options supplied to extract()
  • Trigger point: Construction and execution of shell commands during archive extraction
  • Why exploitation is possible: Option values are incorporated into unquoted shelljs exec() command strings, allowing shell metacharacters in untrusted input to alter command interpretation
  • Execution context: Injected commands run with the privileges available to the Node.js process
  • Attack surface: The archive extraction API and its shell-backed extractor implementations
  • Required access: The ability to influence the archivePath or targetDir options supplied to extract()
  • Trigger point: Construction and execution of shell commands during archive extraction
  • Why exploitation is possible: Option values are incorporated into unquoted shelljs exec() command strings, allowing shell metacharacters in untrusted input to alter command interpretation
  • Execution context: Injected commands run with the privileges available to the Node.js process

Why this happens

The underlying flaw is the construction of shell commands by concatenating or interpolating untrusted option values without safe argument handling or effective shell interpretation controls.

Because shelljs exec() processes the resulting strings through a command shell, metacharacters can change the intended command structure and cause additional commands to execute. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection.

The underlying flaw is the construction of shell commands by concatenating or interpolating untrusted option values without safe argument handling or effective shell interpretation controls.

Because shelljs exec() processes the resulting strings through a command shell, metacharacters can change the intended command structure and cause additional commands to execute. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection.

Potential impact

  • An attacker may execute arbitrary operating-system commands
  • The application process and its accessible files may be compromised
  • Credentials, tokens, or other secrets available to the process could be exposed
  • Archive contents or application data could be modified or destroyed
  • The host or surrounding services could be affected, depending on process privileges and network access
  • An attacker may execute arbitrary operating-system commands
  • The application process and its accessible files may be compromised
  • Credentials, tokens, or other secrets available to the process could be exposed
  • Archive contents or application data could be modified or destroyed
  • The host or surrounding services could be affected, depending on process privileges and network access

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from archive extraction workflows and reducing trust in path-related options.

Common defensive patterns include:

  • Prefer library APIs that accept structured argument arrays or direct filesystem operations instead of shell command strings
  • Avoid passing untrusted values through a command shell
  • Apply strict path validation, canonicalization, and allowlist-based constraints to archive and destination paths
  • Keep extraction destinations isolated and prevent path traversal or writes outside intended directories
  • Run the Node.js process with minimal filesystem, operating-system, and network privileges
  • Use sandboxing and resource limits where archive processing handles untrusted inputs
  • Treat archive metadata and extraction options as untrusted until validated

Mitigation generally focuses on removing shell interpretation from archive extraction workflows and reducing trust in path-related options.

Common defensive patterns include:

  • Prefer library APIs that accept structured argument arrays or direct filesystem operations instead of shell command strings
  • Avoid passing untrusted values through a command shell
  • Apply strict path validation, canonicalization, and allowlist-based constraints to archive and destination paths
  • Keep extraction destinations isolated and prevent path traversal or writes outside intended directories
  • Run the Node.js process with minimal filesystem, operating-system, and network privileges
  • Use sandboxing and resource limits where archive processing handles untrusted inputs
  • Treat archive metadata and extraction options as untrusted until validated

How teams detect issues like this

Detection can include static analysis for shelljs exec(), child-process APIs, string interpolation, or concatenation involving archivePath, targetDir, and other external inputs.

Code review should look for shell command construction, missing argument quoting, direct propagation of request or file metadata into extraction options, and archive operations performed with elevated privileges. CI policies can flag shell execution that receives non-constant values, while runtime monitoring can correlate archive-processing requests with unexpected child processes or command activity. Automated code review and software composition analysis tools may help identify related patterns.

Detection can include static analysis for shelljs exec(), child-process APIs, string interpolation, or concatenation involving archivePath, targetDir, and other external inputs.

Code review should look for shell command construction, missing argument quoting, direct propagation of request or file metadata into extraction options, and archive operations performed with elevated privileges. CI policies can flag shell execution that receives non-constant values, while runtime monitoring can correlate archive-processing requests with unexpected child processes or command activity. Automated code review and software composition analysis tools may help identify related patterns.

Sources

SourceLink
github.comgithub.com/mborne/node-extract/blob/v0.2.0/src/extractor/unzip.js#L17-L19
github.comgithub.com/mborne/node-extract/commit/585e5b29657379e73c04f6f950ea8dc5319f8ae1
github.comgithub.com/mborne/node-extract/pull/8
github.comgithub.com/mborne/node-extract/releases/tag/v0.2.1
vulncheck.comvulncheck.com/advisories/mborne-extract-before-0.2.1-os-command-injection-via-archivepath-and-targetdir

Frequently asked

questions

It can be remotely exploitable when a network-facing application allows an attacker to influence archivePath or targetDir values and then invokes the affected extraction functionality. In local-only deployments, exploitation still requires access to the calling workflow or its input sources.

An attacker needs a way to control, directly or indirectly, one of the vulnerable extraction options. The required access may come from an API request, uploaded archive metadata, a job configuration, or another untrusted integration.

The safest pattern is to avoid shell command construction for extraction and use dedicated library APIs with structured arguments, strict path validation, and no shell interpretation.

Treat all paths and extraction parameters as untrusted, enforce allowlists and containment checks, scan code for dynamic shell execution, and run archive-processing components with least privilege.

It can be remotely exploitable when a network-facing application allows an attacker to influence archivePath or targetDir values and then invokes the affected extraction functionality. In local-only deployments, exploitation still requires access to the calling workflow or its input sources.

An attacker needs a way to control, directly or indirectly, one of the vulnerable extraction options. The required access may come from an API request, uploaded archive metadata, a job configuration, or another untrusted integration.

The safest pattern is to avoid shell command construction for extraction and use dedicated library APIs with structured arguments, strict path validation, and no shell interpretation.

Treat all paths and extraction parameters as untrusted, enforce allowlists and containment checks, scan code for dynamic shell execution, and run archive-processing components with least privilege.

Find out what's already
exploitable in your codebase.