Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.
Open advisories
6 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.
Client.list() parses the server's directory listing with the Unix-style parser in parseListUnix.js. Its RELINE regex has two adjacent (\S+(?:\s\S+)) groups (owner name, then group name) followed by a required numeric size group. When a line starts with a valid listing prefix but the tokens after it never satisfy the size and date fields, the engine backtracks over every way of splitting those tokens between the two groups before it can fail, so matching one line costs roughly O(n²) in the line's length. The server whose directory a client lists controls that listing, so it can return one line that pins the Node.js event loop for as long as it likes. parseList() picks the parser from the last non-blank line only, then runs it on every line, so a normal line placed last selects the Unix parser and a crafted line earlier hits the quadratic match. Proof of concept npm i basic-ftp && node repro.js: Prints list() blocked 39.75s; heartbeats fired: 0, versus ~0.06s for a normal…
Recommended action: Upgrade to 6.2.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
basic-ftp is vulnerable to client-side denial of service when parsing FTP control-channel multiline responses. A malicious or compromised FTP server can send an unterminated multiline response during the initial FTP banner phase, before authentication. The client keeps appending attacker-controlled data into FtpContext.partialResponse and repeatedly reparses the accumulated buffer without enforcing a maximum control response size. As a result, an application using basic-ftp can remain stuck in connect() while memory and CPU usage grow under attacker-controlled input. This can lead to process-level denial of service, container OOM kills, worker restarts, queue backlog, or service degradation in applications that automatically connect to FTP endpoints. --- Details Root cause The root cause is that incomplete FTP multiline control responses are buffered without an upper bound. FtpContext stores incomplete control-channel data in partialResponse:…
Recommended action: Upgrade to 5.3.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
basic-ftp@5.2.2 is vulnerable to denial of service through unbounded memory growth while processing directory listings from a remote FTP server. A malicious or compromised server can send an extremely large or never-ending listing response to Client.list(), causing the client process to consume memory until it becomes unstable or crashes. Details The issue is in the package's default directory listing flow. Client.list() reaches dist/Client.js, where the full listing response is downloaded into a StringWriter before parsing: File: dist/Client.js:516-527 The vulnerable sink is StringWriter, which grows an in-memory Buffer with no limit: File: dist/StringWriter.js:5-20 The critical operation is: There is no maximum size check, no truncation, and no streaming parser. Because the remote FTP server controls the listing response, it can force the client to keep allocating memory until the process is terminated. How it happens: 1. An application connects to an attacker-controlled or…
Recommended action: Upgrade to 5.3.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
basic-ftp's CRLF injection protection (added in commit 2ecc8e2 for GHSA-chqc-8p9q-pq6q) is incomplete. Two code paths bypass the protectWhitespace() control character check: (1) the login() method directly concatenates user-supplied credentials into USER/PASS FTP commands without any validation, and (2) the openDir() method sends an MKD command before cd() invokes protectWhitespace(), creating a TOCTOU bypass. Both vectors allow an attacker who controls input to inject arbitrary FTP commands into the control connection. Details Vector 1: Credential Injection (login) The login() method constructs FTP commands by direct string concatenation with no CRLF validation: FtpContext.send() writes directly to the TCP socket: The protectWhitespace() method (line 762) rejects \r, \n, and \0 characters — but it is only called for path-based operations. Credentials never pass through it. The public access() method (line 268) passes options.user and options.password directly to login() with…
Recommended action: Upgrade to 5.2.2 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
basic-ftp version 5.2.0 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. Affected product | Product | Affected versions | Fixed version | | --- | --- | --- | | basic-ftp (npm) | 5.2.0 (confirmed) | no fix available as of 2026-04-04 | Vulnerability details - CWE: CWE-93 - Improper Neutralization of CRLF Sequences ('CRLF Injection') - CVSS 3.1: 8.6 (High) - Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L - Affected component: dist/Client.js, all path-handling methods via protectWhitespace() and send() The vulnerability…
Recommended action: Upgrade to 5.2.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
The basic-ftp library contains a path traversal vulnerability in the downloadToDir() method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (../) that cause files to be written outside the intended download directory. Source-to-Sink Flow Vulnerable Code File: src/Client.ts:707 Root Cause: - Parser validation (parseListUnix.ts:101) only filters exact . or .. entries - No sanitization of ../ sequences in filenames - path.join() doesn't prevent traversal, fs.open() resolves paths Impact A malicious FTP server can: - Write files to arbitrary locations on the client filesystem - Overwrite critical system files (if user has write access) - Potentially achieve remote code execution Affected Versions - Tested: v5.1.0 - Likely: All versions (code pattern exists since initial implementation) Mitigation Workaround: Do not use downloadToDir() with untrusted FTP servers. Fix: Sanitize filenames before use:
Recommended action: Upgrade to 5.2.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.