fix: bump tar to 7.5.11 (CVE-2026-31802 / GHSA-9ppj-qmqm-q256)#12
Draft
fix: bump tar to 7.5.11 (CVE-2026-31802 / GHSA-9ppj-qmqm-q256)#12
Conversation
Copilot
AI
changed the title
[WIP] Fix node-tar symlink path traversal vulnerability
fix: bump tar to 7.5.11 (CVE-2026-31802 / GHSA-9ppj-qmqm-q256)
Apr 9, 2026
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.
tar@7.5.10allows symlink path traversal via drive-relativelinkpathvalues (e.g.C:../../../target.txt), enabling arbitrary file overwrite outside the extraction root duringtar.x().Changes
package.json: bumps theresolutionspin@yarnpkg/core/tarfrom7.5.10→7.5.11yarn.lock: regenerated; both the pinned entry and the^7.4.3range now resolve to7.5.11Reachability
taris not called directly in this codebase — it is a transitive dep of@yarnpkg/core. Exposure is indirect (through core's package extraction internals). High confidence the vulnerable code path is not triggered by this plugin itself, but the version pin is updated to eliminate the risk at the dependency level.Original prompt
This section details the Dependabot vulnerability alert you should resolve
<alert_title>node-tar Symlink Path Traversal via Drive-Relative Linkpath</alert_title>
<alert_description>### Summary
tar(npm) can be tricked into creating a symlink that points outside the extraction directory by using a drive-relative symlink target such asC:../../../target.txt, which enables file overwrite outsidecwdduring normaltar.x()extraction.Details
The extraction logic in
Unpack[STRIPABSOLUTEPATH]validates..segments against a resolved path that still uses the original drive-relative value, and only afterwards rewrites the storedlinkpathto the stripped value.What happens with
linkpath: "C:../../../target.txt":stripAbsolutePath()removesC:and rewrites the value to../../../target.txt.../../../target.txt) from nested patha/b/l.../target.txt).This is reachable in standard usage (
tar.x({ cwd, file })) when extracting attacker-controlled tar archives.PoC
Tested on Arch Linux with
tar@7.5.10.PoC script (
poc.cjs):Run:
Observed output:
PWNEDconfirms outside file content overwrite.readlinkandls -lconfirm the extracted symlink points outside the extraction directory.Impact
This is an arbitrary file overwrite primitive outside the intended extraction root, with the permissions of the process performing extraction.
Realistic scenarios:
high
https://github.com/isaacs/node-tar/security/advisories/GHSA-9ppj-qmqm-q256 https://nvd.nist.gov/vuln/detail/CVE-2026-31802 https://github.com/isaacs/node-tar/commit/f48b5fa3b7985ddab96dc0f2125a4ffc9911b6ad https://github.com/advisories/GHSA-9ppj-qmqm-q256GHSA-9ppj-qmqm-q256, CVE-2026-31802
tar
npm
<vulnerable_versions>7.5.10</vulnerable_versions>
<patched_version>7.5.11</patched_version>
<manifest_path>yarn.lock</manifest_path>
<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that mitigate the vulnerability without a version update. If a workaround is available, apply it and leave a code comment referencing the advisory identifier explaining it is a temporary mitigation. If neither a patch nor a workaround is available, explain in the PR descrip...
This change is