Summary
Arbitrary File Write via Symlink Extraction in github.com/node-modules/compressing
Brief Introduction
The compressing npm package extracts TAR archives while restoring symbolic links without validating their targets.
By embedding symlinks that resolve outside the intended extraction directory, an attacker can cause subsequent file entries to be written to arbitrary locations on the host file system.
Depending on the extractor’s handling of existing files, this behavior may allow overwriting sensitive files or creating new files in security-critical locations.
Affected Component and Versions
- Component:
github.com/node-modules/compressing - Affected Versions:
<= 1.10.3 || =2.0.0
Vulnerability Details
Root Cause
compressing.tar.uncompress sanitizes the destination paths of archive entries, but it does not restrict or validate the targets of symlinks contained in TAR archives. During extraction, the library creates those symlinks inside the output directory. Later entries that resolve through the symlink are written to the symlink target rather than the intended extraction root, enabling an arbitrary file write.
Reproduction
Environment
- OS: Ubuntu 24.04
- Node.js: v24.12.0
- compressing: 2.0.0
Construct PoC Archive
The following pseudo-code demonstrates the attack logic:
base_dir = "archive/"
with tarfile.open("./poc_arbitrary_write.tar", mode="w") as tar:
add_regular_file(tar, base_dir + "baseFile.txt", "base content\n")
add_symlink(tar, base_dir + "myTmp", "/tmp")
add_regular_file(tar, base_dir + "myTmp/poc.txt", "Arbitrary File Write\n")
Extract the Archive
const compressing = require('compressing');
function untar(archiveName, destPath) {
return compressing.tar.uncompress(archiveName, destPath);
}
async function main() {
const archivePath = process.argv[2];
const destPath = "./output";
if (archivePath && archivePath.endsWith(".tar")) {
await untar(archivePath, destPath);
}
}
main();
Attack Results
After extraction, the output directory contains a symlink pointing to /tmp. The file poc.txt is then written through the symlink to /tmp/poc.txt, demonstrating an arbitrary file write outside the extraction directory.
compressing restores symlinks from TAR archives without validating their targets. By combining a malicious symlink with a subsequent file entry, an attacker can redirect extracted files to arbitrary locations on the host.
Impact
An attacker who can supply a crafted TAR archive can:
Cause files to be written outside the intended extraction directory (arbitrary file write via symlink traversal).
Write files to attacker-controlled paths on the host file system once symbolic links are followed during extraction.
In environments where extraction is performed with elevated privileges or targets executable paths, this may lead to code execution, privilege escalation, data corruption, or denial of service.
CVE-2026-24884 has a CVSS score of 8.4 (High). The vector is requires local access, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.1, 1.10.4); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
compressing to 2.0.1 or later; compressing to 1.10.4 or later
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-24884? CVE-2026-24884 is a high-severity security vulnerability in compressing (npm), affecting versions = 2.0.0. It is fixed in 2.0.1, 1.10.4.
- How severe is CVE-2026-24884? CVE-2026-24884 has a CVSS score of 8.4 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of compressing are affected by CVE-2026-24884? compressing (npm) versions = 2.0.0 is affected.
- Is there a fix for CVE-2026-24884? Yes. CVE-2026-24884 is fixed in 2.0.1, 1.10.4. Upgrade to this version or later.
- Is CVE-2026-24884 exploitable, and should I be worried? Whether CVE-2026-24884 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-24884 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-24884?
- Upgrade
compressingto 2.0.1 or later - Upgrade
compressingto 1.10.4 or later
- Upgrade