Every CVE Search/ Get API key

CVE-2026-27699

Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

9.1 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
High

Exploit likelihood

0.94%Up 0.9 points since Feb 26, 2026
90%50%10%1%

What each source reports

CVE List Score used 9.1

Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

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.

Record
CVE-2026-27699
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
EUVDEUVD-2026-8643 9.1

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.

Record
EUVD-2026-8643
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-5rq4-664w-9x2c 9.1

Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

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.

Source-to-Sink Flow

1. SOURCE: FTP server sends LIST response
└─> "-rw-r--r-- 1 user group 1024 Jan 20 12:00 ../../../etc/passwd"

2. PARSER: parseListUnix.ts:100 extracts filename
└─> file.name = "../../../etc/passwd"

3. VALIDATION: parseListUnix.ts:101 checks
└─> if (name === "." || name === "..") ❌ (only filters exact matches)
└─> "../../../etc/passwd" !== "." && !== ".." ✅ PASSES

4. SINK: Client.ts:707 uses filename directly
└─> const localPath = join(localDirPath, file.name)
└─> join("/safe/download", "../../../etc/passwd")
└─> Result: "/safe/download/../../../etc/passwd" → resolves to "/etc/passwd"

5. FILE WRITE: Client.ts:512 opens file
└─> fsOpen(localPath, "w") → writes to /etc/passwd (outside intended directory)

Vulnerable Code

File: src/Client.ts:707

protected async _downloadFromWorkingDir(localDirPath: string): Promise<void> {
await ensureLocalDirectory(localDirPath)
for (const file of await this.list()) {
const localPath = join(localDirPath, file.name) // ⚠️ VULNERABLE
// file.name comes from untrusted FTP server, no sanitization
await this.downloadTo(localPath, file.name)
}
}

Root Cause: - Parser validation (parseListUnix.ts:101) only filters exact . or .. entries - No sanitization of ../ sequences in filenames

  • path.join() doesn't prevent traversal, fs.open() resolves paths

Impact

A malicious FTP server can: - Write files to arbitrary locations on the client filesystem - Overwrite critical system files (if user has write access) - Potentially achieve remote code execution

Affected Versions

  • Tested: v5.1.0
  • Likely: All versions (code pattern exists since initial implementation)

Mitigation

Workaround: Do not use downloadToDir() with untrusted FTP servers.

Fix: Sanitize filenames before use:

import { basename } from 'path'

// In _downloadFromWorkingDir:
const sanitizedName = basename(file.name) // Strip path components
const localPath = join(localDirPath, sanitizedName)
Record
GHSA-5rq4-664w-9x2c
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
NVD 9.1

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.

Record
CVE-2026-27699
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
OSV 9.1

Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

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.

Record
CVE-2026-27699
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
OSVDEBIAN-CVE-2026-27699 9.8

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.

Record
DEBIAN-CVE-2026-27699
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 5 moreShow less
OSVGHSA-5rq4-664w-9x2c 9.1

Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

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.

Source-to-Sink Flow

1. SOURCE: FTP server sends LIST response
└─> "-rw-r--r-- 1 user group 1024 Jan 20 12:00 ../../../etc/passwd"

2. PARSER: parseListUnix.ts:100 extracts filename
└─> file.name = "../../../etc/passwd"

3. VALIDATION: parseListUnix.ts:101 checks
└─> if (name === "." || name === "..") ❌ (only filters exact matches)
└─> "../../../etc/passwd" !== "." && !== ".." ✅ PASSES

4. SINK: Client.ts:707 uses filename directly
└─> const localPath = join(localDirPath, file.name)
└─> join("/safe/download", "../../../etc/passwd")
└─> Result: "/safe/download/../../../etc/passwd" → resolves to "/etc/passwd"

5. FILE WRITE: Client.ts:512 opens file
└─> fsOpen(localPath, "w") → writes to /etc/passwd (outside intended directory)

Vulnerable Code

File: src/Client.ts:707

protected async _downloadFromWorkingDir(localDirPath: string): Promise<void> {
await ensureLocalDirectory(localDirPath)
for (const file of await this.list()) {
const localPath = join(localDirPath, file.name) // ⚠️ VULNERABLE
// file.name comes from untrusted FTP server, no sanitization
await this.downloadTo(localPath, file.name)
}
}

Root Cause: - Parser validation (parseListUnix.ts:101) only filters exact . or .. entries - No sanitization of ../ sequences in filenames

  • path.join() doesn't prevent traversal, fs.open() resolves paths

Impact

A malicious FTP server can: - Write files to arbitrary locations on the client filesystem - Overwrite critical system files (if user has write access) - Potentially achieve remote code execution

Affected Versions

  • Tested: v5.1.0
  • Likely: All versions (code pattern exists since initial implementation)

Mitigation

Workaround: Do not use downloadToDir() with untrusted FTP servers.

Fix: Sanitize filenames before use:

import { basename } from 'path'

// In _downloadFromWorkingDir:
const sanitizedName = basename(file.name) // Strip path components
const localPath = join(localDirPath, sanitizedName)
Record
GHSA-5rq4-664w-9x2c
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Weakness
CWE-22
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2026-27699 9.1

CVE-2026-27699 in basic-ftp - Patched by Root

Root has patched CVE-2026-27699 in the basic-ftp package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2026-27699
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2026-27699 9.1

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.

Record
UBUNTU-CVE-2026-27699
CVSS 3.1
9.1 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVCLSA-2026-1780879901 No score

TuxCare security update for basic-ftp (2 CVEs)

TuxCare rebuilt basic-ftp to address 2 CVEs. Fixed in 5.0.5-tuxcare.1.

Record
CLSA-2026-1780879901
Updated
2026-11-02
OSVopenSUSE-SU-2026:11452-1 No score

agama-integration-tests-1785848065.5562c7c-4.1 on GA media

These are all security issues fixed in the agama-integration-tests-1785848065.5562c7c-4.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11452-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
basic-ftp
npm
before 5.2.0
5.2.0
basic-ftp
TuxCare:npm
From an advisory covering 2 CVEs
5.0.5-tuxcare.0 up to 5.0.5-tuxcare.1, plus listed versions
5.0.5
5.0.5-tuxcare.1
node-proxy-agents
Debian:13
before 0~2024040606-6+deb13u1, plus listed versions
0~2024040606-6
0~2024040606-6+deb13u1
node-proxy-agents
Debian:14
before 0~2025070717+~cs15.2.7-1, plus listed versions
0~2024040606-60~2025070717-10~2025070717-20~2025070717-30~2025070717-40~2025070717-50~2025070717-6
0~2025070717+~cs15.2.7-1
basic-ftp
Root:npm
before 5.1.0-aikido.2
5.1.0-aikido.25.0.3-aikido.85.0.5-aikido.65.0.3-aikido.55.0.5-aikido.25.0.3-aikido.65.0.3-aikido.75.1.0-aikido.15.0.5-aikido.35.0.5-aikido.45.0.5-aikido.55.0.5-aikido.75.2.0-aikido.55.2.0-aikido.4
@rootio/basic-ftp
Root:npm
before 5.0.3-root.io.1
5.0.3-root.io.15.0.5-root.io.15.0.3-root.io.25.0.3-root.io.35.0.3-root.io.45.1.0-root.io.25.0.3-root.io.85.0.5-root.io.65.0.3-root.io.55.0.5-root.io.25.0.3-root.io.65.0.3-root.io.75.1.0-root.io.15.0.5-root.io.55.0.5-root.io.35.0.5-root.io.45.0.5-root.io.75.2.0-root.io.15.2.0-root.io.25.2.0-root.io.55.2.0-root.io.35.2.0-root.io.4
node-proxy-agents
Ubuntu:24.04:LTS
All versions, plus listed versions
0~2023071921-5
None known
node-proxy-agents
Ubuntu:25.10
All versions, plus listed versions
0~2024040606-50~2024040606-60~2025070717-10~2025070717-2
None known
node-proxy-agents
Ubuntu:26.10
All versions, plus listed versions
0~2025070717+~cs15.2.7-1build10~2025070717+~cs15.3.8-10~2025070717+~cs15.3.8-20~2025070717+~cs15.3.8-3
None known
node-proxy-agents
Ubuntu:26.04:LTS
All versions, plus listed versions
0~2025070717-20~2025070717-60~2025070717+~cs15.2.7-1build1
None known
agama-integration-tests
openSUSE:Tumbleweed
From an advisory covering 4 CVEs
before 1785848065.5562c7c-4.1
1785848065.5562c7c-4.1

History

History
RecordedChangedSources
affected, facts
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-27699 is a critical vulnerability (CVSS 9.1) in Patrickjuchli Basic-ftp, published February 25, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.94%, the 61st percentile. Fixed in basic-ftp 5.2.0.

References

Show 8 moreShow less
MoveEnter Open