A vulnerability in node-tar versions prior to 8.0.0 allows an attacker to craft a tar archive with a deeply nested symlink linkpath that triggers quadratic memory allocation during extraction. This leads to an uncatchable out-of-memory (OOM) crash of the Node.js process, causing a fatal error and process abort. The flaw arises because the existing maxDepth check applies only to entry.path, not to entry.linkpath, allowing a shallow entry.path with a deeply nested linkpath to bypass protections. A small compressed archive (as little as 181 bytes) can cause immediate heap exhaustion.
A vulnerability in the node-tar package prior to version 8.0.0 allows untrusted compressed archives to cause excessive memory usage during decompression. The flaw arises because decompression buffers inflated data in memory without applying backpressure, and zero-size entries are queued without limit. This can lead to memory exhaustion even when the decompressed size stays within configured ratio limits.
A vulnerability in node-tar versions prior to 8.0.0 causes incomplete truncation of NUL-byte characters in ustar, GNU, and PAX archive entry names. This leads to name differentials where node-tar's interpretation of file names differs from other tools and can cause asynchronous extraction processes to crash if a NUL byte remains in a filename passed to the filesystem.
node-tar versions 7.5.0 through 7.99.x incorrectly parse POSIX PAX extended headers by splitting on newlines instead of correctly consuming length-delimited records. This causes legitimate records containing newlines to be dropped and attacker-controlled forged records to be injected, allowing arbitrary manipulation of file attributes such as path, size, linkpath, mode, uid, gid, and mtime. This divergence from standard implementations like GNU tar and Python tarfile leads to integrity issues during archive extraction or listing. The issue is fixed in node-tar 8.0.0.
node-tar versions prior to 8.0.0 contain multiple issues in the handling of archive framing and meta entries, where the PAX size is incorrectly applied to GNU/PAX meta entries. This causes node-tar to interpret archive entries differently than other tar implementations, potentially allowing an attacker supplying a crafted archive to bypass scanners or policy checks before extraction. Additionally, a meta-entry memory limit can be exceeded, and inconsistencies may propagate into archives repacked by node-tar. The issues were fixed in version 8.0.0.
A vulnerability in node-tar versions 7.0.0 through 7.5.22 allows crafted tar archives with consecutive PAX headers to cause node-tar to interpret metadata blocks as real filesystem entries. This can lead to hidden files being extracted or existing files truncated, bypassing archive member inspection and allowlists. The issue is fixed in version 8.0.0.
A vulnerability in node-tar up to version 7.5.22 allows newline injection in PAX extended-header records. This flaw enables attackers to forge arbitrary entry attributes such as path, linkpath, size, and uid by exploiting improper parsing of PAX records. The most severe impact is path overwrite, allowing an attacker to write files outside the intended archive structure, demonstrated by overwriting package.json and executing malicious postinstall scripts on Windows.
A vulnerability in the node-tar package (versions prior to 8.0.0) allows a crafted tar archive with a Global Extended Header containing a 'linkpath' field to inject attacker-controlled linkpath values into every entry parsed by tar.Parser. This occurs without warnings even under strict mode. While the tar extraction methods tar.x() and tar.extract() are not vulnerable due to additional path traversal guards, direct consumers of tar.Parser or tar.list() that trust entry.linkpath without validation can be tricked into reading or writing files outside the intended directory.
CVE-2026-140240 affects the node-tar package versions prior to 8.0.2. It involves inefficient path-reservation bookkeeping during archive extraction, where certain path components and link paths are not properly bounded in length or depth. This leads to excessive memory and CPU consumption, potentially causing crashes when extracting crafted small archives using the default async API.
A denial of service vulnerability in node-tar versions >=7.5.22 and <8.0.0 allows an unauthenticated attacker to crash any Node.js process that lists or extracts a crafted 4-byte file containing a zstd magic header using the asynchronous file API. This occurs on Node.js runtimes without native zlib zstd support (Node 18.x, 20.x, 21.x, 22.0-22.14, 23.0-23.7). The crash is due to an uncaught TypeError thrown synchronously inside a stream data callback, which kills the process. The issue is fixed in node-tar 8.0.0 and in Node.js versions 22.15.0, 23.8.0, and later where zlib includes native zstd bindings.
The node-tar library improperly validates the 'size' field in PAX extended headers, allowing a non-finite value (Infinity) to bypass checks. This causes the parser to treat the entry size as infinite, resulting in loss of subsequent archive entries during extraction and an uncaught exception crash during re-packing. An unauthenticated attacker supplying a crafted tar archive can trigger these denial-of-service conditions without user interaction.
node-tar versions prior to 8.0.0 contain a vulnerability in their symlink target containment check. The check is lexical and does not resolve symlinks on the filesystem, allowing crafted nested symlinks with '..' components to bypass containment and point outside the extraction directory. This can lead to arbitrary file reads if downstream processes follow these symlinks. The issue was fixed in version 8.0.0.
A vulnerability in node-tar versions 7.5.5 through 7.5.22 allows crafted archive entries with symlink paths ending in '/.' to bypass path containment checks. This enables creation of symbolic links that point outside the intended extraction directory without warning. The issue is a regression introduced by a previous fix and is resolved in version 8.0.0.
A vulnerability in node-tar versions up to 7.5.22 on non-Windows hosts allows crafted tar archives to create symbolic links that escape the intended extraction directory. This occurs due to inconsistent handling of backslash separators in path containment checks versus symlink creation, enabling arbitrary file read and extraction containment escape.
A vulnerability in node-tar versions prior to 8.0.0 allows crafted tar archives to create symbolic links that escape the intended extraction directory by using lexical '..' segments after an in-archive symlink. This bypasses the intended linkpath sanitization, enabling attackers to overwrite or read arbitrary files outside the extraction root with the privileges of the extracting user. The issue is fixed in version 8.0.0.
A vulnerability in node-tar version 7.5.22 allows extraction of symbolic links that effectively point outside the intended extraction directory. This occurs due to improper validation of symlink targets containing '..' components after symlink resolution, enabling path traversal outside the extraction root. The issue is fixed in version 8.0.0.
A vulnerability in the node-tar package versions 7.5.5 through 7.5.23 allows creation of symbolic links that escape the intended extraction directory via a symlink chain. This breaks the expected protection that symlinks cannot point outside the extraction folder, potentially enabling unauthorized file access or modification outside the extraction path. The issue is fixed in version 8.0.0.
A vulnerability in node-tar versions 7.5.5 through 7.5.22 allows symbolic links extracted by tar.x() to resolve outside the intended extraction directory via chained symlinks that use '..' components. This bypasses the intended containment checks and can lead to file read/write access outside the extraction root. The issue is a regression introduced in version 7.5.5 and fixed in version 8.0.0.
A denial of service vulnerability in node-tar's asynchronous extraction allows a crafted tar archive to cause a permanent hang. This occurs when a Link or SymbolicLink entry's linkpath is a hierarchical relative (ancestor or descendant) of its own path, causing an internal path-reservation queue deadlock. The extraction promise never resolves or rejects, no warnings are emitted, and subsequent entries are skipped silently. This affects node-tar versions from 7.5.22 up to but not including 8.0.0 on POSIX systems. Windows is unaffected. The issue is fixed in version 8.0.0.
A vulnerability in the node-tar package's synchronous stream extraction (UnpackSync) causes the extraction stream to hang indefinitely after processing any archive entry that fails, such as a hardlink with a nonexistent target. This occurs because the internal pending counter becomes negative, preventing the stream from emitting completion events like 'end', 'finish', or 'close'. The issue affects only the synchronous stream extraction without the 'file' option and does not impact the asynchronous API or the synchronous file-based API. The vulnerability results in a denial of service by causing consumers awaiting stream completion to hang indefinitely, but it does not affect confidentiality, integrity, or write incorrect data. A fix is available in version 8.0.0.