CVE-2017-17405: OS Command Injection

Published Dec 14, 2017
·
Updated

It was discovered that the Net::FTP module did not properly process filenames in combination with certain operations. A remote attacker could exploit this flaw to execute arbitrary commands by setting up a malicious FTP server and tricking a user or Ruby application into downloading files with specially crafted names using the Net::FTP module.

Other sources

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.

Ruby. Multiple issues in Ruby were addressed in this update.

There is a command injection vulnerability in Net::FTP bundled with Ruby. 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.

External references:

https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/

Red Hat

Credit

CVE-2017-0898, CVE-2017-10784, CVE-2017-14033, CVE-2017-14064, CVE-2017-17405, CVE-2017-17742, CVE-2018-6914, CVE-2018-8777, CVE-2018-8778, CVE-2018-8779, CVE-2018-8780

Affected Software

35 affected componentsFixes available
debian/ruby2.5
2.5.5-3+deb10u42.5.5-3+deb10u6
redhat/ruby<0:2.0.0.648-33.el7_4
0:2.0.0.648-33.el7_4
redhat/ruby<0:2.0.0.648-30.el7_3
0:2.0.0.648-30.el7_3
redhat/rh-ruby22-ruby<0:2.2.9-19.el6
0:2.2.9-19.el6
redhat/rh-ruby24-ruby<0:2.4.3-90.el6
0:2.4.3-90.el6
redhat/rh-ruby23-ruby<0:2.3.6-67.el6
0:2.3.6-67.el6
redhat/rh-ruby22-ruby<0:2.2.9-19.el7
0:2.2.9-19.el7
redhat/rh-ruby24-ruby<0:2.4.3-90.el7
0:2.4.3-90.el7
redhat/rh-ruby23-ruby<0:2.3.6-67.el7
0:2.3.6-67.el7
redhat/ruby<2.2.9
2.2.9
redhat/ruby<2.3.6
2.3.6
redhat/ruby<2.4.3
2.4.3
redhat/ruby<2.5.0
2.5.0
Apple macOS Mojave<10.14.1
10.14.1
Apple High Sierra
Apple Sierra
Apple macOS High Sierra<10.13.6
10.13.6
Apple El Capitan
ruby-lang Ruby>=2.2<=2.2.8
ruby-lang Ruby>=2.3<=2.3.5
ruby-lang Ruby>=2.4<=2.4.2
ruby-lang Ruby=2.5.0-preview1
Debian Debian Linux=7.0
Debian Debian Linux=8.0
Debian Debian Linux=9.0
redhat Enterprise Linux Desktop=7.0
redhat Enterprise Linux Server=7.0
redhat Enterprise Linux Server Aus=7.4
redhat Enterprise Linux Server Aus=7.6
redhat Enterprise Linux Server Eus=7.4
redhat Enterprise Linux Server Eus=7.5
redhat Enterprise Linux Server Eus=7.6
redhat Enterprise Linux Server Tus=7.4
redhat Enterprise Linux Server Tus=7.6
redhat Enterprise Linux Workstation=7.0

Event History

Dec 14, 2017
CVE Published
12:00 AM
Dec 15, 2017
CVE Published
via MITRE·09:00 AM
Data Sourced
via MITRE·09:00 AM
Description

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2017-17405?

CVE-2017-17405 is a vulnerability in Ruby that allows Net::FTP command injection.

2

What is the severity of CVE-2017-17405?

CVE-2017-17405 has a severity rating of 8.8 (critical).

3

How can I fix CVE-2017-17405?

To fix CVE-2017-17405, you should update to Ruby version 2.5.5-3+deb10u4 or 2.5.5-3+deb10u6 for Debian, and version 2.4.3 for Red Hat. Make sure to check the vendor's official website for the latest updates.

4

Where can I find more information about CVE-2017-17405?

You can find more information about CVE-2017-17405 on the official Ruby website and the associated GitHub commits. Links: [Ruby website](https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/), [GitHub commit 1](https://github.com/ruby/ruby/commit/6d3f72e5be2312be312f2acbf3465b05293c1431), [GitHub commit 2](https://github.com/ruby/ruby/commit/1cfe43fd85c66a9e2b5068480b3e043c31e6b8ca)

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
CVE-2017-17405 - OS Command Injection - SecAlerts