# CVE-2026-27699: Basic FTP has Path Traversal Vulnerability in its downloadToDir() method

> A malicious FTP server can write files outside the intended directory via path traversal in the basic-ftp library's downloadToDir method.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Feb 2026
- **Updated:** 27 Feb 2026
- **Also known as:** DEBIAN-CVE-2026-27699, ECHO-1bbc-f7da-7503, GHSA-5rq4-664w-9x2c, MINI-28vx-rvq4-85rf, MINI-4wfh-jq59-hwpr, MINI-5wgj-3wjf-ff6w, MINI-9hxf-69x8-72mm, MINI-9jjf-fhcq-52j3, MINI-c5c4-g8wp-646q, MINI-f3r2-4f5r-5gw2, MINI-g9wp-3845-hf67, MINI-h4fc-qr63-344w, MINI-hwwj-6755-2r2v, MINI-rw2x-h7mm-p282, MINI-x29c-m24j-f5g3, MINI-x44g-j7mh-7wqc, MINI-xh7q-jcc6-pv79, ROOT-APP-NPM-CVE-2026-27699, UBUNTU-CVE-2026-27699

## What is CVE-2026-27699?

CVE-2026-27699 is a critical path traversal vulnerability in patrickjuchli basic-ftp, published on 25 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-27699?

2 open source packages ship an affected version, including basic-ftp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `basic-ftp` | npm | All versions | 5.2.0 |
| `basic-ftp` | npm | All versions | 5.2.0 |

Products: Patrickjuchli Basic-Ftp.

## How do I fix CVE-2026-27699?

Upgrade basic-ftp to 5.2.0 or later.

## Is CVE-2026-27699 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-27699 exists.

## Other vulnerabilities in patrickjuchli basic-ftp

- [CVE-2026-39983](https://insights.sbomify.com/CVE-2026-39983/): FTP Command Injection via CRLF in basic-ftp (high 8.6)
- [CVE-2026-41324](https://insights.sbomify.com/CVE-2026-41324/): basic-ftp vulnerable to denial of service via unbounded memory consumption in Client.list() (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-27699 and fix it if it is affected.

What it is: CVE-2026-27699 is a critical path traversal vulnerability in patrickjuchli basic-ftp, published on 25 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-27699 exists.

Affected packages and fixed versions:
- basic-ftp (npm): affected all versions; fixed in 5.2.0
- basic-ftp (npm): affected all versions; fixed in 5.2.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-27699/ (Markdown: https://insights.sbomify.com/CVE-2026-27699/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-27699
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-27699
- OSV: https://osv.dev/vulnerability/CVE-2026-27699

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-27699/
Summaries are generated and may contain mistakes; the official description above is the record.
