/

CVE-2026-23950

Severity:

HIGH RISK

(8.8)

Race Condition and Filesystem Path Handling in node-tar

CVE-2026-23950

Modified

Vulnerability type

Category:

Race Condition and Filesystem Path Handling

CWE:

CWE-176, CWE-352, CWE-367

Impact:

Arbitrary File Overwrite via Symlink Poisoning

Severity:

HIGH RISK

(8.8)

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

node-tar up to version 7.5.3 contains a race condition in its PathReservations locking mechanism caused by incomplete handling of Unicode path collisions on macOS APFS/HFS+ and other case/normalization-insensitive filesystems.

An attacker who can supply a crafted tar archive may exploit Unicode-equivalent or case-colliding filenames (for example, ß vs ss) alongside symbolic links to bypass internal concurrency safeguards, enabling symlink poisoning and arbitrary file overwrite during extraction.

Affected context

The vulnerability arises when node-tar is used to extract attacker-controlled tar archives on systems with case-insensitive or Unicode normalization–insensitive filesystems, such as macOS APFS or HFS+.

In these environments, filenames that differ only by Unicode normalization form or case may map to the same underlying inode, while node-tar's PathReservations logic treats them as distinct and fails to serialize their processing.

This mismatch between logical path handling in the library and actual path resolution in the filesystem creates a window where concurrent operations on colliding paths can be interleaved in unsafe ways, especially when symbolic links are involved.

Exploit preconditions

  • Attack surface: Applications or tools that use node-tar to extract tar archives, especially services that accept archives from external or less-trusted sources (e.g., package ingestion pipelines, build systems, CI/CD tasks, update mechanisms).
  • Required access: Ability to provide or influence the contents of a tarball processed by node-tar (for example, uploading an archive to a web service, contributing a package to a registry, or supplying data to a CLI using node-tar).
  • Target environment: Systems using node-tar on filesystems that are case-insensitive and/or normalization-insensitive (such as macOS APFS/HFS+ where Unicode-equivalent filenames may collide at the inode level).
  • Trigger point: Extraction of a crafted archive that includes:
  • Multiple entries whose paths collide at the filesystem level due to Unicode normalization and/or case folding (for example, path/ß and path/ss),
  • Carefully ordered regular files and symbolic links pointing to sensitive locations.
  • Why exploitation is possible: node-tar's PathReservations mechanism hashes and locks paths based on a normalization/casing scheme that does not fully reflect how the underlying filesystem resolves names.
  • As a result, two entries that collide on disk may be treated as separate reservations by node-tar and processed in parallel.
  • This race allows an attacker-controlled symbolic link to be substituted or resolved at a critical moment, turning what should be a safe write into a write through a poisoned symlink.

Why this happens

The core issue is a mismatch between logical path canonicalization in application code and actual name resolution semantics in the underlying filesystem, combined with concurrency.

node-tar introduces a PathReservations system intended to serialize all metadata checks (such as existence, type, and permissions) and file operations (creation, writing, and linking) that operate on the same effective path.

However, the normalization and case-folding strategy used to derive reservation keys did not account for the behavior of case-insensitive and Unicode normalization–insensitive filesystems like APFS.

On such filesystems, paths that differ in Unicode normalization (for example, ß vs ss, or composed vs decomposed forms) or case can collide and refer to the same inode, even though node-tar treats them as distinct.

This behavior maps to:

  • CWE-367 (Time-of-check Time-of-use Race Condition): metadata checks and lock acquisition are performed under one logical path identity, while the filesystem may resolve subsequent operations under a different or colliding path at use time.
  • CWE-176 (Improper Handling of Unicode Encoding): the library does not normalize and compare path strings in a way that matches the filesystem's Unicode normalization logic, leading to inconsistent interpretation of equivalent names.

When these discrepancies are combined with symbolic links, an attacker can orchestrate symlink poisoning where a benign-looking path is locked and validated, but actual writes end up following a malicious symlink to a target outside the intended extraction root.

Potential impact

  • Arbitrary overwrite of files accessible to the node-tar extraction process, potentially including:
  • Application configuration files
  • User data
  • Build artifacts or deployment assets
  • Symlink poisoning leading to writes outside the intended extraction directory, which could:
  • Corrupt system or application binaries if permissions allow
  • Modify scripts executed later in build or deployment pipelines
  • Alter logs or audit trails to obscure subsequent activity
  • Elevation of impact in chained attacks, for example:
  • Replacing configuration to point to attacker-controlled services
  • Injecting malicious code into trusted runtime paths or plugin directories
  • Denial of service by overwriting critical files with invalid or large content, affecting application availability.

General mitigation guidance

Risk reduction strategies generally fall into three themes: aligning path handling with filesystem behavior, restricting what gets extracted, and reducing the blast radius of any overwrite.

1. Normalize and canonicalize paths consistently:

  • Use a normalization form and case mapping strategy that closely matches the behavior of target filesystems (for example, normalization plus locale-aware case folding).
  • Canonicalize all paths to a consistent internal representation before:
  • Acquiring locks or reservations
  • Performing comparisons or deduplication
  • Deciding whether paths are "the same" for concurrency control

