{"id":"CVE-2026-27699","aliases":["CLSA-2026-1780879901","DEBIAN-CVE-2026-27699","EUVD-2026-8643","GHSA-5rq4-664w-9x2c","ROOT-APP-NPM-CVE-2026-27699","UBUNTU-CVE-2026-27699","openSUSE-SU-2026:11452-1"],"status":"published","title":"Basic FTP has Path Traversal Vulnerability in its downloadToDir() method","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","severity":{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00939,"percentile":0.61175,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22"],"published":"2026-02-25T14:58:56Z","modified":"2026-10-28T02:30:35Z","fixes":[{"ecosystem":"npm","package":"basic-ftp","fixed_in":["5.2.0"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:13","package":"node-proxy-agents","fixed_in":["0~2024040606-6+deb13u1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"node-proxy-agents","fixed_in":["0~2025070717+~cs15.2.7-1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"basic-ftp","fixed_in":["5.1.0-aikido.2","5.0.3-aikido.8","5.0.5-aikido.6","5.0.3-aikido.5","5.0.5-aikido.2","5.0.3-aikido.6","5.0.3-aikido.7","5.1.0-aikido.1","5.0.5-aikido.3","5.0.5-aikido.4","5.0.5-aikido.5","5.0.5-aikido.7","5.2.0-aikido.5","5.2.0-aikido.4"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/basic-ftp","fixed_in":["5.0.3-root.io.1","5.0.5-root.io.1","5.0.3-root.io.2","5.0.3-root.io.3","5.0.3-root.io.4","5.1.0-root.io.2","5.0.3-root.io.8","5.0.5-root.io.6","5.0.3-root.io.5","5.0.5-root.io.2","5.0.3-root.io.6","5.0.3-root.io.7","5.1.0-root.io.1","5.0.5-root.io.5","5.0.5-root.io.3","5.0.5-root.io.4","5.0.5-root.io.7","5.2.0-root.io.1","5.2.0-root.io.2","5.2.0-root.io.5","5.2.0-root.io.3","5.2.0-root.io.4"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"basic-ftp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.2.0"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"basic-ftp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.5-tuxcare.0"},{"fixed":"5.0.5-tuxcare.1"}]}],"versions":["5.0.5"],"bundled":2},{"source":"osv","ecosystem":"Debian:13","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0~2024040606-6+deb13u1"}]}],"versions":["0~2024040606-6"]},{"source":"osv","ecosystem":"Debian:14","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0~2025070717+~cs15.2.7-1"}]}],"versions":["0~2024040606-6","0~2025070717-1","0~2025070717-2","0~2025070717-3","0~2025070717-4","0~2025070717-5","0~2025070717-6"]},{"source":"osv","ecosystem":"npm","package":"basic-ftp","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.2.0"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"basic-ftp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.1.0-aikido.2"},{"fixed":"5.0.3-aikido.8"},{"fixed":"5.0.5-aikido.6"},{"fixed":"5.0.3-aikido.5"},{"fixed":"5.0.5-aikido.2"},{"fixed":"5.0.3-aikido.6"},{"fixed":"5.0.3-aikido.7"},{"fixed":"5.1.0-aikido.1"},{"fixed":"5.0.5-aikido.3"},{"fixed":"5.0.5-aikido.4"},{"fixed":"5.0.5-aikido.5"},{"fixed":"5.0.5-aikido.7"},{"fixed":"5.2.0-aikido.5"},{"fixed":"5.2.0-aikido.4"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/basic-ftp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.3-root.io.1"},{"fixed":"5.0.5-root.io.1"},{"fixed":"5.0.3-root.io.2"},{"fixed":"5.0.3-root.io.3"},{"fixed":"5.0.3-root.io.4"},{"fixed":"5.1.0-root.io.2"},{"fixed":"5.0.3-root.io.8"},{"fixed":"5.0.5-root.io.6"},{"fixed":"5.0.3-root.io.5"},{"fixed":"5.0.5-root.io.2"},{"fixed":"5.0.3-root.io.6"},{"fixed":"5.0.3-root.io.7"},{"fixed":"5.1.0-root.io.1"},{"fixed":"5.0.5-root.io.5"},{"fixed":"5.0.5-root.io.3"},{"fixed":"5.0.5-root.io.4"},{"fixed":"5.0.5-root.io.7"},{"fixed":"5.2.0-root.io.1"},{"fixed":"5.2.0-root.io.2"},{"fixed":"5.2.0-root.io.5"},{"fixed":"5.2.0-root.io.3"},{"fixed":"5.2.0-root.io.4"}]}]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0~2023071921-5"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0~2024040606-5","0~2024040606-6","0~2025070717-1","0~2025070717-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0~2025070717+~cs15.2.7-1build1","0~2025070717+~cs15.3.8-1","0~2025070717+~cs15.3.8-2","0~2025070717+~cs15.3.8-3"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"node-proxy-agents","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0~2025070717-2","0~2025070717-6","0~2025070717+~cs15.2.7-1build1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"agama-integration-tests","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1785848065.5562c7c-4.1"}]}],"bundled":4}],"products":[{"vendor":"patrickjuchli","product":"basic-ftp"}],"references":[{"url":"https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-5rq4-664w-9x2c","tags":["x_refsource_CONFIRM","Exploit","Mitigation","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/patrickjuchli/basic-ftp/commit/2a2a0e6514357b9eda07c2f8afbd3f04727a7cd9","tags":["x_refsource_MISC","Patch","fix","web","report"]},{"url":"https://github.com/patrickjuchli/basic-ftp/releases/tag/v5.2.0","tags":["x_refsource_MISC","Release Notes","web","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27699","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-5rq4-664w-9x2c"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/27xxx/CVE-2026-27699.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-27699","tags":["advisory"]},{"url":"https://github.com/patrickjuchli/basic-ftp","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-27699","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-27699","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2026-13149","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-27699","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-48779","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-53550","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2026-27699","title":"Basic FTP has Path Traversal Vulnerability in its downloadToDir() method","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T14:58:56.815Z","modified":"2026-02-27T17:04:33.751Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:19:48.826324Z"}],"euvd":[{"id":"EUVD-2026-8643","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T14:58:56Z","modified":"2026-02-27T17:04:33Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T19:48:13.609806Z"}],"ghsa":[{"id":"GHSA-5rq4-664w-9x2c","title":"Basic FTP has Path Traversal Vulnerability in its downloadToDir() method","description":"The `basic-ftp` library contains a path traversal vulnerability in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory.\n\n\n## Source-to-Sink Flow\n\n```\n1. SOURCE: FTP server sends LIST response\n└─\u003e \"-rw-r--r-- 1 user group 1024 Jan 20 12:00 ../../../etc/passwd\"\n\n2. PARSER: parseListUnix.ts:100 extracts filename\n└─\u003e file.name = \"../../../etc/passwd\"\n\n3. VALIDATION: parseListUnix.ts:101 checks\n└─\u003e if (name === \".\" || name === \"..\") ❌ (only filters exact matches)\n└─\u003e \"../../../etc/passwd\" !== \".\" \u0026\u0026 !== \"..\" ✅ PASSES\n\n4. SINK: Client.ts:707 uses filename directly\n└─\u003e const localPath = join(localDirPath, file.name)\n└─\u003e join(\"/safe/download\", \"../../../etc/passwd\")\n└─\u003e Result: \"/safe/download/../../../etc/passwd\" → resolves to \"/etc/passwd\"\n\n5. FILE WRITE: Client.ts:512 opens file\n└─\u003e fsOpen(localPath, \"w\") → writes to /etc/passwd (outside intended directory)\n```\n\n## Vulnerable Code\n\n**File**: `src/Client.ts:707`\n\n```typescript\nprotected async _downloadFromWorkingDir(localDirPath: string): Promise\u003cvoid\u003e {\nawait ensureLocalDirectory(localDirPath)\nfor (const file of await this.list()) {\nconst localPath = join(localDirPath, file.name) // ⚠️ VULNERABLE\n// file.name comes from untrusted FTP server, no sanitization\nawait this.downloadTo(localPath, file.name)\n}\n}\n```\n\n**Root Cause**:\n- Parser validation (`parseListUnix.ts:101`) only filters exact `.` or `..` entries\n- No sanitization of `../` sequences in filenames\n- `path.join()` doesn't prevent traversal, `fs.open()` resolves paths\n\n\n# Impact\n\nA malicious FTP server can:\n- Write files to arbitrary locations on the client filesystem\n- Overwrite critical system files (if user has write access)\n- Potentially achieve remote code execution\n\n## Affected Versions\n\n- **Tested**: v5.1.0\n- **Likely**: All versions (code pattern exists since initial implementation)\n\n## Mitigation\n\n**Workaround**: Do not use `downloadToDir()` with untrusted FTP servers.\n\n**Fix**: Sanitize filenames before use:\n\n```typescript\nimport { basename } from 'path'\n\n// In _downloadFromWorkingDir:\nconst sanitizedName = basename(file.name) // Strip path components\nconst localPath = join(localDirPath, sanitizedName)\n```","status":"published","published":"2026-02-25T22:34:26Z","modified":"2026-02-25T22:34:27Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:39:27.949248Z"}],"nvd":[{"id":"CVE-2026-27699","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T15:20:53.523Z","modified":"2026-06-17T10:27:32.287Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:12:07.027269Z"}],"osv":[{"id":"CVE-2026-27699","title":"Basic FTP has Path Traversal Vulnerability in its downloadToDir() method","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T14:58:56.815Z","modified":"2026-10-28T02:30:35.67017787Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:45:00.180685Z"},{"id":"DEBIAN-CVE-2026-27699","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T15:20:53.523Z","modified":"2026-10-01T03:03:01.668789584Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:45:53.877573Z"},{"id":"GHSA-5rq4-664w-9x2c","title":"Basic FTP has Path Traversal Vulnerability in its downloadToDir() method","description":"The `basic-ftp` library contains a path traversal vulnerability in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory.\n\n\n## Source-to-Sink Flow\n\n```\n1. SOURCE: FTP server sends LIST response\n└─\u003e \"-rw-r--r-- 1 user group 1024 Jan 20 12:00 ../../../etc/passwd\"\n\n2. PARSER: parseListUnix.ts:100 extracts filename\n└─\u003e file.name = \"../../../etc/passwd\"\n\n3. VALIDATION: parseListUnix.ts:101 checks\n└─\u003e if (name === \".\" || name === \"..\") ❌ (only filters exact matches)\n└─\u003e \"../../../etc/passwd\" !== \".\" \u0026\u0026 !== \"..\" ✅ PASSES\n\n4. SINK: Client.ts:707 uses filename directly\n└─\u003e const localPath = join(localDirPath, file.name)\n└─\u003e join(\"/safe/download\", \"../../../etc/passwd\")\n└─\u003e Result: \"/safe/download/../../../etc/passwd\" → resolves to \"/etc/passwd\"\n\n5. FILE WRITE: Client.ts:512 opens file\n└─\u003e fsOpen(localPath, \"w\") → writes to /etc/passwd (outside intended directory)\n```\n\n## Vulnerable Code\n\n**File**: `src/Client.ts:707`\n\n```typescript\nprotected async _downloadFromWorkingDir(localDirPath: string): Promise\u003cvoid\u003e {\nawait ensureLocalDirectory(localDirPath)\nfor (const file of await this.list()) {\nconst localPath = join(localDirPath, file.name) // ⚠️ VULNERABLE\n// file.name comes from untrusted FTP server, no sanitization\nawait this.downloadTo(localPath, file.name)\n}\n}\n```\n\n**Root Cause**:\n- Parser validation (`parseListUnix.ts:101`) only filters exact `.` or `..` entries\n- No sanitization of `../` sequences in filenames\n- `path.join()` doesn't prevent traversal, `fs.open()` resolves paths\n\n\n# Impact\n\nA malicious FTP server can:\n- Write files to arbitrary locations on the client filesystem\n- Overwrite critical system files (if user has write access)\n- Potentially achieve remote code execution\n\n## Affected Versions\n\n- **Tested**: v5.1.0\n- **Likely**: All versions (code pattern exists since initial implementation)\n\n## Mitigation\n\n**Workaround**: Do not use `downloadToDir()` with untrusted FTP servers.\n\n**Fix**: Sanitize filenames before use:\n\n```typescript\nimport { basename } from 'path'\n\n// In _downloadFromWorkingDir:\nconst sanitizedName = basename(file.name) // Strip path components\nconst localPath = join(localDirPath, sanitizedName)\n```","status":"published","published":"2026-02-25T22:34:26Z","modified":"2026-09-10T03:50:34.155700781Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:38.911014Z"},{"id":"ROOT-APP-NPM-CVE-2026-27699","title":"CVE-2026-27699 in basic-ftp - Patched by Root","description":"Root has patched CVE-2026-27699 in the basic-ftp package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-10-19T12:16:11Z","modified":"2026-10-19T13:15:06.111167004Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:53:27.649662Z"},{"id":"UBUNTU-CVE-2026-27699","description":"The `basic-ftp` FTP client library for Node.js contains a path traversal vulnerability (CWE-22) in versions prior to 5.2.0 in the `downloadToDir()` method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (`../`) that cause files to be written outside the intended download directory. Version 5.2.0 patches the issue.","status":"published","published":"2026-02-25T15:20:00Z","modified":"2026-10-17T12:56:18.169112481Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T16:56:08.726452Z"},{"id":"CLSA-2026-1780879901","title":"TuxCare security update for basic-ftp (2 CVEs)","description":"TuxCare rebuilt basic-ftp to address 2 CVEs. Fixed in 5.0.5-tuxcare.1.","status":"published","published":"2026-08-04T14:52:35Z","modified":"2026-10-15T09:47:50.740751114Z","updated_at":"2026-11-02T15:43:45.445699Z"},{"id":"openSUSE-SU-2026:11452-1","title":"agama-integration-tests-1785848065.5562c7c-4.1 on GA media","description":"These are all security issues fixed in the agama-integration-tests-1785848065.5562c7c-4.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-08-05T00:00:00Z","modified":"2026-08-06T11:15:07.907339068Z","updated_at":"2026-11-02T16:58:39.516824Z"}]}}
