Uncaught Exceptionbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Uncaught Exception via an uncaught exception in FTPContext._passToHandler. Client.login() calls FTPContext.send() from inside the control-socket data event handler, and send() throws when the command contains CR, LF, or NUL. Because the throw originates inside a socket event callback rather than a Promise executor, no try/catch or .catch() in application code can intercept it, and the process terminates with an uncaught exception. The same pattern exists in the REST/RETR path of downloadTo() when the remote path contains control characters. An attacker who controls the FTP password or the remote path of a resumed download can crash the entire Node.js process with a single request, taking down all other clients it serves.
How to fix Uncaught Exception? Upgrade basic-ftp to version 6.2.3 or higher.
| |
Prototype Pollutionbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Prototype Pollution via the parseLine function in src/parseListMLSD.ts, which looks up fact-handler functions in a plain object literal keyed directly by fact names taken from the FTP server's MLSD directory-listing response without validating that the key is an own property. When a directory-listing line contains the fact name __proto__, the bracket lookup factHandlersByName["__proto__"] returns Object.prototype itself - a truthy, non-undefined value - bypassing the if (!factHandler) guard and causing the code to throw TypeError: factHandler is not a function. This TypeError is not an FTPError, so it is not caught by Client.list()'s retry logic and propagates as a rejected promise out of list() and every API built on top of it (downloadToDir, uploadFromDir, clearWorkingDir, removeDir), crashing the Node.js process when the rejection is unhandled.
How to fix Prototype Pollution? Upgrade basic-ftp to version 6.2.4 or higher.
| |
Regular Expression Denial of Service (ReDoS)basic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via unanchored regular expressions in Client.list() (specifically in parseListDOS.ts and parseListUnix.ts). The regex patterns used to parse FTP directory listings lack anchoring and use unbounded quantifiers, causing catastrophic backtracking when a malicious FTP server returns a long line that cannot be matched. A single such line triggers O(n²) CPU work per character, allowing a server to block the Node.js event loop indefinitely.
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade basic-ftp to version 6.2.1 or higher.
| |
Allocation of Resources Without Limits or Throttlingbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the connect function. An attacker can cause excessive memory and CPU consumption, leading to application unavailability or service degradation, by sending an unterminated multiline FTP control response from a malicious or compromised FTP server before authentication. No user interaction or valid credentials are required for exploitation.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade basic-ftp to version 5.3.1 or higher.
| |
Allocation of Resources Without Limits or Throttlingbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the StringWriter method. An attacker can cause excessive memory consumption and potential process termination by sending an extremely large or unbounded directory listing response from a malicious or compromised FTP server.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade basic-ftp to version 5.3.0 or higher.
| |
CRLF Injectionbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to CRLF Injection via the login and _openDir methods. An attacker can execute arbitrary FTP commands by injecting control characters into credentials or directory names sent to the FTP server.
Note: This vulnerability extends the incomplete fix for CVE-2026-39983.
How to fix CRLF Injection? Upgrade basic-ftp to version 5.2.2 or higher.
| |
CRLF Injectionbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to CRLF Injection via unsanitized path parameters in the protectWhitespace function. An attacker can execute arbitrary FTP commands by injecting CRLF sequences into file path inputs, which are then interpreted as separate commands by the FTP server. This can lead to unauthorized file deletion, directory manipulation, file exfiltration, command execution on supporting servers, session hijacking, or service disruption.
How to fix CRLF Injection? Upgrade basic-ftp to version 5.2.1 or higher.
| |
Directory Traversalbasic-ftp is a FTP client for Node.js, supports FTPS over TLS, IPv6, Async/Await, and Typescript.
Affected versions of this package are vulnerable to Directory Traversal in the downloadToDir() method. A malicious FTP server can overwrite or create files outside the intended directory.
How to fix Directory Traversal? Upgrade basic-ftp to version 5.2.0 or higher.
| |