2. Treat symbolic links as untrusted by default:

  • When extracting archives from untrusted or semi-trusted sources, consider:
  • Filtering out symbolic link entries entirely where business requirements allow.
  • Resolving and validating final filesystem targets after symlink resolution but before writes, ensuring they remain within the intended extraction root.
  • Avoid following symlinks that escape the designated extraction directory or point to sensitive locations.

3. Serialize operations on effective filesystem paths:

  • Design concurrency control (locks, reservations, queues) based on filesystem-equivalent paths, not just raw input strings:
  • Apply normalization before deriving lock keys.
  • Use path resolution checks to detect potential collisions before processing entries in parallel.
  • When in doubt, favor conservative serialization for ambiguous or potentially colliding paths, especially on case-insensitive or normalization-insensitive filesystems.

4. Limit the consequences of a compromised extraction step:

  • Run extraction in a restricted environment:
  • Use dedicated, non-privileged accounts with minimal filesystem rights.
  • Write into isolated directories that do not contain executable code or important configuration, then explicitly copy validated outputs where needed.
  • Avoid granting node-tar-based extraction processes write access to system directories, application installation paths, or shared configuration stores.

5. Harden archive ingestion workflows:

  • Treat all externally supplied archives as untrusted input:
  • Enforce file type and path whitelisting policies (for example, only allow certain directories or extensions).
  • Reject entries with unexpected Unicode forms, path traversal components, or multiple conflicting encodings for the same logical path.

How teams detect issues like this

Detection focuses on both code-level issues and operational anomalies around archive extraction.

1. Static analysis and code review:

  • Look for:
  • Custom path canonicalization logic that does not explicitly account for Unicode normalization and case folding.
  • Concurrency control or locking built on raw path strings without a normalization step.
  • Parallel extraction pipelines that process archive entries concurrently based solely on string-unique paths.
  • Establish review guidelines requiring:
  • Explicit documentation of filesystem assumptions (case sensitivity, normalization behavior).
  • Clear handling of symbolic links during extraction, including checks to prevent writes outside an intended base directory.

2. Automated scanning and policy enforcement:

  • Integrate linters or SAST tools that flag:
  • Path comparison or deduplication performed without normalization.
  • Use of symlinks in file extraction logic without subsequent boundary checks.
  • Enforce CI policies that:
  • Disallow unsafe archive extraction helpers or wrappers.
  • Require tests for symlink handling and path normalization on target platforms.

3. Runtime monitoring and logging:

  • Instrument extraction workflows to log:
  • All symlink entries encountered and how they are resolved.
  • Cases where multiple entries appear to target the same effective path (based on normalized or resolved paths).
  • Write operations that target directories outside configured extraction roots.
  • Monitor for suspicious patterns, such as:
  • Repeated overwrites of the same file during extraction.
  • Writes into configuration directories or executables emerging from untrusted archives.

4. Platform-specific checks:

  • On macOS and other systems with case-insensitive or normalization-insensitive filesystems:
  • Test extraction logic with intentionally colliding Unicode filenames to ensure collision-aware handling.
  • Validate that application-level path comparisons match actual filesystem behavior across locales and normalization forms.

Sources

SourceLink
github.comgithub.com/isaacs/node-tar/commit/3b1abfae650056edfabcbe0a0df5954d390521e6
github.comgithub.com/isaacs/node-tar/security/advisories/GHSA-r6q2-hw4h-h46w
access.redhat.comaccess.redhat.com/errata/RHSA-2026:18480
access.redhat.comaccess.redhat.com/errata/RHSA-2026:18868
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2144
access.redhat.comaccess.redhat.com/errata/RHSA-2026:2926
access.redhat.comaccess.redhat.com/errata/RHSA-2026:6192
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-23950
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2431036
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-23950.json

Frequently asked

questions

It can be, depending on how node-tar is used. If an application accepts tar archives from network clients or external sources and extracts them using a vulnerable node-tar version on a susceptible filesystem, an attacker can remotely supply a crafted archive to attempt exploitation.

The attacker needs the ability to influence the contents of a tarball processed by node-tar—such as uploading an archive to a web service, contributing a package or artifact, or otherwise controlling the input to a process that calls node-tar's extraction APIs. No direct shell or local account on the target system is required if the archive interface itself is exposed.

The most robust fix pattern is to ensure that all paths are normalized and canonicalized using a scheme that mirrors the target filesystem's behavior before they are used for locking, comparison, or routing decisions, and to treat symbolic links as untrusted. This includes:

  • Normalizing and case-folding paths consistently before deriving lock keys.
  • Serializing operations on all filesystem-equivalent paths.
  • Restricting or eliminating symlink processing for untrusted archives.

To prevent similar issues:

  • Design path handling with explicit knowledge of filesystem semantics (case sensitivity, Unicode normalization, symlink resolution).
  • Base all concurrency, deduplication, and authorization decisions on canonical, normalized paths rather than raw input strings.
  • Apply strict policies for symlink handling: validate resolved targets and ensure they remain within trusted boundaries.
  • Regularly test extraction code with edge-case filenames and colliding Unicode paths on all supported platforms, and incorporate these tests into automated CI pipelines.
Find out what's already
exploitable in your codebase.