Skip to main content

basic-ftp CVE-2026-44240

HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-05-06 https://github.com/patrickjuchli/basic-ftp GHSA-rpmf-866q-6p89
7.5
CVSS 3.1 · Vendor: https://github.com/patrickjuchli/basic-ftp
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Victim application initiates FTP connection
  2. Delivery
    Malicious server accepts connection
  3. Exploit
    Server sends unterminated multiline banner (220-)
  4. Install
    Client buffers response in _partialResponse
  5. C2
    Server streams additional unterminated lines
  6. Execute
    Client repeatedly reparses growing buffer
  7. Impact
    Memory and CPU consumption escalate
  8. Step 8
    Process OOM kill or service degradation

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the victim application using basic-ftp version 5.3.0 or earlier to initiate an FTP connection to an attacker-controlled or compromised FTP server. The vulnerability triggers during the initial FTP banner exchange before authentication, so no valid FTP credentials are required. The victim application must have network connectivity to reach the malicious FTP server on the configured port (typically TCP 21). No user interaction is required beyond the application's normal automated FTP connection logic, such as scheduled jobs, customer-configured integration endpoints, partner data feeds, backup automation, or CI/CD artifact synchronization. Applications that restrict FTP connectivity to a static allowlist of trusted servers are not exploitable unless one of those trusted servers is compromised. The attack surface is largest in SaaS platforms accepting customer-provided FTP endpoints, multi-tenant data integration services, and systems processing FTP URLs from external configuration sources.

Impact

Real-world risk is HIGH for applications with automated FTP connectivity to external or customer-controlled servers. CVSS vector AV:N/AC:L/PR:N/UI:N indicates trivial remote exploitation without authentication or user interaction against any vulnerable client application. Attack complexity is LOW because exploitation requires only serving malformed FTP banner responses during initial connection, before authentication occurs. The CVSS 7.5 score reflects pure availability impact (A:H) with no confidentiality or integrity compromise. Publicly available exploit code exists per GitHub advisory GHSA-rpmf-866q-6p89 with working proof-of-concept demonstrating memory growth from 3.69 MiB to 80.77 MiB heap usage and process stalls. Real-world exposure is significant for SaaS platforms accepting customer FTP endpoints, scheduled ETL pipelines, backup automation, document ingestion systems, and CI/CD artifact mirroring. However, exploitation requires victim application to initiate connection to attacker-controlled infrastructure, limiting passive attack scenarios. Defense priority should focus on systems processing untrusted FTP endpoints or those where FTP server compromise could propagate DoS to client infrastructure. Not listed in CISA KEV, suggesting no widespread active exploitation campaigns detected at time of analysis, but the combination of public POC, trivial exploitation, and common deployment patterns warrants immediate patching for exposed systems.

Exploit ScenarioDerived

An attacker operates or compromises an FTP server that a victim application connects to for scheduled data imports. When the victim's Node.js application calls basic-ftp's connect() method, the malicious server immediately sends 'REDACTED220-malicious banner\r\n' followed by continuous unterminated multiline response data without ever sending the terminating 'REDACTED220 ' line. The basic-ftp client accumulates this data in _partialResponse while repeatedly reparsing the growing buffer on each network chunk received. Within minutes, the victim process consumes hundreds of megabytes of memory (demonstrated POC showed growth from 54.77 MiB to 141.64 MiB RSS) while remaining stuck in the pending connect() state. This triggers container OOM kills in Kubernetes environments, causes worker restart loops in job processing systems, creates queue backlogs in scheduled ETL pipelines, or degrades service availability for customer-facing FTP integration features. The attack succeeds before any FTP authentication occurs, requiring no valid credentials.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 06, 2026

Remote unauthenticated attackers can trigger memory exhaustion and process-level denial of service in Node.js applications using basic-ftp by sending unterminated FTP multiline control responses during initial connection. The vulnerability occurs in the client library when connecting to malicious or compromised FTP servers, causing unbounded buffer growth in _partialResponse with repeated CPU-intensive reparsing. This affects automated FTP integrations for scheduled imports, customer-provided endpoints, backup jobs, and CI/CD pipelines. Publicly available exploit code exists per GitHub security advisory GHSA-rpmf-866q-6p89. CVSS 7.5 HIGH with network attack vector, low complexity, and no authentication required confirms practical remote exploitation risk.

RemediationAI

Upgrade basic-ftp to version 5.3.1 or later, which introduces maximum control response buffer size limits to prevent unbounded memory growth. Update package.json dependency and run npm install or equivalent package manager command. Verify the fix with npm list basic-ftp to confirm version 5.3.1+ is installed. For applications that cannot immediately upgrade, implement application-level FTP connection timeouts (shorter than default) to limit exposure duration and add resource monitoring with automatic restart policies to detect and recover from memory exhaustion conditions. Consider implementing FTP server allowlisting to restrict connections only to trusted infrastructure, though this reduces flexibility in customer-facing or partner integration scenarios. Deploy connection-level resource limits in containerized environments (memory limits, CPU quotas) to prevent single DoS from cascading to other services, accepting that this creates a trade-off with legitimate high-volume FTP transfer capacity. Network-level controls are ineffective because the attack uses valid FTP protocol syntax over legitimate connections. Compensating controls provide only partial mitigation-upgrade to patched version is the definitive solution per vendor advisory at https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-rpmf-866q-6p89.

