/

CVE-2026-53486

Severity:

CRITICAL RISK

(9.1)

Path Traversal and Link Abuse in Node.js decompress

CVE-2026-53486

Awaiting Analysis

Vulnerability type

Category:

Path Traversal and Insecure Link Handling

CWE:

CWE-22, CWE-59, CWE-732

Impact:

Arbitrary File Read/Write and Privilege Abuse

Severity:

CRITICAL RISK

(9.1)

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

The Node.js decompress package contains multiple extraction flaws that allow archives to create or access files and links outside the intended target directory.

Crafted archives can traverse paths, abuse symlinks and hardlinks, and retain unsafe permission bits, enabling attackers to read, overwrite, or plant privileged files wherever the extracting process can reach.

Affected context

This vulnerability appears in applications that rely on the decompress package to unpack user-supplied or otherwise untrusted archives to a local directory.

It becomes relevant whenever archive contents are assumed to be safely confined to a target path, yet the application does not implement additional filesystem safety checks beyond what decompress provides.

Systems that run the extraction process with elevated privileges, broad filesystem access, or sensitive configuration directories nearby are more exposed to impact.

Exploit preconditions

  • Attack surface: Any feature or service that uses decompress to extract archives, especially uploads, imports, backups, or plug‑in bundles.
  • Required access: Ability to supply or influence the archive being extracted (e.g., authenticated upload, API call, or intercepted download).
  • Trigger point: Invocation of decompress to unpack the crafted archive into a chosen target directory.
  • Why exploitation is possible:
  • Path containment relies on a naive string prefix comparison that can be bypassed with traversal sequences or crafted names.
  • Symlink and hardlink entries are created without validating that link targets remain inside the intended directory.
  • File mode handling does not strip setuid, setgid, or sticky bits, allowing archives to install files with potentially dangerous permissions.

Why this happens

The core issue is improper validation and normalization of file paths and link targets during archive extraction, combined with insufficient permission sanitization.

Instead of resolving and checking canonical paths, the code uses simple string prefix checks to enforce containment, which is fragile and easily bypassed with ../ sequences or edge cases in path encoding (CWE-22: Improper Limitation of a Pathname to a Restricted Directory).

Additionally, link entries (symlinks and hardlinks) are created without validating that their resolved targets stay within the extraction root, enabling link‑based redirection to arbitrary filesystem locations (CWE-59: Improper Link Resolution Before File Access).

Finally, extracted file modes preserve setuid, setgid, or sticky bits from the archive, contrary to secure defaults, which can allow privilege abuse when those files are placed in sensitive directories (CWE-732: Incorrect Permission Assignment for Critical Resource).

Potential impact

  • An attacker may write arbitrary files outside the intended extraction directory, including application configuration or system files reachable by the process.
  • An attacker may read sensitive files by creating links that point to protected paths and then causing the application to process or expose their contents.
  • An attacker could plant or replace executable files or scripts with malicious versions in locations used by the application.
  • An attacker may create files with setuid or setgid bits that can lead to elevated privileges when executed in permissive environments.
  • Archive extraction can be used as a stepping stone to persistent compromise, configuration tampering, or data exfiltration.

General mitigation guidance

Mitigation typically focuses on enforcing strict filesystem containment and reducing trust in archive metadata.

Recommended defensive patterns include:

  • Canonicalize and resolve extraction paths before writing, ensuring all outputs remain under an expected root using robust path normalization and checks against the real filesystem (e.g., comparing resolved absolute paths to the allowed base directory).
  • Reject or safely handle symlink and hardlink entries from untrusted archives; for many applications, the safest pattern is to ignore link entries entirely or only allow them when their targets are verifiably under the same root.
  • Sanitize file permissions on extracted content by stripping setuid, setgid, and sticky bits and applying conservative, application-defined default modes.
  • Run extraction logic with least privilege, limiting filesystem access to a dedicated working directory and avoiding execution under accounts that have broad system write permission.
  • Treat archive content as untrusted input, applying validation rules on file names, allowed extensions, and directory structure rather than trusting the archive's layout.

How teams detect issues like this

Detection can leverage both code-focused and operational controls:

  • Static analysis and manual code review can flag uses of archive-extraction utilities that do not enforce canonical path checks, ignore symlink and hardlink validation, or fail to sanitize permissions.
  • Review patterns where user-supplied archives are unpacked directly into application or system directories, or where extraction occurs with elevated privileges.
  • Implement policy checks or CI guards to require safe extraction helpers (e.g., utilities that reject links and enforce directory confinement) and to prohibit direct writes to sensitive locations during decompression.
  • Runtime monitoring can watch for unexpected file creation or modification outside designated working directories immediately following archive extraction operations.
  • Automated security tools that specialize in dependency behavior or configuration scanning can help identify libraries with unsafe extraction semantics and highlight misuse patterns.

Sources

SourceLink
github.comgithub.com/XhmikosR/decompress/commit/281cefa00cd4275c10479bc5f1abba6b14dee8bd
github.comgithub.com/XhmikosR/decompress/commit/60b5299402e72b0b53ca2e55222e9a1ccb44afae
github.comgithub.com/XhmikosR/decompress/commit/9fcda4b0a66ca22dc8d337f9b0e7c30293c5fb89
github.comgithub.com/XhmikosR/decompress/commit/aca5aac415dc04a6fae5200e51368cff436a09dd
github.comgithub.com/XhmikosR/decompress/releases/tag/v10.2.1
github.comgithub.com/XhmikosR/decompress/releases/tag/v11.1.3
github.comgithub.com/XhmikosR/decompress/security/advisories/GHSA-mp2f-45pm-3cg9

Frequently asked

questions

No. The core problem is that crafted archives can create files and links outside the target directory. If the process has filesystem access beyond that directory, an attacker can potentially read or write to any location that the process user can reach.

The attacker needs the ability to supply or influence the archive that is passed to decompress. This might be through file uploads, plugin packages, backup restores, or any workflow where external archives are processed, even if the feature requires authentication.

The safest pattern is to treat archive contents as untrusted, enforce strict directory confinement with canonical path checks, ignore or tightly restrict symlinks and hardlinks, and sanitize file permissions during extraction. Combining these controls with least‑privilege execution of the decompression process significantly reduces risk.

Future prevention involves adopting secure-by-default extraction utilities, establishing coding guidelines around safe path handling, and requiring security review whenever new file extraction or upload-processing features are introduced. Regular dependency audits, static analysis for path and link handling, and CI policies that enforce safe filesystem access patterns help ensure new code does not reintroduce these classes of flaws.

Find out what's already
exploitable in your codebase.