Executive brief
The basic-ftp library, a tool used by Node.js applications to transfer files, is vulnerable to a denial-of-service attack. A malicious or compromised FTP server can send an endless stream of data during the initial connection phase, causing the client application to consume excessive memory and CPU power. This can lead to application crashes, system slowdowns, or service outages for any software that automatically connects to external FTP endpoints.
Technical details
A vulnerability exists in basic-ftp versions prior to 5.3.1 due to improper resource consumption management in the FTP control channel parser. When a server sends a multiline response (e.g., a banner starting with '220-') that is never terminated, the client appends all incoming data to an internal buffer (`_partialResponse`) and repeatedly reparses the entire accumulated string. Because there is no maximum size limit enforced on this buffer, a malicious server can force the client to consume unbounded memory and CPU cycles. This attack occurs during the initial connection phase before authentication, meaning no credentials are required. The issue is fixed in version 5.3.1 by implementing limits on control response sizes.
Affected products
- patrickjuchli basic-ftp < 5.3.1
Timeline
- 2026-04-28: advisory: GitHub Security Advisory published by maintainer
- 2026-05-12: disclosed: CVE-2026-44240 published to NVD
- 2026-05-12: patched: Fix released in version 5.3.1