Affected Packages

npm basic-ftp fix: 5.3.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in basic-ftp's FTP control-channel protocol parser implementation. The FtpContext class stores incomplete multiline FTP responses in _partialResponse without size limits. When processing control-channel data in _onControlSocketData(), the code concatenates previous partial data with new chunks (completeResponse = this._partialResponse + chunk), invokes parseControlResponse() on the accumulated buffer, and stores the unparsed remainder back into _partialResponse. The parseControlResponse() function treats unterminated multiline responses (starting with '220-' but never receiving the terminating '220 ' line) as incomplete and returns the entire accumulated data as 'rest'. This creates a cycle where each new data event triggers reparsing of a monotonically growing attacker-controlled buffer. The root cause maps to CWE-400 (Uncontrolled Resource Consumption) due to the absence of maximum control response buffer size enforcement. The FTP protocol uses multiline responses for banners and status messages, with lines beginning with numeric codes followed by '-' for continuation and ' ' for termination, making incomplete responses a natural protocol-level attack vector.

Know when Node.js gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/patrickjuchli/basic-ftp) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
SUSE HIGH
Red Hat 7.5 HIGH

Primary rating from Vendor (https://github.com/patrickjuchli/basic-ftp).

CVSS VectorVendor: https://github.com/patrickjuchli/basic-ftp

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Summary

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:

https://github.com/patrickjuchli/basic-ftp/blob/50827c73ca6c1d786c97276e47be8a33d0f2277d/src/FtpContext.ts#L63-L64

Incoming control-channel data is handled in _onControlSocketData. The implementation concatenates the previous incomplete response with the new chunk, parses the entire accumulated string, and stores parsed.rest back into _partialResponse:

https://github.com/patrickjuchli/basic-ftp/blob/50827c73ca6c1d786c97276e47be8a33d0f2277d/src/FtpContext.ts#L328-L340

The relevant flow is:

completeResponse = this._partialResponse + chunk parsed = parseControlResponse(completeResponse) this._partialResponse = parsed.rest

There is no maximum size check before concatenating, before parsing, or before storing parsed.rest.

The parser accepts incomplete multiline responses and returns the entire unterminated multiline group as rest:

https://github.com/patrickjuchli/basic-ftp/blob/50827c73ca6c1d786c97276e47be8a33d0f2277d/src/parseControlResponse.ts#L15-L43

If a server starts a multiline FTP response:

220-malicious banner starts

but never sends the terminating line:

220 ready

then parseControlResponse() treats the accumulated multiline data as incomplete and returns it as rest.

Because _onControlSocketData() feeds _partialResponse + chunk back into the parser on every new data event, the client repeatedly reparses a growing attacker-controlled buffer. This creates both memory growth and increasing parsing work.

Why this is security-relevant

The vulnerable component is a client library. The attacker does not need to authenticate to the victim system and does not need valid FTP credentials.

The attack occurs automatically when an application using basic-ftp connects to a malicious or compromised FTP server. The malicious response is sent as the FTP server banner before login. No additional user interaction is required after the application initiates a normal FTP connection.

This is realistic for applications that use FTP for:

  • scheduled imports or exports
  • customer-provided FTP endpoints
  • backup or synchronization jobs
  • CI/CD artifact mirroring
  • document ingestion pipelines
  • legacy business integrations

In those environments, one malicious or compromised FTP endpoint can cause the Node.js process using basic-ftp to consume excessive memory and CPU or remain stuck in a pending connection state.

---

Proof of Concept

The PoC uses a local malicious FTP server that accepts a victim connection and sends an unterminated multiline FTP banner. The banner starts with 220-, but the server never sends the required terminating 220 line.

Reproduction steps

From the root of the basic-ftp project:

bash
npm ci
npm run buildOnly

poc_control_parser_direct.js

bash
CHUNKS=1000 node poc_control_parser_direct.js | tee poc-results/parser_direct_1000.log

parser_direct_1000.log

Run the end-to-end malicious FTP server PoC:

poc_control_multiline_dos.js

bash
CHUNK_SIZE=8192 CHUNKS=1000 DELAY_MS=1 node poc_control_multiline_dos.js | tee poc-results/control_multiline_dos_1000.log

control_multiline_dos_1000.log

Observed result: parser-only PoC

text
[basic-ftp parseControlResponse incomplete multiline DoS]
Input fed: 7.81 MiB
Retained rest: 7.81 MiB
Initial rss/heap: 54.77 MiB 3.69 MiB
Final   rss/heap: 141.64 MiB 80.77 MiB

This shows that parseControlResponse() retained the full unterminated multiline response as rest.

The retained buffer grew to 7.81 MiB. Heap usage increased from 3.69 MiB to 80.77 MiB, and RSS increased from 54.77 MiB to 141.64 MiB.

Observed result: end-to-end malicious FTP server PoC

text
[server] listening on 127.0.0.1:34429
[server] victim connected
[progress] chunks=850 sent=6.6 MiB partialResponse=6.6 MiB heapUsed=227.5 MiB rss=292.4 MiB
[progress] chunks=900 sent=7.0 MiB partialResponse=7.0 MiB heapUsed=213.1 MiB rss=278.0 MiB
[final-before-close] chunks=1000 sent=7.8 MiB partialResponse=7.8 MiB heapUsed=82.1 MiB rss=146.8 MiB
[result] client connect() is still pending because the multiline response never terminated

Only 7.8 MiB of malicious control-channel data was sent. The client retained 7.8 MiB in _partialResponse, showed large memory spikes, and remained pending inside connect() because the multiline response was never terminated.

---

Expected behavior

The client should enforce a maximum size for incomplete FTP control responses. If the accumulated multiline response exceeds a safe limit, the client should close the connection and reject the active task with an error.

The client should not allow a remote FTP server to make _partialResponse grow without bound.

---

Actual behavior

A malicious FTP server can keep the client in a pending connection state by sending an unterminated multiline control response. basic-ftp continues buffering and reparsing the accumulated data without a maximum response size.

---

Impact

A malicious or compromised FTP server can cause denial of service in applications using basic-ftp.

Possible real-world impact includes:

  • Node.js process memory exhaustion
  • container OOM kill
  • worker crash or restart loop
  • event loop CPU pressure due to repeated reparsing
  • stuck FTP jobs
  • queue backlog in scheduled import/export systems
  • degraded availability of services relying on automated FTP ingestion

---

Threat model

The attacker controls, compromises, or can impersonate an FTP server that a victim application connects to.

Examples:

  1. A SaaS application allows customers to configure external FTP endpoints for automated imports.
  2. A backend job periodically pulls files from partner FTP servers.
  3. A document ingestion pipeline connects to FTP endpoints supplied by external users.
  4. A legacy integration uses FTP for scheduled synchronization.
  5. A build or deployment pipeline mirrors artifacts from an FTP server.

In each case, the victim application initiates a normal FTP connection. The malicious server sends an unterminated multiline banner before authentication. The vulnerable client then buffers and reparses the response indefinitely.

No FTP credentials are required for exploitation because the attack happens before login.

---

Suggested fix

Introduce a maximum control response buffer size, especially for incomplete multiline responses.

Recommended changes:

  • Add a maxControlResponseBytes or maxControlResponseLength limit.
  • Enforce the limit before or immediately after appending new control-channel data.
  • Close the connection and reject the active task when the limit is exceeded.
  • Add regression tests for unterminated multiline responses.

Example defensive logic:

text
if (completeResponse.length > maxControlResponseLength) {
    closeWithError(new Error("FTP control response exceeded maximum allowed size"))
}

A regression test should verify that a response beginning with 220- and never terminating with 220 is rejected after the configured size limit instead of being retained indefinitely.

---

Suggested regression test scenario

A test server should:

  1. Accept a client connection.
  2. Send an FTP multiline response opener such as 220-malicious banner\r\n.
  3. Continue sending additional lines without ever sending the terminating 220 line.
  4. Verify that the client rejects the connection once the configured response-size limit is exceeded.
  5. Verify that _partialResponse does not grow without bound.

Executive ViewAI

Why It Matters

CVE-2026-44240 affects Node.js applications using the basic-ftp library, allowing remote attackers to crash FTP client processes through denial of service by sending malformed FTP responses. Organizations relying on automated FTP integrations for backups, CI/CD pipelines, or data imports face service disruption and operational downtime if they connect to untrusted or compromised FTP servers.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) restrict FTP client connections to authenticated, internally-controlled FTP servers only; (2) implement connection timeouts and memory limits at the process level to constrain impact of resource exhaustion; (3) disable or remove basic-ftp dependencies from non-critical workflows; (4) place FTP client processes in isolated containers or VMs with resource caps to prevent cascading failures; (5) monitor process memory and CPU for anomalous behavior during FTP operations.

Threat Intelligence Overview

EPSS Score
0.1%
Top 77% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:npm/basic-ftp
CVE-2025-68613 HIGH POC
8.8 Dec 19

Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation

CVE-2024-41713 CRITICAL POC
9.1 Oct 21

A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could

CVE-2024-55591 CRITICAL POC
9.8 Jan 14

FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote

CVE-2023-44487 HIGH POC
7.5 Oct 10

Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour

CVE-2014-7205 CRITICAL POC
10.0 Oct 08

Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t

CVE-2025-59528 CRITICAL POC
10.0 Sep 22

Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete

CVE-2017-14849 HIGH POC
7.5 Sep 28

Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc

CVE-2017-5941 CRITICAL POC
9.8 Feb 09

An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2014-3744 HIGH POC
7.5 Oct 23

Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi

CVE-2014-9566 HIGH POC
7.5 Mar 10

Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin

CVE-2024-35286 CRITICAL POC
9.8 Oct 21

A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond

Vendor StatusVendor

SUSE

Severity: Important

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy