Skip to content
OpenAdvisories
Unscored Public exploit CVE-2017-17405 EUVD-2017-8570GHSA-q23r-c9rf-97q3

Ruby before 2.4.3 allows Net::FTP command injection. Net::FTP#get, getbinaryfile, gettextfile, put, putbinaryfile, and puttextfile use Kern…

Published Dec 15, 2017 · Updated Aug 5, 2024 · Assigned by mitre

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 9 ruby2.3 2.3.3-1+deb9u3 DSA-4259-1
Debian 8 ruby2.1 2.1.5-2+deb8u4 DLA-1421-1
Debian 7 ruby1.8 1.8.7.358-7.1+deb7u5 DLA-1222-1
Debian 7 ruby1.9.1 1.9.3.194-8.1+deb7u7 DLA-1221-1
ReleasePackageFixed inAdvisory
Ubuntu 16.04 LTS ruby2.3 2.3.1-2~16.04.4 USN-3515-1
Ubuntu 14.04 LTS ruby1.9.1 1.9.3.484-2ubuntu1.6 USN-3515-1
Ubuntu 14.04 LTS ruby2.0 2.0.0.484-1ubuntu2.5 USN-3515-1
ReleasePackageFixed inAdvisory
RHEL 7 ruby +5 2.0.0.648-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-bigdecimal 1.2.0-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-io-console 0.4.2-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-json 1.7.7-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-minitest 4.3.2-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-psych 2.0.0-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-rake 0.9.6-33.el7_4 RHSA-2018:0378
RHEL 7 rubygem-rdoc 4.0.0-33.el7_4 RHSA-2018:0378
RHEL 7 rubygems +1 2.0.14.1-33.el7_4 RHSA-2018:0378
RHEL 3 rh-ruby22-ruby +5 2.2.9-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-bigdecimal 1.2.6-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-io-console 0.4.3-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-json 1.8.1.1-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-minitest 5.4.3-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-power_assert 0.2.2-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-psych 2.0.8.1-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-rake 10.4.2-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-rdoc 4.2.0-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygem-test-unit 3.0.8-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby22-rubygems +1 2.4.5.4-19.el6 RHSA-2018:0583
RHEL 3 rh-ruby23-ruby +5 2.3.6-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-bigdecimal 1.2.8-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-did_you_mean 1.0.0-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-io-console 0.4.5-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-json 1.8.3.1-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-minitest 5.8.5-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-net-telnet 0.1.1-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-power_assert 0.2.6-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-psych 2.1.0.1-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-rake 10.4.2-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-rdoc 4.2.1-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygem-test-unit 3.1.5-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby23-rubygems +1 2.5.2.2-67.el6 RHSA-2018:0585
RHEL 3 rh-ruby24-ruby +4 2.4.3-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-bigdecimal 1.3.0-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-did_you_mean 1.1.0-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-io-console 0.4.6-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-json 2.0.4-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-minitest 5.10.1-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-net-telnet 0.1.1-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-openssl 2.0.5-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-power_assert 0.4.1-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-psych 2.2.2-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-rake 12.0.0-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-rdoc 5.0.0-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-test-unit 3.2.3-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygem-xmlrpc 0.2.1-90.el6 RHSA-2018:0584
RHEL 3 rh-ruby24-rubygems +1 2.6.14-90.el6 RHSA-2018:0584
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
RHEL 7.3 TUS ruby +5 2.0.0.648-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-bigdecimal 1.2.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-io-console 0.4.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-json 1.7.7-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-minitest 4.3.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-psych 2.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-rake 0.9.6-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygem-rdoc 4.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 TUS rubygems +1 2.0.14.1-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S ruby +5 2.0.0.648-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-bigdecimal 1.2.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-io-console 0.4.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-json 1.7.7-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-minitest 4.3.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-psych 2.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-rake 0.9.6-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygem-rdoc 4.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 E4S rubygems +1 2.0.14.1-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS ruby +5 2.0.0.648-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-bigdecimal 1.2.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-io-console 0.4.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-json 1.7.7-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-minitest 4.3.2-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-psych 2.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-rake 0.9.6-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygem-rdoc 4.0.0-30.el7_3 RHSA-2019:2806
RHEL 7.3 AUS rubygems +1 2.0.14.1-30.el7_3 RHSA-2019:2806
ReleasePackageFixed inAdvisory
SLES 12 SP5 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES 12 SP4 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES 12 SP3 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES 12 SP2 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES 12 SP2 yast2-ruby-bindings 3.1.53-9.8.1 SUSE-SU-2020:1570-1
Show 9 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES for SAP 12 SP5 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES for SAP 12 SP4 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES for SAP 12 SP3 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES for SAP 12 SP2 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SLES for SAP 12 SP2 yast2-ruby-bindings 3.1.53-9.8.1 SUSE-SU-2020:1570-1
SUSE OpenStack Cloud Crowbar 8 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SUSE OpenStack Cloud 8 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SUSE OpenStack Cloud 7 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SUSE OpenStack Cloud 7 yast2-ruby-bindings 3.1.53-9.8.1 SUSE-SU-2020:1570-1
SUSE HPE Helion OpenStack 8 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
SUSE Enterprise Storage 5 ruby2.1 2.1.9-19.3.2 SUSE-SU-2020:1570-1
ReleasePackageFixed inAdvisory
Alpine v3.24 ruby 2.4.3-r0 —
Alpine v3.23 ruby 2.4.3-r0 —
Alpine v3.22 ruby 2.4.3-r0 —
Alpine v3.21 ruby 2.4.3-r0 —
Alpine v3.20 ruby 2.4.3-r0 —
Show 17 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 ruby 2.4.3-r0 —
Alpine v3.18 ruby 2.4.3-r0 —
Alpine v3.17 ruby 2.4.3-r0 —
Alpine v3.16 ruby 2.4.3-r0 —
Alpine v3.15 ruby 2.4.3-r0 —
Alpine v3.14 ruby 2.4.3-r0 —
Alpine v3.13 ruby 2.4.3-r0 —
Alpine v3.12 ruby 2.4.3-r0 —
Alpine v3.11 ruby 2.4.3-r0 —
Alpine v3.10 ruby 2.4.3-r0 —
Alpine v3.9 ruby 2.4.3-r0 —
Alpine v3.8 ruby 2.4.3-r0 —
Alpine v3.7 ruby 2.4.3-r0 —
Alpine v3.6 ruby 2.4.3-r0 —
Alpine v3.5 ruby 2.3.6-r0 —
Alpine v3.4 ruby 2.3.6-r0 —
Alpine v3.3 ruby 2.2.9-r0 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 7 ruby +5 2.0.0.648-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-bigdecimal 1.2.0-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-io-console 0.4.2-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-json 1.7.7-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-minitest 4.3.2-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-psych 2.0.0-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-rake 0.9.6-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygem-rdoc 4.0.0-33.el7_4 ELSA-2018-0378
Oracle Linux 7 rubygems +1 2.0.14.1-33.el7_4 ELSA-2018-0378

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 12

References