GHSA-rp42-5vxx-qpwr
### Summary `[email protected]` 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` ```js async _requestListWithCommand(command) { const buffer = new StringWriter_1.StringWriter(); await (0, transfer_1.downloadTo)(buffer, { ftp: this.ftp, tracker: this._progressTracker, command, remotePath: "", type: "list" }); const text = buffer.getText(this.ftp.encoding); this.ftp.log(text); return this.parseList(text); } ``` The vulnerable sink is `StringWriter`, which grows an in-memory `Buffer` with no limit: File: `dist/StringWriter.js:5-20` ```js class StringWriter extends stream_1.Writable { constructor() { super(...arguments); this.buf = Buffer.alloc(0); } _write(chunk, _, callback) { if (chunk instanceof Buffer) { this.buf = Buffer.concat([this.buf, chunk]); callback(null); } else { callback(new Error("StringWriter expects chunks of type 'Buffer'.")); } } getText(encoding) { return this.buf.toString(encoding); } } ``` The critical operation is: ```js this.buf = Buffer.concat([this.buf, chunk]); ``` 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 compromi
Properties
- ghsa_id
- GHSA-rp42-5vxx-qpwr
- severity
- high
- summary
- basic-ftp vulnerable to denial of service via unbounded memory consumption in Client.list()
- cvss_score
- 7.5
- cve_id
- GHSA-rp42-5vxx-qpwr
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- is_ghsa_only
- true
- ghsa_published
- 2026-04-16T21:37:48Z
- source_url
- https://github.com/advisories/GHSA-rp42-5vxx-qpwr
- ghsa_updated
- 2026-04-16T21:37:51Z
Related Entities (5)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (2)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph