Skip to main content
Vulnerability Database/CVE-2026-101894

CVE-2026-101894: Node.js decompress Path Traversal Vulnerability

CVE-2026-101894 is a path traversal vulnerability in the Node.js decompress package that allows attackers to write files outside intended directories through crafted archives with symlink chains. This post covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-101894 Overview

CVE-2026-101894 is a path traversal vulnerability [CWE-22] in the decompress package for Node.js. The default decompress(input, output) API performs lexical containment checks that fail to account for kernel symlink resolution. Attackers can craft archives containing chained symlink entries so a later entry resolves outside the intended output directory. This enables arbitrary file read or write beyond the extraction target. Overwriting startup scripts or configuration files leads to remote code execution. The flaw bypasses the incomplete hardening applied for CVE-2026-53486. The maintained @xhmikosr/decompress package is fixed in 10.2.2 and 11.1.4, while the unmaintained decompress package remains unpatched through 4.2.1.

Critical Impact

Attackers can achieve remote code execution by writing files outside the extraction directory and overwriting startup scripts or configuration files.

Affected Products

  • decompress package (unmaintained) through version 4.2.1
  • @xhmikosr/decompress versions prior to 10.2.2
  • @xhmikosr/decompress versions prior to 11.1.4

Discovery Timeline

  • 2026-09-28 - CVE-2026-101894 published to NVD
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-101894

Vulnerability Analysis

The decompress package extracts archives into a caller-provided output directory. Before writing each entry, it performs a lexical string comparison to confirm the resolved path stays within the output directory. This check does not query the filesystem, so it cannot see whether a previously extracted symlink redirects a later path outside the target directory.

An attacker constructs an archive containing an initial symlink entry pointing to a location outside the output directory. A subsequent entry uses a path that traverses through that planted symlink. The kernel follows the symlink chain during file creation, causing the write to land outside the sandbox. This is a classic Symlink Attack combined with a path traversal bypass.

The issue is a bypass of the prior hardening for CVE-2026-53486, which addressed the surface-level path escape but did not validate that created symlinks themselves resolve within the output directory.

Root Cause

The root cause is reliance on lexical path containment checks without resolving symlinks on disk. The extraction routine validated destination paths as strings rather than calling realpath after each write to confirm the resulting inode lives inside the output directory.

Attack Vector

Exploitation requires an application to call decompress() on an attacker-supplied archive with default options. No authentication or user interaction is needed on the target host. Any service that ingests user-provided archives, such as CI/CD pipelines, upload handlers, or plugin loaders, is exposed.

javascript
// Security patch in index.js (upstream fix)
 import {Buffer} from 'node:buffer';
 // realpath follows symlinks, so a target that escapes via a symlink is caught
-import {realpath} from 'node:fs/promises';
+import {realpath, unlink} from 'node:fs/promises';
 import path from 'node:path';
 import process from 'node:process';
 import {promisify} from 'node:util';

Source: GitHub Commit f6c88c66

The patch imports unlink alongside realpath and validates that each created symlink resolves inside the output directory, removing entries that escape.

Detection Methods for CVE-2026-101894

Indicators of Compromise

  • Files written to unexpected locations outside archive extraction directories, particularly to ~/.bashrc, ~/.profile, /etc/, or Node.js node_modules startup scripts.
  • Archive entries containing symlinks whose targets use ../ sequences or absolute paths outside the extraction root.
  • Unexpected process spawns from services that ingest user-uploaded archives.

Detection Strategies

  • Inspect archives before extraction to enumerate symlink entries and their targets using tools such as tar -tvf or unzip -l.
  • Audit Node.js dependency trees for the unmaintained decompress package and any transitive usage via npm ls decompress.
  • Monitor filesystem writes originating from Node.js processes that extract archives, correlating destination paths against the expected output directory.

Monitoring Recommendations

  • Enable filesystem auditing on servers that process untrusted archives to flag writes outside designated extraction sandboxes.
  • Log all invocations of archive extraction functions with source archive hashes for post-incident correlation.
  • Alert on modifications to shell initialization files, cron entries, and service unit files from application service accounts.

How to Mitigate CVE-2026-101894

Immediate Actions Required

  • Upgrade @xhmikosr/decompress to 10.2.2 or 11.1.4 immediately.
  • Replace the unmaintained decompress package with @xhmikosr/decompress or an alternative maintained archive library.
  • Audit all services that extract user-supplied archives and treat them as untrusted input pending remediation.

Patch Information

Fixes are available in @xhmikosr/decompress versions 10.2.2 and 11.1.4. Refer to the GitHub Security Advisory GHSA-hrh2-vp3x-79xf, the GitHub Release v10.2.2, and the GitHub Release v11.1.4 for release notes and patch commits.

Workarounds

  • Extract archives inside isolated containers or chroot environments with no access to sensitive host paths.
  • Pre-scan archives and reject entries containing symlinks or hard links before invoking extraction.
  • Run extraction as a low-privilege user without write access to startup scripts, cron directories, or configuration files.
bash
# Update via npm to the patched package
npm install @xhmikosr/decompress@^11.1.4

# Verify no unmaintained decompress remains in the dependency tree
npm ls decompress

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.