REDHAT-BUG-2456971: Command Injection

Published Apr 9, 2026
·
Updated

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 Software

1 affected component
npm/basic-ftp<5.2.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade basic-ftp to a version that resolves this vulnerability.

    Fixed in 5.2.1

Event History

Apr 9, 2026
Data Sourced
via Red Hat·06:02 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using basic-ftp versions prior to 5.2.1 are exposed when they pass attacker-controlled file path values to high-level APIs including cd(), remove(), rename(), uploadFrom(), downloadTo(), list(), or removeDir().

2

What does an attacker need to exploit it?

An attacker needs to influence a path parameter supplied to an affected high-level basic-ftp API. The supplied value must contain CRLF sequences so it can terminate the intended FTP command and inject additional commands on the FTP control connection.

3

Is there a fix available?

Yes. The issue is fixed in basic-ftp version 5.2.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203