Open
Conversation
a494498 to
ce1dbab
Compare
ce1dbab to
93267a9
Compare
93267a9 to
98f71a8
Compare
98f71a8 to
954e52d
Compare
954e52d to
1182a60
Compare
1182a60 to
20778a6
Compare
20778a6 to
f3d6735
Compare
f3d6735 to
1c19a60
Compare
1c19a60 to
62f2f10
Compare
62f2f10 to
bba3d66
Compare
bba3d66 to
55a1c46
Compare
55a1c46 to
9101ad9
Compare
9101ad9 to
fd6191e
Compare
fd6191e to
470ca78
Compare
470ca78 to
f7d2871
Compare
bcf29f8 to
fb9c9e1
Compare
fb9c9e1 to
614786c
Compare
614786c to
e2d83c5
Compare
e2d83c5 to
049f92a
Compare
049f92a to
c34a75d
Compare
c34a75d to
8df6f54
Compare
8df6f54 to
9988aac
Compare
9988aac to
2b43fc4
Compare
2b43fc4 to
dd32618
Compare
dd32618 to
ae4a481
Compare
188b7ad to
a39601f
Compare
f522f0e to
7b273cd
Compare
246d538 to
7568824
Compare
7568824 to
d7a8280
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
~0.1.12→~7.5.8GitHub Vulnerability Alerts
CVE-2015-8860
Versions of
tarprior to 2.0.0 are affected by an arbitrary file write vulnerability. The vulnerability occurs becausetardoes not verify that extracted symbolic links to not resolve to targets outside of the extraction root directory.Recommendation
Update to version 2.0.0 or later
CVE-2018-20834
Versions of
tarprior to 4.4.2 for 4.x and 2.2.2 for 2.x are vulnerable to Arbitrary File Overwrite. Extracting tarballs containing a hardlink to a file that already exists in the system, and a file that matches the hardlink will overwrite the system's file with the contents of the extracted file.Recommendation
For tar 4.x, upgrade to version 4.4.2 or later.
For tar 2.x, upgrade to version 2.2.2 or later.
CVE-2021-32804
Impact
Arbitrary File Creation, Arbitrary File Overwrite, Arbitrary Code Execution
node-taraims to prevent extraction of absolute file paths by turning absolute paths into relative paths when thepreservePathsflag is not set totrue. This is achieved by stripping the absolute path root from any absolute file paths contained in a tar file. For example/home/user/.bashrcwould turn intohome/user/.bashrc.This logic was insufficient when file paths contained repeated path roots such as
////home/user/.bashrc.node-tarwould only strip a single path root from such paths. When given an absolute file path with repeating path roots, the resulting path (e.g.///home/user/.bashrc) would still resolve to an absolute path, thus allowing arbitrary file creation and overwrite.Patches
3.2.2 || 4.4.14 || 5.0.6 || 6.1.1
NOTE: an adjacent issue CVE-2021-32803 affects this release level. Please ensure you update to the latest patch levels that address CVE-2021-32803 as well if this adjacent issue affects your
node-taruse case.Workarounds
Users may work around this vulnerability without upgrading by creating a custom
onentrymethod which sanitizes theentry.pathor afiltermethod which removes entries with absolute paths.Users are encouraged to upgrade to the latest patch versions, rather than attempt to sanitize tar input themselves.
CVE-2021-37713
Impact
Arbitrary File Creation, Arbitrary File Overwrite, Arbitrary Code Execution
node-tar aims to guarantee that any file whose location would be outside of the extraction target directory is not extracted. This is, in part, accomplished by sanitizing absolute paths of entries within the archive, skipping archive entries that contain
..path portions, and resolving the sanitized paths against the extraction target directory.This logic was insufficient on Windows systems when extracting tar files that contained a path that was not an absolute path, but specified a drive letter different from the extraction target, such as
C:some\path. If the drive letter does not match the extraction target, for exampleD:\extraction\dir, then the result ofpath.resolve(extractionDirectory, entryPath)would resolve against the current working directory on theC:drive, rather than the extraction target directory.Additionally, a
..portion of the path could occur immediately after the drive letter, such asC:../foo, and was not properly sanitized by the logic that checked for..within the normalized and split portions of the path.This only affects users of
node-taron Windows systems.Patches
4.4.18 || 5.0.10 || 6.1.9
Workarounds
There is no reasonable way to work around this issue without performing the same path normalization procedures that node-tar now does.
Users are encouraged to upgrade to the latest patched versions of node-tar, rather than attempt to sanitize paths themselves.
Fix
The fixed versions strip path roots from all paths prior to being resolved against the extraction target folder, even if such paths are not "absolute".
Additionally, a path starting with a drive letter and then two dots, like
c:../, would bypass the check for..path portions. This is checked properly in the patched versions.Finally, a defense in depth check is added, such that if the
entry.absoluteis outside of the extraction taret, and we are not in preservePaths:true mode, a warning is raised on that entry, and it is skipped. Currently, it is believed that this check is redundant, but it did catch some oversights in development.CVE-2024-28863
Description:
During some analysis today on npm's
node-tarpackage I came across the folder creation process, Basicly if you provide node-tar with a path like this./a/b/c/foo.txtit would create every folder and sub-folder here a, b and c until it reaches the last folder to createfoo.txt, In-this case I noticed that there's no validation at all on the amount of folders being created, that said we're actually able to CPU and memory consume the system running node-tar and even crash the nodejs client within few seconds of running it using a path with too many sub-folders insideSteps To Reproduce:
You can reproduce this issue by downloading the tar file I provided in the resources and using node-tar to extract it, you should get the same behavior as the video
Proof Of Concept:
Here's a video show-casing the exploit:
Impact
Denial of service by crashing the nodejs client when attempting to parse a tar archive, make it run out of heap memory and consuming server CPU and memory resources
Report resources
payload.txt
archeive.tar.gz
Note
This report was originally reported to GitHub bug bounty program, they asked me to report it to you a month ago
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, secretsCVE-2026-26960
Summary
tar.extract()in Nodetarallows an attacker-controlled archive to create a hardlink inside the extraction directory that points to a file outside the extraction root, using default options.This enables arbitrary file read and write as the extracting user (no root, no chmod, no
preservePaths).Severity is high because the primitive bypasses path protections and turns archive extraction into a direct filesystem access primitive.
Details
The bypass chain uses two symlinks plus one hardlink:
a/b/c/up -> ../..a/b/escape -> c/up/../..exfil(hardlink) ->a/b/escape/<target-relative-to-parent-of-extract>Why this works:
Linkpath checks are string-based and do not resolve symlinks on disk for hardlink target safety.
STRIPABSOLUTEPATHlogic in:../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:255../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:268../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:281Hardlink extraction resolves target as
path.resolve(cwd, entry.linkpath)and then callsfs.link(target, destination).../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:566../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:567../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:703Parent directory safety checks (
mkdir+ symlink detection) are applied to the destination path of the extracted entry, not to the resolved hardlink target path.../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:617../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/unpack.js:619../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/mkdir.js:27../tar-audit-setuid - CVE/node_modules/tar/dist/commonjs/mkdir.js:101As a result,
exfilis created inside extraction root but linked to an external file. The PoC confirms shared inode and successful read+write viaexfil.PoC
hardlink.js
Environment used for validation:
v25.4.07.5.7tar.extract({ file, cwd }))Steps:
Prepare/locate a
tarmodule. Ifrequire('tar')is not available locally, setTAR_MODULEto an absolute path to a tar package directory.Run:
TAR_MODULE="$(cd '../tar-audit-setuid - CVE/node_modules/tar' && pwd)" node hardlink.jsInterpretation:
same_inode=true: extractedexfiland external secret are the same file object.read_ok=true: readingexfilleaks external content.write_ok=true: writingexfilmodifies external file.Impact
Vulnerability type:
Who is impacted:
tardefaults.Potential outcomes:
Release Notes
isaacs/node-tar (tar)
v7.5.8Compare Source
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
v6.2.1Compare Source
v6.2.0Compare Source
v6.1.15Compare Source
v6.1.14Compare Source
v6.1.13Compare Source
Dependencies
cc4e0dd#343 bump minipass from 3.3.6 to 4.0.0v6.1.12Compare Source
Bug Fixes
57493ee#332 ensuring close event is emited after stream has ended (@webark)b003c64#314 replace deprecated String.prototype.substr() (#314) (@CommanderRoot, @lukekarrys)Documentation
f129929#313 remove dead link to benchmarks (#313) (@yetzt)c1faa9fadd examples/explanation of using tar.t (@isaacs)v6.1.11Compare Source
v6.1.10Compare Source
v6.1.9Compare Source
v6.1.8Compare Source
v6.1.7Compare Source
v6.1.6Compare Source
v6.1.5Compare Source
v6.1.4Compare Source
v6.1.3Compare Source
v6.1.2Compare Source
v6.1.1Compare Source
v6.1.0Compare Source
v6.0.5Compare Source
v6.0.4Compare Source
v6.0.3Compare Source
v6.0.2Compare Source
v6.0.1Compare Source
v6.0.0Compare Source
v5.0.11Compare Source
v5.0.10Compare Source
v5.0.9Compare Source
v5.0.8Compare Source
v5.0.7Compare Source
v5.0.6Compare Source
v5.0.5Compare Source
v5.0.4Compare Source
v5.0.2Compare Source
v5.0.1Compare Source
v5.0.0Compare Source
v4.4.19Compare Source
v4.4.18Compare Source
v4.4.17Compare Source
v4.4.16Compare Source
v4.4.15Compare Source
v4.4.14Compare Source
v4.4.13Compare Source
v4.4.12Compare Source
v4.4.11Compare Source
v4.4.10Compare Source
v4.4.9Compare Source
v4.4.8Compare Source
v4.4.7Compare Source
v4.4.6Compare Source
v4.4.5Compare Source
v4.4.4Compare Source
v4.4.3Compare Source
v4.4.2Compare Source
v4.4.1Compare Source
v4.4.0Compare Source
v4.3.3Compare Source
v4.3.2Compare Source
v4.3.1Compare Source
v4.3.0Compare Source
v4.2.0Compare Source
v4.1.2Compare Source
v4.1.1Compare Source
v4.1.0Compare Source
v4.0.2Compare Source
v4.0.1Compare Source
v4.0.0Compare Source
v3.2.3Compare Source
v3.2.2Compare Source
v3.2.1Compare Source
v3.2.0Compare Source
v3.1.15Compare Source
v3.1.14Compare Source
v3.1.13Compare Source
v3.1.12Compare Source
v3.1.11Compare Source
v3.1.10Compare Source
v3.1.9Compare Source
v3.1.8Compare Source
v3.1.7Compare Source
v3.1.6Compare Source
v3.1.5Compare Source
v3.1.4Compare Source
v3.1.3Compare Source
v3.1.2Compare Source
v3.1.1Compare Source
v3.1.0Compare Source
v3.0.1Compare Source
v3.0.0Compare Source
v2.2.2Compare Source
v2.2.1Compare Source
v2.2.0Compare Source
v2.1.1Compare Source
v2.1.0Compare Source
v2.0.1Compare Source
v2.0.0Compare Source
v1.0.3Compare Source
v1.0.2Compare Source
v1.0.1Compare Source
v1.0.0Compare Source
v0.1.20Compare Source
v0.1.19Compare Source
v0.1.18Compare Source
v0.1.17Compare Source
v0.1.16Compare Source
v0.1.15Compare Source
v0.1.14Compare Source
v0.1.13Compare 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.