npm `tar` Package Unicode-Normalization Race Condition / File Collision (CVE-2026-2395)
by dajneem23 · 2026-07-05
- Severity
- Medium
- CVE
- CVE-2026-2395
- Category
- misc
- Affected product
- tar npm package
- Affected versions
- 7.5.3
- Disclosed
- 2026-07-05
- Patch status
- unpatched
Tags
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-01 |
| Author / Researcher | dajneem23 |
| CVE / Advisory | CVE-2026-2395 |
| Category | misc |
| Severity | Medium |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | tar, nodejs, npm, race-condition, unicode-normalization, file-collision, archive-extraction, data-corruption |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | tar npm package |
| Versions Affected | 7.5.3 |
| Language / Platform | Node.js |
| Authentication Required | No |
| Network Access Required | No (local/library-level issue triggered by extracting an attacker-crafted archive) |
Summary
The tar npm package’s parallel-extraction mode (jobs > 1) is vulnerable to a race condition rooted in Unicode normalization differences: filenames like collision_ss and collision_ß can be treated as the same target path due to case/normalization handling, even though they are distinct entries in the archive. When such an archive is extracted with parallel job processing enabled, the two entries can race to create/write the same underlying file or inode, causing one file’s content to silently overwrite or collide with the other’s. The included PoC builds a tar stream containing exactly this pair of colliding filenames (1000 bytes of A vs 1000 bytes of B) and extracts it with jobs: 8 to demonstrate the collision. Note that the PoC repository’s internal README refers to this as “CVE-2026-23950” in its body text, while the archived task metadata identifies it as CVE-2026-2395 — both point to the same underlying tar extraction race condition described here.
Vulnerability Details
Root Cause
tar’s extractor resolves output paths using a normalization/case-folding step that can map visually or semantically distinct filenames (e.g. ss vs ß) to the same on-disk path; when combined with parallel (multi-job) extraction, two archive entries can race to create/write that shared path concurrently.
Attack Vector
- Craft a tar archive containing two entries whose names collide under the library’s normalization logic (e.g.
collision_ssandcollision_ß) but with different contents. - Deliver the archive to a victim process that extracts it using
tarwith parallel processing enabled (jobs> 1). - During extraction, both entries race to the same resolved path/inode.
- Depending on timing, only one file survives, or its content is a mix/overwrite of the two, silently discarding or corrupting the other entry’s data.
Impact
Silent data loss or content corruption during archive extraction, and a potential security-relevant bypass if downstream logic verifies file contents/signatures only after extraction (verification could pass against one file while the deployed file is actually the other).
Environment / Lab Setup
Target: tar (npm package) v7.5.3, Node.js runtime
Attacker: Node.js with the `tar` package installed to build/extract the crafted archive
Proof of Concept
PoC Script
See
index.js(andpackage.json) in this folder.
| |
The script builds an in-memory tar stream containing collision_ss (1000 A characters) and collision_ß (1000 B characters), then extracts it with jobs: 8 into a scratch directory. It inspects the resulting files’ inodes/content and prints [*] GOOD if a collision occurred (single file or shared inode) or [-] No collision if both files extracted separately.
Detection & Indicators of Compromise
$ ls race_exploit_dir/ | wc -l # expect 2, observe 1
Signs of compromise:
- Extracted archives producing fewer files than the entry count in the original tarball.
- Files with unexpected content following extraction of archives containing visually similar/near-duplicate filenames.
- Post-extraction integrity checks (hash/signature) failing intermittently only under parallel-extraction workloads.
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor for an advisory/patched tar release |
| Interim mitigation | Disable parallel extraction (jobs: 1) when processing untrusted archives, and verify file counts/hashes against the archive’s own entry list after extraction |
References
Notes
Mirrored from https://github.com/dajneem23/CVE-2026-2395 on 2026-07-05.
| |