A command injection vulnerability in the Node.js FTP client library basic-ftp allows attacker-controlled file path input containing CRLF sequences to inject unintended FTP commands over the control connection. Tracked as CVE-2026-39983 and GHSA-CHQC-8P9Q-PQ6Q, the flaw stems from a design issue in the library's path handling: protectWhitespace() only accounts for leading spaces and does not block control characters, while FtpContext.send() appends \r\n and writes the resulting string directly to the FTP control socket.
The bug affects multiple high-level client methods that accept user-supplied paths, including cd(), remove(), list(), downloadTo(), uploadFrom(), rename(), and removeDir(). By embedding CRLF characters in a crafted path, an attacker can split one intended FTP request into multiple protocol commands or frames. The issue affects basic-ftp versions prior to 5.2.1, and the vendor has addressed it in version 5.2.1.

Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
2 events from the most recent confirmed update back to the earliest known activity.
The vulnerability affecting basic-ftp versions prior to 5.2.1 was fixed in version 5.2.1. The fix addressed FTP command injection through high-level path APIs such as cd(), remove(), rename(), uploadFrom(), downloadTo(), list(), and removeDir().
A command injection flaw was identified in the Node.js FTP client library basic-ftp, where attacker-controlled path parameters containing CRLF sequences could inject additional FTP commands. The issue stemmed from protectWhitespace() not validating control characters before FtpContext.send() wrote commands to the FTP control socket.
2 references tracked. Mallory keeps watching after this page renders.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.