{"id":"GHSA-r4jh-29pc-gfqr","revision":null,"records":[{"revision":"9d9cfa568be7419ca5ee4126c2d6c7fb","observedAt":"2026-11-13T17:56:54.463+00:00","statement":{"source":"cve-program","id":"CVE-2026-126346","aliases":[],"title":"basic-ftp: Uncaught exception crashes the Node.js process when a password (or resumed-download path) contains CR/LF","description":"basic-ftp is an FTP client for Node.js. Prior to 6.2.3, FTPContext.send() throws when a command contains carriage return, line feed, or NUL characters, but calls made from response handlers execute synchronously inside the control socket's data event without an exception boundary. In Client.login(), an attacker-influenced password reaches the PASS command after a server sends a 331 response, and in a resumed download an attacker-influenced remote path reaches the RETR command after a 350 response to REST. The resulting exception does not reject client.access() or downloadTo(), escapes ordinary promise error handling, and terminates the Node.js process, while the validation guard still prevents command injection. This issue is fixed in version 6.2.3.","state":0,"publishedAt":"2026-11-12T21:42:09.509+00:00","modifiedAt":"2026-11-13T16:03:49.107+00:00","affected":[{"ecosystem":"Vendor product","name":"basic-ftp","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"patrickjuchli\",\n                    \"product\": \"basic-ftp\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 6.2.3\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"severity":"MEDIUM"}],"references":["https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr","https://github.com/patrickjuchli/basic-ftp/commit/0495b906bdf891e68806721b07b333dba65ec88e","https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-126346","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-126346","identifiers":["CVE-2026-126346"]},"retained":false,"historicalAffected":[]},{"revision":"a9b21ba938a34b6398adb95a50a32e81","observedAt":"2026-11-16T23:32:16.036+00:00","statement":{"source":"euvd","id":"EUVD-2026-124724","aliases":["CVE-2026-126346","GHSA-r4jh-29pc-gfqr"],"title":"basic-ftp is an FTP client for Node.js. Prior to 6.2.3, FTPContext.send() throws when a command contains carriage return, line feed, or NUL characters, but calls made from response handlers execute synchronously inside the control socket's …","description":"basic-ftp is an FTP client for Node.js. Prior to 6.2.3, FTPContext.send() throws when a command contains carriage return, line feed, or NUL characters, but calls made from response handlers execute synchronously inside the control socket's data event without an exception boundary. In Client.login(), an attacker-influenced password reaches the PASS command after a server sends a 331 response, and in a resumed download an attacker-influenced remote path reaches the RETR command after a 350 response to REST. The resulting exception does not reject client.access() or downloadTo(), escapes ordinary promise error handling, and terminates the Node.js process, while the validation guard still prevents command injection. This issue is fixed in version 6.2.3.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"severity":null}],"references":["https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr","https://github.com/patrickjuchli/basic-ftp/commit/0495b906bdf891e68806721b07b333dba65ec88e","https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-124724","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Nov 12, 2026, 9:42:09 PM","dateUpdated":"Nov 13, 2026, 4:03:49 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-124724","identifiers":["EUVD-2026-124724","CVE-2026-126346","GHSA-r4jh-29pc-gfqr"]},"retained":false,"historicalAffected":[]},{"revision":"ded148e7232340d8945419d3fd7d985c","observedAt":"2026-11-14T23:23:18.008+00:00","statement":{"source":"nvd","id":"CVE-2026-126346","aliases":[],"title":"basic-ftp is an FTP client for Node.js. Prior to 6.2.3, FTPContext.send() throws when a command contains carriage return, line feed, or NUL characters, but calls made from response handlers execute synchronously inside the control socket's …","description":"basic-ftp is an FTP client for Node.js. Prior to 6.2.3, FTPContext.send() throws when a command contains carriage return, line feed, or NUL characters, but calls made from response handlers execute synchronously inside the control socket's data event without an exception boundary. In Client.login(), an attacker-influenced password reaches the PASS command after a server sends a 331 response, and in a resumed download an attacker-influenced remote path reaches the RETR command after a 350 response to REST. The resulting exception does not reject client.access() or downloadTo(), escapes ordinary promise error handling, and terminates the Node.js process, while the validation guard still prevents command injection. This issue is fixed in version 6.2.3.","state":0,"publishedAt":"2026-11-12T22:19:19.607+00:00","modifiedAt":"2026-11-13T17:17:25.167+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"severity":"MEDIUM"}],"references":["https://github.com/patrickjuchli/basic-ftp/commit/0495b906bdf891e68806721b07b333dba65ec88e","https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3","https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-126346","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-248","CWE-755"],"productCriteria":[],"sourceDates":{"published":"2026-11-12T22:19:19.607","lastModified":"2026-11-13T17:17:25.167"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-126346","identifiers":["CVE-2026-126346"]},"retained":false,"historicalAffected":[]},{"revision":"9e27e09cd4714e5591f060babb51cf9b","observedAt":"2026-11-12T23:16:39.718+00:00","statement":{"source":"osv","id":"GHSA-r4jh-29pc-gfqr","aliases":["CVE-2026-126346"],"title":"basic-ftp: Uncaught exception crashes the Node.js process when a password (or resumed-download path) contains CR/LF","description":"### Summary\n\nClient.login() calls FTPContext.send() from inside the control-socket data event handler. send() throws on CR, LF or NUL, and nothing catches the throw. A password containing \\r\\n therefore raises an uncaught exception and terminates the whole Node.js process. It does not reject the returned promise. Any application that passes untrusted input as the FTP password can be crashed remotely with one request. The same pattern exists in the REST/RETR path of downloadTo() when the remote path contains control characters.\n\n### Details\n\nThe CRLF guard (FTPContext.send, src/FtpContext.ts ~L233) correctly refuses to send commands containing \\r, \\n or \\0:\n```ts\nsend(command: string) {\n    if (/[\\r\\n\\0]/.test(command)) {\n        throw new Error(`Invalid command: Contains control characters. (${command})`);\n    }\n```\n\nThat works when send() is called from handle(), because it runs inside a Promise executor and the throw becomes a rejection. But in two places send() runs inside a response handler, which is called synchronously from the socket’s data event:\n\nClient.login() (src/Client.ts ~L246-248): after the server answers 331 to USER, the handler calls this.ftp.send(\"PASS \" + password). The USER command was already sent and is valid, so the password is only checked at this point. The call chain is socket.on(\"data\") → _onControlSocketData → _passToHandler → responseHandler → send() → throw. No try/catch exists anywhere in that chain, so it becomes an uncaughtException.\ndownloadTo() (src/transfer.ts ~L368-370): when startAt > 0, the initial command is REST n, which contains no user-controlled text. When the server answers 350, the handler calls config.ftp.send(\"RETR \" + config.remotePath). This remotePath was never checked before. A path with a control character throws in the data handler in the same way. (Found by code reading, not reproduced.)\n\nBecause the exception happens during data event dispatch, it can’t be handled with try/catch or .catch() around client.access() or downloadTo(). The application only survives if it has a global process.on(\"uncaughtException\") handler.\n\n### Proof of concept\n\nTested on Node.js v22.22.0 against basic-ftp 6.2.2 (built from source). It uses a minimal mock FTP server on localhost:\n\n```js\nconst net = require(\"net\")\nconst ftp = require(\"basic-ftp\")\n\nconst srv = net.createServer(s => {\n  s.write(\"220 hi\\r\\n\")\n  s.on(\"data\", d => {\n    const c = d.toString()\n    if (c.startsWith(\"USER\")) s.write(\"331 pw\\r\\n\")\n    else if (c.startsWith(\"PASS\")) s.write(\"230 ok\\r\\n\")\n    else s.write(\"200 ok\\r\\n\")\n  })\n})\n\nsrv.listen(0, async () => {\n  const c = new ftp.Client(2000)\n  try {\n    await c.access({\n      host: \"127.0.0.1\",\n      port: srv.address().port,\n      user: \"bob\",\n      password: \"x\\r\\nDELE important\"   // attacker-controlled value\n    })\n  } catch (e) {\n    console.log(\"rejected:\", e.message)  // never reached\n  }\n  console.log(\"handled gracefully\")      // never reached\n  process.exit(0)\n})\n```\nResult: the process terminates with an uncaught exception and neither catch nor the final console.log runs:\n```\nError: Invalid command: Contains control characters. (PASS x\nDELE important)\n    at FTPContext.send (dist/FtpContext.js:189:19)\n    at Object.responseHandler (dist/Client.js:186:26)\n    at FTPContext._passToHandler (dist/FtpContext.js:322:24)\n    at FTPContext._onControlSocketData (dist/FtpContext.js:312:18)\n    at Socket.<anonymous> (dist/FtpContext.js:133:44)\n```\nThe server in the PoC is benign. Any normal FTP server that replies 331 to USER triggers the same crash.\n\n### Impact\n\nDenial of service (uncaught exception, process termination), CWE-248.\n\nIt affects applications that pass untrusted or user-influenced values as the FTP password, or as the remote path of a resumed download. Examples are web apps or services that let users enter their own FTP credentials, or file-transfer or backup tools driven by user-supplied paths. One request crashes the whole Node.js process and every other client it serves. It needs no authentication to the FTP server and no special server behaviour. The attacker only needs control over the string. Confidentiality and integrity are not affected, and the CRLF guard still blocks command injection.\n\nSuggested fix:\n\nIn FTPContext._passToHandler(), wrap the handler call in a try/catch that rejects the task and calls closeWithError(err).\nValidate password in login(), and remotePath in _downloadToStream(), before any I/O and reject early.","state":0,"publishedAt":"2026-11-12T22:23:50+00:00","modifiedAt":"2026-11-12T22:30:03.9835229+00:00","affected":[{"ecosystem":"npm","name":"basic-ftp","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.2.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/patrickjuchli/basic-ftp/security/advisories/GHSA-r4jh-29pc-gfqr","https://github.com/patrickjuchli/basic-ftp/commit/0495b906bdf891e68806721b07b333dba65ec88e","https://github.com/patrickjuchli/basic-ftp","https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.2.3"],"sourceUrl":"https://github.com/advisories/GHSA-r4jh-29pc-gfqr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-r4jh-29pc-gfqr","identifiers":["GHSA-r4jh-29pc-gfqr","CVE-2026-126346"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-17T03:27:59.3001864+00:00","complete":true,"records":1781,"lastAttemptAt":"2026-11-17T03:27:59.3001864+00:00","lastSuccessAt":"2026-11-17T03:27:59.5527828+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:27:59.5527836+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-30c3da459c38698a15d626d89e52e03e55e19fc45dae0e6d8d723cbf35472cf4-9d520eefc593439f3ce1302b383f18846689c325ea134364ce2f033d105bca3e","complete":true,"records":426230,"lastAttemptAt":"2026-11-17T03:26:03.3592161+00:00","lastSuccessAt":"2026-11-17T03:26:03.3460581+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:26:03.3592161+00:00","snapshotPublishedAt":"2026-11-17T03:25:53+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-2330b80315294257af6bbb5ba00b0bf0","complete":false,"records":13836,"lastAttemptAt":"2026-11-17T03:34:53.4860986+00:00","lastSuccessAt":"2026-11-17T03:34:53.479+00:00","error":"129 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-17T03:34:53.479+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13650,"expectedIdentifiers":13890,"failedIdentifiers":129},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-17T03:27:59.3001864+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-17T03:27:59.3001864+00:00","lastSuccessAt":"2026-11-17T03:27:59.5536032+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:27:59.5536035+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-8fe42df9ddaa47a5bde948a2904896ae","complete":true,"records":13849,"lastAttemptAt":"2026-11-17T03:28:01.1364166+00:00","lastSuccessAt":"2026-11-17T03:28:01.122+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:28:01.122+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13890,"expectedIdentifiers":13890,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-db3ae05f3e19425298b475ceb81e33f22d67df93dfef77c2b0200c8b05fd85ae","complete":true,"records":9958,"lastAttemptAt":"2026-11-17T03:27:59.168792+00:00","lastSuccessAt":"2026-11-16T23:31:31.5526753+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:27:59.168792+00:00","snapshotPublishedAt":"2026-11-16T22:48:36+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-17T03:26:03.4187172+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:26:03.4187172+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-6086d649bcb454cdf302d7d9275177bda73550e1b6e446b3520e9b6266d3582c","complete":true,"records":3148,"lastAttemptAt":"2026-11-17T03:27:59.1865875+00:00","lastSuccessAt":"2026-11-15T11:05:17.1034234+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:27:59.1865875+00:00","snapshotPublishedAt":"2026-11-15T10:03:04+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-68251c5be188ac024e6e2a3c0743b593bc1080ccb4c8dc5f887785cf7ea05d9e","complete":true,"records":232570,"lastAttemptAt":"2026-11-17T03:27:59.0324127+00:00","lastSuccessAt":"2026-11-17T03:27:57.5016286+00:00","error":null,"lastVerifiedAt":"2026-11-17T03:27:59.0324127+00:00","snapshotPublishedAt":"2026-11-17T03:03:23+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}