Bug 22203 - ruby new security issues CVE-2017-17405 and CVE-2017-17790
Summary: ruby new security issues CVE-2017-17405 and CVE-2017-17790
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA5TOO MGA5-32-OK MGA5-64-OK MGA6-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2017-12-15 22:13 CET by David Walser
Modified: 2017-12-31 16:51 CET (History)
4 users (show)

See Also:
Source RPM: ruby-2.4.2-2.mga7.src.rpm
CVE:
Status comment:


Attachments

Description David Walser 2017-12-15 22:13:39 CET
Upstream has issued an advisory on December 14:
https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/

The issue was fixed in 2.2.9 and 2.4.3:
https://www.ruby-lang.org/en/news/2017/12/14/ruby-2-2-9-released/
https://www.ruby-lang.org/en/news/2017/12/14/ruby-2-4-3-released/

Mageia 6 is also affected.  Mageia 5 may be as well.
David Walser 2017-12-15 22:13:48 CET

Whiteboard: (none) => MGA6TOO

Comment 1 David Walser 2017-12-30 18:56:28 CET
Advisory:
========================

Updated ruby packages fix security vulnerabilities:

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 (CVE-2017-17405).

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses
Kernel#open, which might allow Command Injection attacks, as demonstrated by a
Resolv::Hosts::new argument beginning with a '|' character (CVE-2017-17790).

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17405
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17790
https://www.ruby-lang.org/en/news/2017/12/14/net-ftp-command-injection-cve-2017-17405/
========================

Updated packages in core/updates_testing:
========================
ruby-2.0.0.p648-1.6.mga5
libruby2.0-2.0.0.p648-1.6.mga5
ruby-doc-2.0.0.p648-1.6.mga5
ruby-devel-2.0.0.p648-1.6.mga5
ruby-tk-2.0.0.p648-1.6.mga5
ruby-irb-2.0.0.p648-1.6.mga5
ruby-2.2.8-1.1.mga6
libruby2.2-2.2.8-1.1.mga6
ruby-doc-2.2.8-1.1.mga6
ruby-devel-2.2.8-1.1.mga6
ruby-tk-2.2.8-1.1.mga6
ruby-power_assert-0.2.2-1.1.mga6
ruby-irb-2.2.8-1.1.mga6
ruby-io-console-0.4.3-1.1.mga6
ruby-test-unit-3.0.8-1.1.mga6

from SRPMS:
ruby-2.0.0.p648-1.6.mga5.src.rpm
ruby-2.2.8-1.1.mga6.src.rpm

CC: (none) => pterjan
Version: Cauldron => 6
Assignee: pterjan => qa-bugs
Whiteboard: MGA6TOO => MGA5TOO
Summary: ruby new security issue CVE-2017-17405 => ruby new security issues CVE-2017-17405 and CVE-2017-17790

Comment 2 Herman Viaene 2017-12-31 09:53:33 CET
MGA5-32 on Dell Latitude D600
No installation issues
Ref to https://www.thegeekstuff.com/2009/10/ruby-hello-world-example-how-to-write-and-execute-ruby-program-on-unix-os/ for a simple example.
$ ruby rubyexample.rb 
Hello World!
Result as expected.

Whiteboard: MGA5TOO => MGA5TOO MGA5-32-OK
CC: (none) => herman.viaene

Comment 3 Len Lawrence 2017-12-31 10:37:14 CET
Mageia 5 :: x86_64

Updated the packages.
Used irb to execute calculator type commands and imported an executable script.
$ irb
irb(main):001:0> require Dir.home+"/ruby/scripts/testing"
In 20 years £490.67 becomes £2031.65 at 7% interest.
=> true
irb(main):002:0> exit

Ran several local ruby-tk gui scripts successfully, most of them quite complex.
One  was a non-interactive desktop applet for downloading weather information and displaying an extract periodically.  Continues to work.
Installed a gem.
$ sudo gem install eventmachine
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
Fetching: eventmachine-1.2.5.gem (100%)
Building native extensions.  This could take a while...
Successfully installed eventmachine-1.2.5
Parsing documentation for eventmachine-1.2.5
Installing ri documentation for eventmachine-1.2.5
Done installing documentation for eventmachine after 3 seconds
1 gem installed

This update is OK.

CC: (none) => tarazed25

Len Lawrence 2017-12-31 10:38:13 CET

Whiteboard: MGA5TOO MGA5-32-OK => MGA5TOO MGA6-64-OK MGA6-32-OK

Comment 4 Len Lawrence 2017-12-31 10:42:03 CET
Apologies for the finger trouble - not quite awake yet.

Whiteboard: MGA5TOO MGA6-64-OK MGA6-32-OK => MGA5TOO MGA5-32-OK MGA5-64-OK

Comment 5 Len Lawrence 2017-12-31 13:43:15 CET
Mageia 6 :: x86_64

Updated the packages - RubyGems already updated and tested.
Simple script = testing.rb:
#!/bin/env ruby
# coding: utf-8
rate = 1.05
principal = 599.0
years = 15

ar = Proc.new { |rate| (100*rate - 100.0).floor }

interest = rate
1.upto( years ) { |n| interest *= rate }
value = sprintf( "%7.2f", (principal * interest) )
puts "In #{years} years £#{principal} becomes £#{value} at #{ar.call rate}% interest."

$ irb
irb(main):001:0> require Dir.home+"/ruby/scripts/testing"
In 15 years £599.0 becomes £1307.54 at 5% interest.
=> true
irb(main):002:0> exit

Ran several local scripts which make extensive use of ruby-tk and gems like mplayer-ruby to generate interactive and passive guis and display images and run 
a movie jukebox and a label printer for instance.

This is good to go.

Whiteboard: MGA5TOO MGA5-32-OK MGA5-64-OK => MGA5TOO MGA5-32-OK MGA5-64-OK MGA6-64-OK

Comment 6 Len Lawrence 2017-12-31 13:47:37 CET
Rider to comment 5.

The testing script was based on one which accepts arguments.  Both run perfectly well from the commandline.  The test here was to show that irb is functional.  The code could just as well have been input via the irb prompt, line by line.
Comment 7 Lewis Smith 2017-12-31 16:02:36 CET
Great work, Len. Advisoried, validating 3/4 OKs.

Keywords: (none) => advisory, validated_update
CC: (none) => sysadmin-bugs

Comment 8 Mageia Robot 2017-12-31 16:51:45 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2017-0486.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.