CVE-2017-17405: Command Injection in Ruby Net::FTP (CVE-2017-17405)
- Vendors
- Debian ProjectRed HatRuby-Lang
A command injection vulnerability exists in Ruby's Net::FTP library prior to version 2.4.3. The methods Net::FTP#get, getbinaryfile, gettextfile, put, putbinaryfile, and puttextfile use Kernel#open to open a local file. If the localfile argument begins with a pipe ('|'), the subsequent string is executed as a shell command. Since the default value for localfile is File.basename(remotefile), a malicious FTP server can supply a filename starting with '|', leading to arbitrary command execution on the client system.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
A malicious FTP server can exploit this vulnerability to execute arbitrary commands on the client machine running vulnerable Ruby code that uses Net::FTP. This can lead to full compromise of the client system, depending on the privileges of the Ruby process.
Mitigation
If you can’t patch tonight, do this now.
As an immediate mitigation, avoid connecting to untrusted FTP servers and sanitize any input used as the localfile argument in Net::FTP methods. Consider using a safer file opening method that does not interpret the pipe character as a shell command.
Remediation
Patch, then assume compromise.
Upgrade Ruby to version 2.4.3 or later, where this vulnerability has been addressed. Ensure that any code using Net::FTP does not pass untrusted input as the localfile argument, and avoid using Kernel#open with untrusted data.
Exploits
No validated public exploits yet. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2017-17405 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2017-17405 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2017-17405?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2017-17405.
- Is there a patch for CVE-2017-17405?
- Upgrade Ruby to version 2.4.3 or later, where this vulnerability has been addressed. Ensure that any code using Net::FTP does not pass untrusted input as the localfile argument, and avoid using Kernel#open with untrusted data.
- What products are affected by CVE-2017-17405?
- Ruby-Lang Ruby, Debian Project Debian Linux, Red Hat Enterprise Linux Desktop, Red Hat Enterprise Linux Server, Red Hat Enterprise Linux Server Aus, and 3 more.
- How severe is CVE-2017-17405?
- CVE-2017-17405 has a CVSS v3 score of 8.8 (High) and an EPSS score of 73.8% (99th percentile) as of Oct 16, 2026.
Recent activity
1 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.