Update dependency tar to v7 [SECURITY] #1852
Open
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^6.1.11→^7.0.0GitHub Vulnerability Alerts
CVE-2026-23745
Summary
The
node-tarlibrary (<= 7.5.2) fails to sanitize thelinkpathofLink(hardlink) andSymbolicLinkentries whenpreservePathsis false (the default secure behavior). This allows malicious archives to bypass the extraction root restriction, leading to Arbitrary File Overwrite via hardlinks and Symlink Poisoning via absolute symlink targets.Details
The vulnerability exists in
src/unpack.tswithin the[HARDLINK]and[SYMLINK]methods.1. Hardlink Escape (Arbitrary File Overwrite)
The extraction logic uses
path.resolve(this.cwd, entry.linkpath)to determine the hardlink target. Standard Node.js behavior dictates that if the second argument (entry.linkpath) is an absolute path,path.resolveignores the first argument (this.cwd) entirely and returns the absolute path.The library fails to validate that this resolved target remains within the extraction root. A malicious archive can create a hardlink to a sensitive file on the host (e.g.,
/etc/passwd) and subsequently write to it, if file permissions allow writing to the target file, bypassing path-based security measures that may be in place.2. Symlink Poisoning
The extraction logic passes the user-supplied
entry.linkpathdirectly tofs.symlinkwithout validation. This allows the creation of symbolic links pointing to sensitive absolute system paths or traversing paths (../../), even when secure extraction defaults are used.PoC
The following script generates a binary TAR archive containing malicious headers (a hardlink to a local file and a symlink to
/etc/passwd). It then extracts the archive using standardnode-tarsettings and demonstrates the vulnerability by verifying that the local "secret" file was successfully overwritten.Impact
LinkandSymbolicLinktar entries from extracted packages.)CVE-2026-23950
TITLE: Race Condition in node-tar Path Reservations via Unicode Sharp-S (ß) Collisions on macOS APFS
AUTHOR: Tomás Illuminati
Details
A race condition vulnerability exists in
node-tar(v7.5.3) this is to an incomplete handling of Unicode path collisions in thepath-reservationssystem. On case-insensitive or normalization-insensitive filesystems (such as macOS APFS, In which it has been tested), the library fails to lock colliding paths (e.g.,ßandss), allowing them to be processed in parallel. This bypasses the library's internal concurrency safeguards and permits Symlink Poisoning attacks via race conditions. The library uses aPathReservationssystem to ensure that metadata checks and file operations for the same path are serialized. This prevents race conditions where one entry might clobber another concurrently.In MacOS the
join(normalizeUnicode(p)),FS confuses ß with ss, but this code does not. For example:PoC
Impact
This is a Race Condition which enables Arbitrary File Overwrite. This vulnerability affects users and systems using node-tar on macOS (APFS/HFS+). Because of using
NFDUnicode normalization (in whichßandssare different), conflicting paths do not have their order properly preserved under filesystems that ignore Unicode normalization (e.g., APFS (in whichßcauses an inode collision withss)). This enables an attacker to circumvent internal parallelization locks (PathReservations) using conflicting filenames within a malicious tar archive.Remediation
Update
path-reservations.jsto use a normalization form that matches the target filesystem's behavior (e.g.,NFKD), followed by firsttoLocaleLowerCase('en')and thentoLocaleUpperCase('en').Users who cannot upgrade promptly, and who are programmatically using
node-tarto extract arbitrary tarball data should filter out allSymbolicLinkentries (as npm does) to defend against arbitrary file writes via this file system entry name collision issue.CVE-2026-24842
Summary
node-tar contains a vulnerability where the security check for hardlink entries uses different path resolution semantics than the actual hardlink creation logic. This mismatch allows an attacker to craft a malicious TAR archive that bypasses path traversal protections and creates hardlinks to arbitrary files outside the extraction directory.
Details
The vulnerability exists in
lib/unpack.js. When extracting a hardlink, two functions handle the linkpath differently:Security check in
[STRIPABSOLUTEPATH]:Hardlink creation in
[HARDLINK]:Example: An application extracts a TAR using
tar.extract({ cwd: '/var/app/uploads/' }). The TAR contains entrya/b/c/d/xas a hardlink to../../../../etc/passwd.Security check resolves the linkpath relative to the entry's parent directory:
a/b/c/d/ + ../../../../etc/passwd=etc/passwd. No../prefix, so it passes.Hardlink creation resolves the linkpath relative to the extraction directory (
this.cwd):/var/app/uploads/ + ../../../../etc/passwd=/etc/passwd. This escapes to the system's/etc/passwd.The security check and hardlink creation use different starting points (entry directory
a/b/c/d/vs extraction directory/var/app/uploads/), so the same linkpath can pass validation but still escape. The deeper the entry path, the more levels an attacker can escape.PoC
Setup
Create a new directory with these files:
package.json
{ "dependencies": { "tar": "^7.5.0" } }secret.txt (sensitive file outside uploads/)
server.js (vulnerable file upload server)
create-malicious-tar.js (attacker creates exploit TAR)
Run
Impact
An attacker can craft a malicious TAR archive that, when extracted by an application using node-tar, creates hardlinks that escape the extraction directory. This enables:
Immediate (Read Attack): If the application serves extracted files, attacker can read any file readable by the process.
Conditional (Write Attack): If the application later writes to the hardlink path, it modifies the target file outside the extraction directory.
Remote Code Execution / Server Takeover
~/.ssh/authorized_keys/etc/cron.d/*,~/.crontab~/.bashrc,~/.profile.js,.php,.pyfiles/etc/systemd/system/*.service/etc/passwd(if running as root)Data Exfiltration & Corruption
.env, secretsRelease Notes
isaacs/node-tar (tar)
v7.5.7Compare Source
v7.5.6Compare Source
v7.5.5Compare Source
v7.5.4Compare Source
v7.5.3Compare Source
v7.5.2Compare Source
v7.5.1Compare Source
v7.5.0Compare Source
v7.4.4Compare Source
v7.4.3Compare Source
v7.4.2Compare Source
v7.4.1Compare Source
v7.4.0Compare Source
v7.3.0Compare Source
v7.2.0Compare Source
v7.1.0Compare Source
v7.0.1Compare Source
v7.0.0Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.