Patrickjuchli basic-ftp
FTP Command Injection via CRLF in basic-ftp
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.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 5.2.1
Fixed in 5.2.1
Mitigation
Upgrade basic-ftp to 5.2.1 or later.
References
- Vendor advisory github.com/patrickjuchli/basic-ftp/security/ad…
- Patch github.com/patrickjuchli/basic-ftp/commit/2ecc…
- Release notes github.com/patrickjuchli/basic-ftp/releases/ta…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.1 informational
Informational 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| zebbernCVE/CVE-2026-39983 | 10 Apr 2026 +22 h | 0 | Informational · write-up |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.