← Vulnerability feed

Vulnerability record · CVE-2017-17405 · published 15 December 2017

CVE-2017-17405: Ruby Net::FTP local file handling allows command injection

Ruby Lang · Ruby

Ruby before 2.4.3 lets Net::FTP methods (get, getbinaryfile, gettextfile, put, putbinaryfile, puttextfile) pass the localfile argument to Kernel#open. If localfile begins with the "|" pipe character, the following command is executed, and since localfile defaults to File.basename(remotefile), a malicious FTP server can trigger arbitrary command execution.

8.8 CVSS 3.0 High EPSS 74% · top 0.5% CWE-78 · OS command injection
8.8CVSS 3.0 base score, v2 9.3
74%EPSS exploitation probability, 30 days
NoNot in CISA KEV
8Affected product versions listed by NVD
28References, 2 tagged exploit
17 Jun 2026Last modified by NVD

Description

Ruby before 2.4.3 allows Net::FTP command injection. Net::FTP#get, getbinaryfile, gettextfile, put, putbinaryfile, and puttextfile use Kernel#open to open a local file. If the localfile argument starts with the "|" pipe character, the command following the pipe character is executed. The default value of localfile is File.basename(remotefile), so malicious FTP servers could cause arbitrary command execution.

CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Automated analysis

Generated by VULONE's analysis model from the NVD record, CISA KEV and EPSS data on 18 September 2026. Confidence: high.

high priorityNetwork-reachable command injection with a public exploit and very high EPSS, though it requires user interaction and a malicious FTP server.

What it is

Ruby before 2.4.3 lets Net::FTP methods (get, getbinaryfile, gettextfile, put, putbinaryfile, puttextfile) pass the localfile argument to Kernel#open. If localfile begins with the "|" pipe character, the following command is executed, and since localfile defaults to File.basename(remotefile), a malicious FTP server can trigger arbitrary command execution.

Impact

An attacker controlling the FTP server can execute arbitrary commands with the privileges of the Ruby process on the connecting client.

Attack surface

Reached over the network when a Ruby application connects to an attacker-controlled FTP server and calls the affected Net::FTP methods; the CVSS vector indicates no privileges required but user interaction is required.

Exploitation

Not listed in CISA KEV, but EPSS is very high (0.73829, 99.45th percentile) and a public Exploit-DB entry (43381) exists, indicating known exploit code is available.

What to do

  • Upgrade Ruby to 2.4.3 or later, or apply the vendor patch for your distribution (Red Hat RHSA-2018:0378/0583/0584/0585/2806, Debian DSA-4259).
  • Avoid passing untrusted or server-derived values as the localfile argument to Net::FTP methods.
  • Do not connect to untrusted FTP servers from Ruby code using the affected methods.
  • Where feasible, replace Net::FTP usage with a client that does not route local paths through Kernel#open.

Detection

  • Monitor Ruby processes for unexpected child process execution, especially shells or commands spawned from FTP client activity.
  • Audit application code and logs for Net::FTP calls where localfile derives from a remote filename.
  • Watch outbound FTP connections to untrusted or unexpected servers from hosts running Ruby.

This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.

Affected products

8 vulnerable configurations from NVD's CPE data, grouped by vendor and product.

References

LinkTags
http://www.securityfocus.com/bid/102204 Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1042004 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:0378 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0583 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0584 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0585 Third Party Advisory
https://access.redhat.com/errata/RHSA-2019:2806
https://lists.debian.org/debian-lts-announce/2017/12/msg00024.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2017/12/msg00025.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html Mailing ListThird Party Advisory
https://www.debian.org/security/2018/dsa-4259 Third Party Advisory
https://www.exploit-db.com/exploits/43381/ ExploitThird Party AdvisoryVDB Entry
https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/ Vendor Advisory
https://www.ruby-lang.org/en/news/2017/12/14/ruby-2-4-3-released/ PatchRelease NotesVendor Advisory
http://www.securityfocus.com/bid/102204 Third Party AdvisoryVDB Entry
http://www.securitytracker.com/id/1042004 Third Party AdvisoryVDB Entry
https://access.redhat.com/errata/RHSA-2018:0378 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0583 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0584 Third Party Advisory
https://access.redhat.com/errata/RHSA-2018:0585 Third Party Advisory
https://access.redhat.com/errata/RHSA-2019:2806
https://lists.debian.org/debian-lts-announce/2017/12/msg00024.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2017/12/msg00025.html Mailing ListThird Party Advisory
https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html Mailing ListThird Party Advisory
https://www.debian.org/security/2018/dsa-4259 Third Party Advisory
https://www.exploit-db.com/exploits/43381/ ExploitThird Party AdvisoryVDB Entry
https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/ Vendor Advisory
https://www.ruby-lang.org/en/news/2017/12/14/ruby-2-4-3-released/ PatchRelease NotesVendor Advisory

Track CVE-2017-17405 inside VULONE

Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.

Start free Open in platform

Related vulnerabilities

Same products first, then exploited flaws of the same weakness class.

10.0CVE-2025-32433Erlang/OTP SSH server missing authentication allows remote code executionErlang/OTP SSH servers before OTP-27.3.3, OTP-26.2.5.11 and OTP-25.3.2.20 mishandle SSH protocol messages, letting an unauthenticated attacker execut…KEVEPSS 99%analysed10.0CVE-2025-24201Apple WebKit out-of-bounds write allows sandbox escapeCVE-2025-24201 is an out-of-bounds write in Apple's WebKit that was addressed with improved checks. Maliciously crafted web content may break out of …KEVEPSS 3.8%analysed10.0CVE-2021-44228Apache Log4j2 JNDI lookup remote code executionApache Log4j2 versions 2.0-beta9 through 2.15.0 (excluding 2.12.2, 2.12.3, and 2.3.1) do not protect against attacker-controlled LDAP and other JNDI …KEVEPSS 100%analysed9.8CVE-2026-24061GNU Inetutils telnetd argument injection allows remote auth bypasstelnetd in GNU Inetutils through 2.7 fails to sanitize the USER environment variable, so a value such as "-f root" is passed as an argument to login …KEVEPSS 99%analysed9.8CVE-2025-39682Linux kernel TLS zero-length record handling flaw on rx_listThe Linux kernel TLS receive path mishandles zero-length records that arrive from the rx_list, breaking the assumption that a record type change cann…KEVEPSS 2.9%analysed9.8CVE-2025-24813Apache Tomcat Default Servlet path equivalence enables RCE and file disclosureApache Tomcat mishandles path equivalence for names containing an internal dot, letting a remote unauthenticated attacker write files through the Def…KEVEPSS 100%analysed9.8CVE-2024-9680Mozilla Firefox and Thunderbird use-after-free in Animation timelinesA use-after-free flaw in Animation timelines allows an attacker to execute code in the content process of Firefox and Thunderbird. Mozilla reports ex…KEVEPSS 23%analysed9.8CVE-2023-46604Apache ActiveMQ OpenWire deserialization remote code executionThe Java OpenWire protocol marshaller in Apache ActiveMQ deserializes untrusted data, letting an attacker manipulate serialized class types so the br…KEVEPSS 100%analysed

Source: NIST National Vulnerability Database (record CVE-2017-17405), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.