# CVE-2026-39983: FTP Command Injection via CRLF in basic-ftp

> Attacker can inject arbitrary FTP commands via CRLF sequences in file paths, potentially executing code or modifying data.

- **Severity:** High 8.6 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Apr 2026
- **Updated:** 15 Jul 2026
- **Also known as:** CLEANSTART-2026-CT42471, CLEANSTART-2026-KA05451, DEBIAN-CVE-2026-39983, GHSA-chqc-8p9q-pq6q, MINI-2hhf-8934-jfg5, MINI-6pjw-354j-8hqx, MINI-7xw3-2vm2-r8wf, MINI-fxgh-jj6j-wx9w, MINI-g664-hjqv-cg69, MINI-g7fm-p282-724x, MINI-h8cv-p5mg-54cv, MINI-j86q-g53g-84rm, MINI-pwfh-995x-mfhp, MINI-vmpv-3v76-jw22, ROOT-APP-NPM-CVE-2026-39983, UBUNTU-CVE-2026-39983

## What is CVE-2026-39983?

CVE-2026-39983 is a high-severity command injection vulnerability in patrickjuchli basic-ftp, published on 9 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

basic-ftp is an FTP client for Node.js. Prior to 5.2.1, basic-ftp allows FTP command injection via CRLF sequences (\r\n) in file path parameters passed to high-level path APIs such as cd(), remove(), rename(), uploadFrom(), downloadTo(), list(), and removeDir(). The library's protectWhitespace() helper only handles leading spaces and returns other paths unchanged, while FtpContext.send() writes the resulting command string directly to the control socket with \r\n appended. This lets attacker-controlled path strings split one intended FTP command into multiple commands. This vulnerability is fixed in 5.2.1.

Weakness: CWE-93 (Improper Neutralization of CRLF Sequences)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `basic-ftp` | npm | From 5.2.0 | 5.2.1 |
| `basic-ftp` | npm | From 5.2.0 | 5.2.1 |

Products: Patrickjuchli Basic-Ftp.

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

Upgrade basic-ftp to 5.2.1 or later.

## Is CVE-2026-39983 being exploited?

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

Public exploit code:

- Advisory for basic-ftp ⌯⌲ 20 mill weekly downloads (github_poc): https://github.com/zebbernCVE/CVE-2026-39983

## Other vulnerabilities in patrickjuchli basic-ftp

- [CVE-2026-27699](https://insights.sbomify.com/CVE-2026-27699/): Basic FTP has Path Traversal Vulnerability in its downloadToDir() method (critical 9.1)
- [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-39983 and fix it if it is affected.

What it is: CVE-2026-39983 is a high-severity command injection vulnerability in patrickjuchli basic-ftp, published on 9 Apr 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-39983 exists.

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

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-39983/ (Markdown: https://insights.sbomify.com/CVE-2026-39983/index.md)
```

## Sources

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

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