CVE-2026-27699: Basic FTP Path Traversal Vulnerability in downloadToDir() Method

basic-ftp Updated 26 Feb 2026

Summary

25/02/2026
Yes i
Critical
9.1

CVE-2026-27699: Basic FTP has Path Traversal Vulnerability in its downloadToDir() method. Affects basic-ftp versions < 5.2.0. Fixed in 5.2.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The 'basic-ftp' library is a popular Node.js package that facilitates FTP client functionality, allowing users to interact with FTP servers for file transfers. It is widely used for its simplicity and ease of integration in applications that require FTP capabilities. However, it has been identified to contain a critical path traversal vulnerability that can be exploited by malicious FTP servers.

Vulnerability Detail

The basic-ftp library has a path traversal vulnerability in its downloadToDir() method. This vulnerability arises when a malicious FTP server sends directory listings containing filenames with path traversal sequences (e.g., '../'). The library's parser fails to adequately validate these filenames, allowing files to be written outside the intended download directory. As a result, an attacker could potentially overwrite critical system files or gain unauthorized access to sensitive data, leading to severe security implications, including remote code execution.

How To Fix

Latest published version: 6.2.3 as of 23 Oct 2026

npm install basic-ftp@6.2.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.2.0

This is the first release that contains the fix.

npm install basic-ftp@5.2.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the downloadToDir() method with untrusted FTP servers to mitigate the risk of exploitation.

Conclusion

The basic-ftp library contains a critical path traversal vulnerability that can be exploited by malicious FTP servers. It is essential to update to version 5.2.0 or later to mitigate this risk. Additionally, implementing filename sanitization in your code can further enhance security.

See every vulnerability recorded for basic-ftp →

Share this vulnerability

FAQ

The vulnerability is a path traversal issue that allows files to be written outside the intended directory, potentially leading to overwriting critical system files.

You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities. Check your application against this vulnerability using the Vulert playground at Vulert Scanner.

The CVSS score of this vulnerability is 9.1, indicating a critical severity level.

If you cannot update the package, refrain from using the downloadToDir() method with untrusted FTP servers as a temporary measure.

Yes, all versions of basic-ftp prior to 5.2.0 are likely affected by this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for basic-ftp.

How To Fix

Latest published version: 6.2.3 as of 23 Oct 2026

npm install basic-ftp@6.2.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

5.2.0

This is the first release that contains the fix.

npm install basic-ftp@5.2.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback