VYPR
High severity8.6NVD Advisory· Published Apr 9, 2026· Updated Apr 14, 2026

CVE-2026-39983

CVE-2026-39983

Description

basic-ftp is an FTP client for Node.js. Prior to 5.2.1, basic-ftp allows FTP command injection via CRLF sequences (\r\n) in file path parameters passed to high-level path APIs such as cd(), remove(), rename(), uploadFrom(), downloadTo(), list(), and removeDir(). The library's protectWhitespace() helper only handles leading spaces and returns other paths unchanged, while FtpContext.send() writes the resulting command string directly to the control socket with \r\n appended. This lets attacker-controlled path strings split one intended FTP command into multiple commands. This vulnerability is fixed in 5.2.1.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
basic-ftpnpm
>= 5.2.0, < 5.2.15.2.1

Affected products

1

Patches

1
2ecc8e2c500c

Reject control character injection attempts using paths

https://github.com/patrickjuchli/basic-ftpPatrick JuchliApr 8, 2026via ghsa
1 file changed · +4 0
  • src/Client.ts+4 0 modified
    @@ -760,6 +760,10 @@ export class Client {
          * a given path to fix that issue for most cases.
          */
         async protectWhitespace(path: string): Promise<string> {
    +        // Reject CRLF injection attempts
    +        if (/[\r\n\0]/.test(path)) {
    +            throw new Error("Invalid path: Contains control characters");
    +        }
             if (!path.startsWith(" ")) {
                 return path
             }
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.