CWE-59
Weakness AllowedImproper Link Resolution Before File Access
Abstraction: Base · Status: Draft
The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
REALIZATION: This weakness is caused during implementation of an architectural security tactic.
Detection methods
Automated Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Bytecode Weakness Analysis - including disassembler + source code weakness analysis
Effectiveness: SOAR Partial
Manual Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies
Effectiveness: SOAR Partial
Dynamic Analysis with Automated Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Web Application Scanner
Web Services Scanner
Database Scanners
Effectiveness: SOAR Partial
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Fuzz Tester
Framework-based Fuzzer
Effectiveness: SOAR Partial
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Focused Manual Spotcheck - Focused manual analysis of source
Manual Source Code Review (not inspections)
Effectiveness: High
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Source code Weakness Analyzer
Context-configured Source Code Weakness Analyzer
Effectiveness: SOAR Partial
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Formal Methods / Correct-By-Construction
Cost effective for partial coverage:
Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Effectiveness: High
Notes
Theoretical
Link following vulnerabilities are Multi-factor Vulnerabilities (MFV). They are the combination of multiple elements: file or directory permissions, filename predictability, race conditions, and in some cases, a design limitation in which there is no mechanism for performing atomic file creation operations.
Some potential factors are race conditions, permissions, and predictability.
Content history
updated Time_of_Introduction
updated Alternate_Terms, Applicable_Platforms, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings, Weakness_Ordinalities
updated Relationships, Taxonomy_Mappings
updated Relationships
updated Description, Name
updated Background_Details, Other_Notes
updated Potential_Mitigations, Relationships
updated Related_Attack_Patterns
updated Common_Consequences
updated Relationships, Taxonomy_Mappings
updated Common_Consequences, Observed_Examples, References, Relationships
updated Potential_Mitigations
updated Common_Consequences, Other_Notes
updated Detection_Factors, Relationships, Taxonomy_Mappings
updated Relationships
updated Affected_Resources, Applicable_Platforms, Causal_Nature, Common_Consequences, Functional_Areas, Likelihood_of_Exploit, Modes_of_Introduction, Relationships, Taxonomy_Mappings
updated Taxonomy_Mappings
updated Relationships
updated Relationships
updated Relationships
updated Relationships
updated Research_Gaps
updated Relationships
updated Alternate_Terms, Background_Details, Observed_Examples, References, Relationship_Notes, Theoretical_Notes
updated Description
updated Relationships
updated Mapping_Notes
updated Detection_Factors, References
updated Applicable_Platforms, Relationships
updated Alternate_Terms, Name, Observed_Examples
2741 vulnerabilities reference this CWE, most recent first.
GHSA-HQ65-WQ6G-7MCC
Vulnerability from github – Published: 2022-05-14 02:09 – Updated: 2022-05-14 02:09The _rl_tropen function in util.c in GNU readline before 6.3 patch 3 allows local users to create or overwrite arbitrary files via a symlink attack on a /var/tmp/rltrace.[PID] file.
{
"affected": [],
"aliases": [
"CVE-2014-2524"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-08-20T14:55:00Z",
"severity": "LOW"
},
"details": "The _rl_tropen function in util.c in GNU readline before 6.3 patch 3 allows local users to create or overwrite arbitrary files via a symlink attack on a /var/tmp/rltrace.[PID] file.",
"id": "GHSA-hq65-wq6g-7mcc",
"modified": "2022-05-14T02:09:24Z",
"published": "2022-05-14T02:09:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-2524"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1077023"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/pipermail/package-announce/2014-July/135686.html"
},
{
"type": "WEB",
"url": "http://advisories.mageia.org/MGASA-2014-0319.html"
},
{
"type": "WEB",
"url": "http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00057.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2014-09/msg00037.html"
},
{
"type": "WEB",
"url": "http://seclists.org/oss-sec/2014/q1/579"
},
{
"type": "WEB",
"url": "http://seclists.org/oss-sec/2014/q1/587"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2014:154"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2015:132"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HQ7W-XV5X-G34J
Vulnerability from github – Published: 2024-07-09 21:14 – Updated: 2025-11-17 13:49Microsoft Security Advisory CVE-2024-38081 | .NET Elevation of Privilege Vulnerability
Executive summary
Microsoft is releasing this security advisory to provide information about a vulnerability in .NET 6.0 . This advisory also provides guidance on what developers can do to update their applications to remove this vulnerability.
A Vulnerability exist in Visual Studio installer on Windows OS where an unprivileged user is allowed to manipulate the Visual Studio installation resulting in elevation of privilege.
Announcement
Announcement for this issue can be found at https://github.com/dotnet/announcements/issues/313
Mitigation factors
Microsoft has not identified any mitigating factors for this vulnerability.
Affected software
- Any .NET 6.0 application running on .NET 6.0.31 or earlier.
Affected Packages
The vulnerability affects any Microsoft .NET Core project if it uses any of affected packages versions listed below
.NET 6
| Package name | Affected version | Patched version |
|---|---|---|
| Microsoft.IO.Redist | >=4.6.0-preview.18571.3, <=6.0.0 | 6.0.1 |
Advisory FAQ
How do I know if I am affected?
If you have a runtime or SDK with a version listed, or an affected package listed in affected software or affected packages, you're exposed to the vulnerability.
How do I fix the issue?
- To fix the issue please install the latest version of .NET 8.0 or .NET 7.0 or .NET 6.0. If you have installed one or more .NET SDKs through Visual Studio, Visual Studio will prompt you to update Visual Studio, which will also update your .NET SDKs.
- If you have .NET 6.0 or greater installed, you can list the versions you have installed by running the
dotnet --infocommand. You will see output like the following;
.NET Core SDK (reflecting any global.json):
Version: 8.0.200
Commit: 8473146e7d
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.300\
Host (useful for support):
Version: 8.0.3
Commit: 8473146e7d
.NET Core SDKs installed:
8.0.200 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspAspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspAspNetCore.App]
Microsoft.AspNetCore.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.WindowsDesktop.App 8.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
- If you're using .NET 6.0, you should download and install Runtime 6.0.32 or SDK 6.0.132 (for Visual Studio 2022 v17.4) from https://dotnet.microsoft.com/download/dotnet-core/7.0.
.NET 6.0 updates are also available from Microsoft Update. To access this either type "Check for updates" in your Windows search, or open Settings, choose Update & Security and then click Check for Updates.
Once you have installed the updated runtime or SDK, restart your apps for the update to take effect.
Additionally, if you've deployed self-contained applications targeting any of the impacted versions, these applications are also vulnerable and must be recompiled and redeployed.
Other Information
Reporting Security Issues
If you have found a potential security issue in .NET 8.0 or .NET 7.0 or .NET 6.0, please email details to secure@microsoft.com. Reports may qualify for the Microsoft .NET Core & .NET 5 Bounty. Details of the Microsoft .NET Bounty Program including terms and conditions are at https://aka.ms/corebounty.
Support
You can ask questions about this issue on GitHub in the .NET GitHub organization. The main repos are located at https://github.com/dotnet/runtime and https://github.com/dotnet/aspnet/. The Announcements repo (https://github.com/dotnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue. You can ask questions in the linked discussion issue.
Disclaimer
The information provided in this advisory is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.
External Links
Revisions
V1.0 (July 09, 2024): Advisory published.
Version 1.0
Last Updated 2024-07-09
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 6.0.0"
},
"package": {
"ecosystem": "NuGet",
"name": "Microsoft.IO.Redist"
},
"ranges": [
{
"events": [
{
"introduced": "4.6.0-preview.18571.3"
},
{
"fixed": "6.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-38081"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2024-07-09T21:14:35Z",
"nvd_published_at": "2024-07-09T17:15:43Z",
"severity": "HIGH"
},
"details": "# Microsoft Security Advisory CVE-2024-38081 | .NET Elevation of Privilege Vulnerability\n\n## \u003ca name=\"executive-summary\"\u003e\u003c/a\u003eExecutive summary\n\nMicrosoft is releasing this security advisory to provide information about a vulnerability in .NET 6.0 . This advisory also provides guidance on what developers can do to update their applications to remove this vulnerability.\n\nA Vulnerability exist in Visual Studio installer on Windows OS where an unprivileged user is allowed to manipulate the Visual Studio installation resulting in elevation of privilege.\n\n## Announcement\n\nAnnouncement for this issue can be found at https://github.com/dotnet/announcements/issues/313\n\n## \u003ca name=\"mitigation-factors\"\u003e\u003c/a\u003eMitigation factors\n\nMicrosoft has not identified any mitigating factors for this vulnerability.\n\n## \u003ca name=\"affected-software\"\u003e\u003c/a\u003eAffected software\n\n* Any .NET 6.0 application running on .NET 6.0.31 or earlier.\n\n## \u003ca name=\"affected-packages\"\u003e\u003c/a\u003eAffected Packages\nThe vulnerability affects any Microsoft .NET Core project if it uses any of affected packages versions listed below\n\n### \u003ca name=\".NET 6\"\u003e\u003c/a\u003e.NET 6\n\nPackage name | Affected version | Patched version\n------------ | ---------------- | -------------------------\n[Microsoft.IO.Redist](https://www.nuget.org/packages/Microsoft.IO.Redist) | \u003e=4.6.0-preview.18571.3, \u003c=6.0.0 | 6.0.1\n\n\n## Advisory FAQ\n\n### \u003ca name=\"how-affected\"\u003e\u003c/a\u003eHow do I know if I am affected?\n\nIf you have a runtime or SDK with a version listed, or an affected package listed in [affected software](#affected-packages) or [affected packages](#affected-software), you\u0027re exposed to the vulnerability.\n\n### \u003ca name=\"how-fix\"\u003e\u003c/a\u003eHow do I fix the issue?\n\n* To fix the issue please install the latest version of .NET 8.0 or .NET 7.0 or .NET 6.0. If you have installed one or more .NET SDKs through Visual Studio, Visual Studio will prompt you to update Visual Studio, which will also update your .NET SDKs.\n* If you have .NET 6.0 or greater installed, you can list the versions you have installed by running the `dotnet --info` command. You will see output like the following;\n\n```\n.NET Core SDK (reflecting any global.json):\n\n\n Version: 8.0.200\n Commit: 8473146e7d\n\nRuntime Environment:\n\n OS Name: Windows\n OS Version: 10.0.18363\n OS Platform: Windows\n RID: win10-x64\n Base Path: C:\\Program Files\\dotnet\\sdk\\6.0.300\\\n\nHost (useful for support):\n\n Version: 8.0.3\n Commit: 8473146e7d\n\n.NET Core SDKs installed:\n\n 8.0.200 [C:\\Program Files\\dotnet\\sdk]\n\n.NET Core runtimes installed:\n\n Microsoft.AspAspNetCore.App 8.0.3 [C:\\Program Files\\dotnet\\shared\\Microsoft.AspAspNetCore.App]\n Microsoft.AspNetCore.App 8.0.3 [C:\\Program Files\\dotnet\\shared\\Microsoft.AspNetCore.App]\n Microsoft.WindowsDesktop.App 8.0.3 [C:\\Program Files\\dotnet\\shared\\Microsoft.WindowsDesktop.App]\n\n\nTo install additional .NET Core runtimes or SDKs:\n https://aka.ms/dotnet-download\n```\n\n* If you\u0027re using .NET 6.0, you should download and install Runtime 6.0.32 or SDK 6.0.132 (for Visual Studio 2022 v17.4) from https://dotnet.microsoft.com/download/dotnet-core/7.0.\n\n.NET 6.0 updates are also available from Microsoft Update. To access this either type \"Check for updates\" in your Windows search, or open Settings, choose Update \u0026 Security and then click Check for Updates.\n\nOnce you have installed the updated runtime or SDK, restart your apps for the update to take effect.\n\nAdditionally, if you\u0027ve deployed [self-contained applications](https://docs.microsoft.com/dotnet/core/deploying/#self-contained-deployments-scd) targeting any of the impacted versions, these applications are also vulnerable and must be recompiled and redeployed.\n\n## Other Information\n\n### Reporting Security Issues\n\nIf you have found a potential security issue in .NET 8.0 or .NET 7.0 or .NET 6.0, please email details to secure@microsoft.com. Reports may qualify for the Microsoft .NET Core \u0026 .NET 5 Bounty. Details of the Microsoft .NET Bounty Program including terms and conditions are at \u003chttps://aka.ms/corebounty\u003e.\n\n### Support\n\nYou can ask questions about this issue on GitHub in the .NET GitHub organization. The main repos are located at https://github.com/dotnet/runtime and https://github.com/dotnet/aspnet/. The Announcements repo (https://github.com/dotnet/Announcements) will contain this bulletin as an issue and will include a link to a discussion issue. You can ask questions in the linked discussion issue.\n\n### Disclaimer\n\nThe information provided in this advisory is provided \"as is\" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.\n\n### External Links\n\n[CVE-2024-38081]( https://www.cve.org/CVERecord?id=CVE-2024-38081)\n\n### Revisions\n\nV1.0 (July 09, 2024): Advisory published.\n\n_Version 1.0_\n\n_Last Updated 2024-07-09_",
"id": "GHSA-hq7w-xv5x-g34j",
"modified": "2025-11-17T13:49:03Z",
"published": "2024-07-09T21:14:35Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/dotnet/runtime/security/advisories/GHSA-hq7w-xv5x-g34j"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-38081"
},
{
"type": "PACKAGE",
"url": "https://github.com/dotnet/runtime"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-38081"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Microsoft Security Advisory CVE-2024-38081 | .NET Elevation of Privilege Vulnerability"
}
GHSA-HQ97-X836-5MC4
Vulnerability from github – Published: 2023-04-27 21:30 – Updated: 2024-04-04 03:42Docker Desktop before 4.6.0 on Windows allows attackers to delete any file through the hyperv/destroy dockerBackendV2 API via a symlink in the DataFolder parameter, a different vulnerability than CVE-2022-26659.
{
"affected": [],
"aliases": [
"CVE-2022-31647"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-04-27T20:15:39Z",
"severity": "HIGH"
},
"details": "Docker Desktop before 4.6.0 on Windows allows attackers to delete any file through the hyperv/destroy dockerBackendV2 API via a symlink in the DataFolder parameter, a different vulnerability than CVE-2022-26659.",
"id": "GHSA-hq97-x836-5mc4",
"modified": "2024-04-04T03:42:57Z",
"published": "2023-04-27T21:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-31647"
},
{
"type": "WEB",
"url": "https://docs.docker.com/desktop/release-notes/#docker-desktop-460"
},
{
"type": "WEB",
"url": "https://www.cyberark.com/resources/threat-research-blog/breaking-docker-named-pipes-systematically-docker-desktop-privilege-escalation-part-2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HQ9P-WCJC-WQXG
Vulnerability from github – Published: 2025-02-11 18:31 – Updated: 2025-10-22 00:33Windows Storage Elevation of Privilege Vulnerability
{
"affected": [],
"aliases": [
"CVE-2025-21391"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-11T18:15:37Z",
"severity": "HIGH"
},
"details": "Windows Storage Elevation of Privilege Vulnerability",
"id": "GHSA-hq9p-wcjc-wqxg",
"modified": "2025-10-22T00:33:12Z",
"published": "2025-02-11T18:31:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-21391"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-21391"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-21391"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HQGX-P3R3-2CFG
Vulnerability from github – Published: 2026-12-02 01:09 – Updated: 2026-12-02 01:09Summary
On a non-Windows host, extracting a crafted tar with default options makes node-tar (<= 7.5.22, current latest) create a SymbolicLink whose target resolves OUTSIDE the extraction directory, breaking the documented guarantee that "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder". This allows arbitrary file read / extraction-containment escape (CWE-22 / CWE-59). Confirmed end-to-end on tar@7.5.22 with default tar.x() (async and sync), including reading /etc/passwd. It is distinct from, and survives, the drive-relative fixes (GHSA-9ppj-qmqm-q256 / CVE-2026-31802, GHSA-qffp-2rhf-9h96).
Details
Root cause is a separator-handling difference between the containment CHECK and the symlink CREATE.
In Unpack[STRIPABSOLUTEPATH] (src/unpack.ts), the symlink linkpath is split for the ".." containment check AFTER stripped.replaceAll(/\/g, '/') — i.e. "\" is treated as a path separator when counting segments.
But on non-Windows, normalizeWindowsPath (src/normalize-windows-path.ts) is the identity function, and the symlink is created with the RAW linkpath: SYMLINK -> LINK calls fs.symlink(entry.linkpath, entry.absolute) (src/unpack.ts, ~lines 640-660 and 866-881), where "\" is an ordinary filename character.
So a segment like "A\B" counts as TWO segments to the check but ONE to the kernel. Backslash padding inflates the check's segment count, so a ".." run that the check believes stays inside cwd actually escapes it at creation/resolution time.
Walkthrough for entry.linkpath = "A\B/../../x": - CHECK ("\" -> "/"): ["A","B","..","..","x"] -> normalizes to "x" -> believed inside cwd -> ALLOWED - CREATE (Linux, "\" literal): ["A\B","..","..","x"] -> from cwd: cwd/A\B -> .. -> cwd -> .. -> parent of cwd -> ESCAPES
The escape depth equals the number of backslashes in the padding segment (overshooting saturates at "/"), so any path on the same filesystem is reachable regardless of cwd depth.
Why the other guards do not catch it: ENSURE_NO_SYMLINK (src/unpack.ts, ~lines 679-698) only rejects EXISTING symlinks found in the target path, not cwd-escape; and CHECKPATH's defense-in-depth validates entry.path (the entry's own path), not the linkpath.
Scope note (per README "Security Information"): this breaks the stated protection "Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder", so it is reportable under "not properly enforcing the intended security protections". It is NOT the out-of-scope case in warning #1 (extracting into an attacker-controlled folder / TOCTOU symlink-swap): this is deterministic, driven solely by the archive's own contents, into a normal folder, with no race and no second actor. It is the same class as the accepted/fixed GHSA-9ppj-qmqm-q256, via a different mechanism (backslash separator differential vs. drive-relative prefix).
Suggested fix: make the containment check use the same separator semantics as creation — when platform !== 'win32', do NOT treat "\" as a separator (skip the replaceAll(/\/g,'/')) so segment counting matches the kernel. Better still, decide containment from the single resolved absolute target that creation actually uses — require path.resolve(path.dirname(entry.absolute), entry.linkpath) to be within cwd — instead of a separate path.posix lexical model that can diverge from it.
Proof of concept
Non-Windows host (Linux/macOS), default options. Benign: reads a marker file placed in the PARENT of the extraction dir.
Steps: npm i tar@7.5.22 tar-stream node poc.js
poc.js:
const tar = require('tar'), { pack } = require('tar-stream');
const fs = require('fs'), path = require('path'), os = require('os');
const base = fs.mkdtempSync(path.join(os.tmpdir(), 'poc-'));
const cwd = path.join(base, 'extract'); fs.mkdirSync(cwd);
fs.writeFileSync(path.join(base, 'SENTINEL.txt'), 'OUT-OF-TREE'); // in the PARENT of cwd
const p = pack();
p.entry({ name: 'A\\B', type: 'directory', mode: 0o755 }); // one on-disk segment "A\B"
p.entry({ name: 'escape', type: 'symlink', linkname: 'A\\B/../../SENTINEL.txt', mode: 0o777 });
p.finalize();
const chunks = []; p.on('data', c => chunks.push(c)); p.on('end', async () => {
const tf = path.join(base, 'e.tar'); fs.writeFileSync(tf, Buffer.concat(chunks));
await tar.x({ file: tf, cwd }); // DEFAULT options
console.log('realpath:', fs.realpathSync(path.join(cwd, 'escape')));
console.log('read :', fs.readFileSync(path.join(cwd, 'escape'), 'utf8'));
});
Expected output: cwd/escape resolves to /SENTINEL.txt (the PARENT of the extraction directory) and reads "OUT-OF-TREE".
To show arbitrary read of a real file: use a padding segment of ~50 backslashes plus the matching number of ".." and then "/etc/passwd" as the linkname (and a directory entry named the same padding segment). The resulting symlink resolves to /etc/passwd (verified: first line "root:x:0:0:root:/root:/bin/bash").
Impact
Arbitrary file read / extraction-containment escape (CWE-22 / CWE-59). A malicious tarball (for example an npm package, or any user-uploaded or third-party archive) extracted with default options plants a symlink that resolves to an arbitrary host path on the same filesystem. Any consumer that then reads, copies, or serves files from the "contained" extraction directory is induced to read arbitrary host files. node-tar is a dependency of npm itself and of a large fraction of the ecosystem, so the exposure is broad.
Arbitrary WRITE is NOT achieved: mkdir rejects symlinked parent components (SymlinkError, src/mkdir.ts), a file written at the symlink's own path unlinks the symlink first, and hardlink entries reject any "..". So node-tar does not itself write outside the extraction target; the impact is the escaping symlink / arbitrary read.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "tar"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "8.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-140246"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-02T01:09:07Z",
"nvd_published_at": "2026-12-01T18:17:28Z",
"severity": "HIGH"
},
"details": "### Summary\n\nOn a non-Windows host, extracting a crafted tar with default options makes node-tar (\u003c= 7.5.22, current latest) create a SymbolicLink whose target resolves OUTSIDE the extraction directory, breaking the documented guarantee that \"Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder\". This allows arbitrary file read / extraction-containment escape (CWE-22 / CWE-59). \nConfirmed end-to-end on tar@7.5.22 with default tar.x() (async and sync), including reading /etc/passwd. It is distinct from, and survives, the drive-relative fixes (GHSA-9ppj-qmqm-q256 / CVE-2026-31802, GHSA-qffp-2rhf-9h96).\n\n### Details\n\nRoot cause is a separator-handling difference between the containment CHECK and the symlink CREATE.\n\nIn Unpack[STRIPABSOLUTEPATH] (src/unpack.ts), the symlink linkpath is split for the \"..\" containment check AFTER stripped.replaceAll(/\\\\/g, \u0027/\u0027) \u2014 i.e. \"\\\" is treated as a path separator when counting segments.\n\nBut on non-Windows, normalizeWindowsPath (src/normalize-windows-path.ts) is the identity function, and the symlink is created with the RAW linkpath: SYMLINK -\u003e LINK calls fs.symlink(entry.linkpath, entry.absolute) (src/unpack.ts, ~lines 640-660 and 866-881), where \"\\\" is an ordinary filename character.\n\nSo a segment like \"A\\B\" counts as TWO segments to the check but ONE to the kernel. Backslash padding inflates the check\u0027s segment count, so a \"..\" run that the check believes stays inside cwd actually escapes it at creation/resolution time.\n\nWalkthrough for entry.linkpath = \"A\\B/../../x\":\n- CHECK (\"\\\" -\u003e \"/\"): [\"A\",\"B\",\"..\",\"..\",\"x\"] -\u003e normalizes to \"x\" -\u003e believed inside cwd -\u003e ALLOWED\n- CREATE (Linux, \"\\\" literal): [\"A\\B\",\"..\",\"..\",\"x\"] -\u003e from cwd: cwd/A\\B -\u003e .. -\u003e cwd -\u003e .. -\u003e parent of cwd -\u003e ESCAPES\n\nThe escape depth equals the number of backslashes in the padding segment (overshooting saturates at \"/\"), so any path on the same filesystem is reachable regardless of cwd depth.\n\nWhy the other guards do not catch it: ENSURE_NO_SYMLINK (src/unpack.ts, ~lines 679-698) only rejects EXISTING symlinks found in the target path, not cwd-escape; and CHECKPATH\u0027s defense-in-depth validates entry.path (the entry\u0027s own path), not the linkpath.\n\nScope note (per README \"Security Information\"): this breaks the stated protection \"Link and SymbolicLink entries are not allowed to target locations outside of the extraction folder\", so it is reportable under \"not properly enforcing the intended security protections\". It is NOT the out-of-scope case in warning #1 (extracting into an attacker-controlled folder / TOCTOU symlink-swap): this is deterministic, driven solely by the archive\u0027s own contents, into a normal folder, with no race and no second actor. It is the same class as the accepted/fixed GHSA-9ppj-qmqm-q256, via a different mechanism (backslash separator differential vs. drive-relative prefix).\n\nSuggested fix: make the containment check use the same separator semantics as creation \u2014 when platform !== \u0027win32\u0027, do NOT treat \"\\\" as a separator (skip the replaceAll(/\\\\/g,\u0027/\u0027)) so segment counting matches the kernel. Better still, decide containment from the single resolved absolute target that creation actually uses \u2014 require path.resolve(path.dirname(entry.absolute), entry.linkpath) to be within cwd \u2014 instead of a separate path.posix lexical model that can diverge from it.\n\n### Proof of concept\n\nNon-Windows host (Linux/macOS), default options. Benign: reads a marker file placed in the PARENT of the extraction dir.\n\nSteps:\n npm i tar@7.5.22 tar-stream\n node poc.js\n\npoc.js:\n```js\nconst tar = require(\u0027tar\u0027), { pack } = require(\u0027tar-stream\u0027);\nconst fs = require(\u0027fs\u0027), path = require(\u0027path\u0027), os = require(\u0027os\u0027);\nconst base = fs.mkdtempSync(path.join(os.tmpdir(), \u0027poc-\u0027));\nconst cwd = path.join(base, \u0027extract\u0027); fs.mkdirSync(cwd);\nfs.writeFileSync(path.join(base, \u0027SENTINEL.txt\u0027), \u0027OUT-OF-TREE\u0027); // in the PARENT of cwd\nconst p = pack();\np.entry({ name: \u0027A\\\\B\u0027, type: \u0027directory\u0027, mode: 0o755 }); // one on-disk segment \"A\\B\"\np.entry({ name: \u0027escape\u0027, type: \u0027symlink\u0027, linkname: \u0027A\\\\B/../../SENTINEL.txt\u0027, mode: 0o777 });\np.finalize();\nconst chunks = []; p.on(\u0027data\u0027, c =\u003e chunks.push(c)); p.on(\u0027end\u0027, async () =\u003e {\n const tf = path.join(base, \u0027e.tar\u0027); fs.writeFileSync(tf, Buffer.concat(chunks));\n await tar.x({ file: tf, cwd }); // DEFAULT options\n console.log(\u0027realpath:\u0027, fs.realpathSync(path.join(cwd, \u0027escape\u0027)));\n console.log(\u0027read :\u0027, fs.readFileSync(path.join(cwd, \u0027escape\u0027), \u0027utf8\u0027));\n});\n```\n\nExpected output: cwd/escape resolves to \u003cbase\u003e/SENTINEL.txt (the PARENT of the extraction directory) and reads \"OUT-OF-TREE\".\n\nTo show arbitrary read of a real file: use a padding segment of ~50 backslashes plus the matching number of \"..\" and then \"/etc/passwd\" as the linkname (and a directory entry named the same padding segment). The resulting symlink resolves to /etc/passwd (verified: first line \"root:x:0:0:root:/root:/bin/bash\").\n\n### Impact\n\nArbitrary file read / extraction-containment escape (CWE-22 / CWE-59). A malicious tarball (for example an npm package, or any user-uploaded or third-party archive) extracted with default options plants a symlink that resolves to an arbitrary host path on the same filesystem. Any consumer that then reads, copies, or serves files from the \"contained\" extraction directory is induced to read arbitrary host files. node-tar is a dependency of npm itself and of a large fraction of the ecosystem, so the exposure is broad.\n\nArbitrary WRITE is NOT achieved: mkdir rejects symlinked parent components (SymlinkError, src/mkdir.ts), a file written at the symlink\u0027s own path unlinks the symlink first, and hardlink entries reject any \"..\". So node-tar does not itself write outside the extraction target; the impact is the escaping symlink / arbitrary read.",
"id": "GHSA-hqgx-p3r3-2cfg",
"modified": "2026-12-02T01:09:07Z",
"published": "2026-12-02T01:09:07Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/security/advisories/GHSA-hqgx-p3r3-2cfg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-140246"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/commit/23b368128b6cf7d4c26f2e302c0e4a82f70a6e3d"
},
{
"type": "PACKAGE",
"url": "https://github.com/isaacs/node-tar"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/releases/tag/v8.0.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "node-tar: SymbolicLink extraction escapes the extraction directory on non-Windows hosts via a backslash separator differential"
}
GHSA-HQRJ-VWQM-F24H
Vulnerability from github – Published: 2022-05-14 03:19 – Updated: 2022-05-14 03:19kwallet-pam in KDE KWallet before 5.12.6 allows local users to obtain ownership of arbitrary files via a symlink attack.
{
"affected": [],
"aliases": [
"CVE-2018-10380"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-05-08T12:29:00Z",
"severity": "HIGH"
},
"details": "kwallet-pam in KDE KWallet before 5.12.6 allows local users to obtain ownership of arbitrary files via a symlink attack.",
"id": "GHSA-hqrj-vwqm-f24h",
"modified": "2022-05-14T03:19:29Z",
"published": "2022-05-14T03:19:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-10380"
},
{
"type": "WEB",
"url": "https://bugzilla.suse.com/show_bug.cgi?id=1090863"
},
{
"type": "WEB",
"url": "https://commits.kde.org/kwallet-pam/01d4143fda5bddb6dca37b23304dc239a5fb38b5"
},
{
"type": "WEB",
"url": "https://commits.kde.org/kwallet-pam/2134dec85ce19d6378d03cddfae9e5e464cb24c0"
},
{
"type": "WEB",
"url": "https://commits.kde.org/kwallet-pam/802f305d81f8771c4f4a8bd7fd0e368ffc6f9b3b"
},
{
"type": "WEB",
"url": "https://commits.kde.org/kwallet-pam/99abc7fde21f40cc6da5feb6ee766cc46fcca1f8"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2018/dsa-4200"
},
{
"type": "WEB",
"url": "https://www.kde.org/info/security/advisory-20180503-1.txt"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HQV5-49RW-222P
Vulnerability from github – Published: 2022-05-14 02:37 – Updated: 2025-04-20 03:43mktexlsr revision 22855 through revision 36625 as packaged in texlive allows local users to write to arbitrary files via a symlink attack.
{
"affected": [],
"aliases": [
"CVE-2015-5700"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-08-25T18:29:00Z",
"severity": "MODERATE"
},
"details": "mktexlsr revision 22855 through revision 36625 as packaged in texlive allows local users to write to arbitrary files via a symlink attack.",
"id": "GHSA-hqv5-49rw-222p",
"modified": "2025-04-20T03:43:51Z",
"published": "2022-05-14T02:37:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-5700"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775139"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=1181167"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3788-1"
},
{
"type": "WEB",
"url": "https://www.tug.org/svn/texlive/trunk/Build/source/texk/kpathsea/mktexlsr?r1=19613\u0026r2=22885"
},
{
"type": "WEB",
"url": "https://www.tug.org/svn/texlive/trunk/Build/source/texk/kpathsea/mktexlsr?view=log"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2015/07/30/6"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-HRG3-Q4WX-PV3M
Vulnerability from github – Published: 2026-11-06 18:35 – Updated: 2026-11-06 18:35In JetBrains Datalore before 2026.4 workspace collaborators could obtain the owner's SSH private key via Git backup
{
"affected": [],
"aliases": [
"CVE-2026-123836"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-06T17:17:21Z",
"severity": "HIGH"
},
"details": "In JetBrains Datalore before 2026.4 workspace collaborators could obtain the owner\u0027s SSH private key via Git backup",
"id": "GHSA-hrg3-q4wx-pv3m",
"modified": "2026-11-06T18:35:16Z",
"published": "2026-11-06T18:35:16Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-123836"
},
{
"type": "WEB",
"url": "https://www.jetbrains.com/privacy-security/issues-fixed"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HRH2-VP3X-79XF
Vulnerability from github – Published: 2026-09-29 23:49 – Updated: 2026-09-29 23:49Impact
When extracting an untrusted archive with the default decompress(input, output) API, a crafted archive containing a chain of symlink entries can make a later entry resolve outside the output directory. The lexical containment checks pass, but the kernel follows the planted symlinks to a path outside output, letting an attacker write (and read) files outside the intended extraction directory. Overwriting startup scripts or configuration can lead to remote code execution.
This is a bypass of the hardening in GHSA-mp2f-45pm-3cg9. Any application that extracts attacker-controlled archives is affected.
Patches
Fixed in 11.1.4 (latest) and backported to 10.2.2 (release-v10 dist-tag). Upgrade to one of these.
The unmaintained upstream decompress package shares this flaw and will not be patched. Migrate to @xhmikosr/decompress@11.1.4 (or @10.2.2).
Workarounds
None. Do not extract untrusted archives on affected versions. If you cannot upgrade, validate entries out of band and reject any whose resolved path escapes the target directory.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 11.1.3"
},
"package": {
"ecosystem": "npm",
"name": "@xhmikosr/decompress"
},
"ranges": [
{
"events": [
{
"introduced": "11.0.0"
},
{
"fixed": "11.1.4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 10.2.1"
},
"package": {
"ecosystem": "npm",
"name": "@xhmikosr/decompress"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "10.2.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "decompress"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "4.2.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-101894"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-29T23:49:42Z",
"nvd_published_at": "2026-09-28T17:17:48Z",
"severity": "CRITICAL"
},
"details": "### Impact\n\nWhen extracting an untrusted archive with the default `decompress(input, output)` API, a crafted archive containing a chain of symlink entries can make a later entry resolve **outside** the output directory. The lexical containment checks pass, but the kernel follows the planted symlinks to a path outside `output`, letting an attacker write (and read) files outside the intended extraction directory. Overwriting startup scripts or configuration can lead to remote code execution.\n\nThis is a bypass of the hardening in GHSA-mp2f-45pm-3cg9. Any application that extracts attacker-controlled archives is affected.\n\n### Patches\n\nFixed in **11.1.4** (`latest`) and backported to **10.2.2** (`release-v10` dist-tag). Upgrade to one of these.\n\nThe unmaintained upstream `decompress` package shares this flaw and will not be patched. Migrate to `@xhmikosr/decompress@11.1.4` (or `@10.2.2`).\n\n### Workarounds\n\nNone. Do not extract untrusted archives on affected versions. If you cannot upgrade, validate entries out of band and reject any whose resolved path escapes the target directory.",
"id": "GHSA-hrh2-vp3x-79xf",
"modified": "2026-09-29T23:49:42Z",
"published": "2026-09-29T23:49:42Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/XhmikosR/decompress/security/advisories/GHSA-hrh2-vp3x-79xf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-101894"
},
{
"type": "WEB",
"url": "https://github.com/XhmikosR/decompress/commit/5f4b2f64abb31bbaf1fef8975b595fd7df2558d8"
},
{
"type": "WEB",
"url": "https://github.com/XhmikosR/decompress/commit/f6c88c668216d6a12c6cecf4fe0b6c70bf77050a"
},
{
"type": "PACKAGE",
"url": "https://github.com/XhmikosR/decompress"
},
{
"type": "WEB",
"url": "https://github.com/XhmikosR/decompress/releases/tag/v10.2.2"
},
{
"type": "WEB",
"url": "https://github.com/XhmikosR/decompress/releases/tag/v11.1.4"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "@xhmikosr/decompress: Path traversal via symlink chain"
}
GHSA-HRWV-7VP5-R8PF
Vulnerability from github – Published: 2022-05-24 17:23 – Updated: 2022-05-24 17:23A vulnerability in the web-based management interface of Cisco SD-WAN vManage Software could allow an authenticated, remote attacker to read arbitrary files on the underlying filesystem of the device. The vulnerability is due to insufficient file scope limiting. An attacker could exploit this vulnerability by creating a specific file reference on the filesystem and then accessing it through the web-based management interface. A successful exploit could allow the attacker to read arbitrary files from the filesystem of the underlying operating system.
{
"affected": [],
"aliases": [
"CVE-2020-3437"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-07-16T18:15:00Z",
"severity": "MODERATE"
},
"details": "A vulnerability in the web-based management interface of Cisco SD-WAN vManage Software could allow an authenticated, remote attacker to read arbitrary files on the underlying filesystem of the device. The vulnerability is due to insufficient file scope limiting. An attacker could exploit this vulnerability by creating a specific file reference on the filesystem and then accessing it through the web-based management interface. A successful exploit could allow the attacker to read arbitrary files from the filesystem of the underlying operating system.",
"id": "GHSA-hrwv-7vp5-r8pf",
"modified": "2022-05-24T17:23:48Z",
"published": "2022-05-24T17:23:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-3437"
},
{
"type": "WEB",
"url": "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-vmanwebid-5QWMcCvt"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/162958/Cisco-SD-WAN-vManage-19.2.2-Remote-Root.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation MIT-48.1
Strategy: Separation of Privilege
- Follow the principle of least privilege when assigning access rights to entities in a software system.
- Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.
CAPEC-132: Symlink Attack
An adversary positions a symbolic link in such a manner that the targeted user or application accesses the link's endpoint, assuming that it is accessing a file with the link's name.
CAPEC-17: Using Malicious Files
An attack of this type exploits a system's configuration that allows an adversary to either directly access an executable file, for example through shell access; or in a possible worst case allows an adversary to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.