Bug 14391 - ruby new security issue CVE-2014-8080
Summary: ruby new security issue CVE-2014-8080
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 4
Hardware: i586 Linux
Priority: Normal major
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL: http://lwn.net/Vulnerabilities/619214/
Whiteboard: MGA3TOO has_procedure advisory MGA3-6...
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2014-10-27 20:15 CET by David Walser
Modified: 2014-11-14 01:58 CET (History)
7 users (show)

See Also:
Source RPM: ruby-2.0.0.p247-8.mga4.src.rpm
CVE:
Status comment:


Attachments
Ruby-tk image display test (1.97 KB, application/x-ruby)
2014-11-13 01:06 CET, Len Lawrence
Details
Test image for rubyimage.rb (87.04 KB, image/jpeg)
2014-11-13 01:08 CET, Len Lawrence
Details
Test image 2 for rubyimage.rb (15.28 KB, image/jpeg)
2014-11-13 01:09 CET, Len Lawrence
Details

Description David Walser 2014-10-27 20:15:19 CET
Upstream has issued an advisory today (October 27):
https://www.ruby-lang.org/en/news/2014/10/27/rexml-dos-cve-2014-8080/

The issue is fixed upstream in 2.0.0-p594 and 1.9.3-p550:
https://www.ruby-lang.org/en/news/2014/10/27/ruby-2-0-0-p594-is-released/
https://www.ruby-lang.org/en/news/2014/10/27/ruby-1-9-3-p550-is-released/

Pascal has requested a freeze push for Cauldron.

Mageia 3 and Mageia 4 also need to be updated.

Reproducible: 

Steps to Reproduce:
David Walser 2014-10-27 20:15:25 CET

Whiteboard: (none) => MGA3TOO

Comment 1 David Walser 2014-10-28 04:47:42 CET
Updated packages uploaded for Mageia 3, Mageia 4, and Cauldron.

I see that Funda rebuilt ruby-rmagick in Cauldron.  Is that necessary?

Advisory:
========================

Updated ruby packages fix security vulnerability:

Due to unrestricted entity expansion, when reading text nodes from an XML
document, the REXML parser in Ruby can be coerced into allocating extremely
large string objects which can consume all of the memory on a machine,
causing a denial of service (CVE-2014-8080).

The Mageia 3 ruby package has been updated to 1.9.3-p550 and the Mageia 4
ruby package has been updated to 2.0.0-p594 to fix this issue and several
other bugs.

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-8080
https://www.ruby-lang.org/en/news/2014/10/27/rexml-dos-cve-2014-8080/
https://www.ruby-lang.org/en/news/2014/10/27/ruby-1-9-3-p550-is-released/
https://www.ruby-lang.org/en/news/2014/10/27/ruby-2-0-0-p594-is-released/
========================

Updated packages in core/updates_testing:
========================
ruby-1.9.3.p550-1.mga3
libruby1.9-1.9.3.p550-1.mga3
ruby-doc-1.9.3.p550-1.mga3
ruby-devel-1.9.3.p550-1.mga3
ruby-tk-1.9.3.p550-1.mga3
ruby-irb-1.9.3.p550-1.mga3
ruby-2.0.0.p594-1.mga4
libruby2.0-2.0.0.p594-1.mga4
ruby-doc-2.0.0.p594-1.mga4
ruby-devel-2.0.0.p594-1.mga4
ruby-tk-2.0.0.p594-1.mga4
ruby-irb-2.0.0.p594-1.mga4

from SRPMS:
ruby-1.9.3.p550-1.mga3.src.rpm
ruby-2.0.0.p594-1.mga4.src.rpm

CC: (none) => fundawang, pterjan
Assignee: pterjan => qa-bugs

Comment 2 Len Lawrence 2014-10-28 22:54:04 CET
[root@vega ~]# urpmi ruby
(medium "Core Updates Testing (distrib5)")
  ruby                           2.0.0.p594   1.mga4        x86_64  
(medium "Core Updates Testing (distrib95)")
  ruby-tk                        2.0.0.p594   1.mga4        x86_64  
[root@vega ~]# urpmi ruby-devel
(medium "Core Updates Testing (distrib5)")
  lib64ruby2.0                   2.0.0.p594   1.mga4        x86_64  
  ruby-devel                     2.0.0.p594   1.mga4        x86_64  
[root@vega ~]# urpmi ruby-irb
Marking ruby-irb as manually installed, it won't be auto-orphaned
installing ruby-irb-2.0.0.p594-1.mga4.noarch.rpm from /var/cache/urpmi/rpms
[root@vega ~]# urpmi ruby-doc
installing ruby-doc-2.0.0.p594-1.mga4.noarch.rpm from /var/cache/urpmi/rpms

Tried a couple of home-grown applications with Tk interfaces; these worked just as before.  Need to think about PoC and REXML parser and to check the references.  First impressions are that everything else works fine.

A few simple tests:
Rubygems is always installed by default.  Tried installing a gem which had already been installed:
gem install astro_moon
Fetching: astro_moon-0.2.gem (100%)
Successfully installed astro_moon-0.2
Parsing documentation for astro_moon-0.2
Installing ri documentation for astro_moon-0.2
Done installing documentation for astro_moon after 0 seconds
1 gem installed
An application which uses it continues to work as expected.

Checked interactive scripting:
[lcl@vega ~]$ irb
irb(main):001:0> abc = %w( a b c d e f g h i j k l m n o p q r s t u v w x y z )
=> ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
irb(main):002:0> s = ""
=> ""
irb(main):003:0> abc.each { |zed| s += zed }
=> ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
irb(main):004:0> puts s
abcdefghijklmnopqrstuvwxyz
=> nil
irb(main):005:0> quit
Commandline documentation, summary for String class:
[lcl@vega ~]$ ri String
= String < Object

------------------------------------------------------------------------------
= Includes:
Comparable (from ruby core)

(from ruby core)
------------------------------------------------------------------------------
Rake extension methods for String.

A String object holds and manipulates an arbitrary sequence of bytes,
typically representing characters. String objects may be created using
String::new or as literals.

Because of aliasing issues, users of strings should be aware of the methods
that modify the contents of a String object.  Typically, methods with names
ending in ``!'' modify their receiver, while those without a ``!'' return a
new String.  However, there are exceptions, such as String#[]=.
------------------------------------------------------------------------------
= Class methods:

  new, try_convert

= Instance methods:

  %, *, +, <<, <=>, ==, ===, =~, [], []=, ascii_only?, b, block_scanf, bytes,
  bytesize, byteslice, capitalize, capitalize!, casecmp, center, chars, chomp,
  chomp!, chop, chop!, chr, clear, codepoints, concat, count, crypt, delete,
  delete!, downcase, downcase!, dump, each_byte, each_char, each_codepoint,
  each_line, empty?, encode, encode!, encoding, end_with?, eql?, ext,
  force_encoding, getbyte, gsub, gsub!, hash, hex, include?, index,
  initialize_copy, insert, inspect, intern, iseuc, isjis, issjis, isutf8,
  kconv, length, lines, ljust, lstrip, lstrip!, match, next, next!, oct, ord,
  partition, pathmap, pathmap_explode, pathmap_partial, pathmap_replace,
  prepend, replace, reverse, reverse!, rindex, rjust, rpartition, rstrip,
  rstrip!, scan, scanf, setbyte, shellescape, shellsplit, size, slice, slice!,
  split, squeeze, squeeze!, start_with?, strip, strip!, sub, sub!, succ,
  succ!, sum, swapcase, swapcase!, to_c, to_d, to_f, to_i, to_r, to_s, to_str,
  to_sym, toeuc, tojis, tolocale, tosjis, toutf16, toutf32, toutf8, tr, tr!,
  tr_s, tr_s!, unpack, upcase, upcase!, upto, valid_encoding?

(END)

CC: (none) => tarazed25

Comment 3 David Walser 2014-10-30 15:50:48 CET
More details of the security issue here if you're interested:
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2014-8080

Severity: normal => major

Comment 4 David Walser 2014-11-05 18:58:25 CET
Ubuntu has issued an advisory for this on November 4:
http://www.ubuntu.com/usn/usn-2397-1/

They also backported an upstream patch from ruby trunk (not sure if it was also in 2.1.x) to fix CVE-2014-4975.  Considering that it was fixed in trunk in July and upstream didn't bother to backport it for these newer 1.9.3 and 2.0.0 releases, and Ubuntu's CVE notes say the issue is "not likely to be exposed," I've just committed the patch in SVN for now.  For Mageia 3, it won't be included in the update unless I rebuild it now (let me know if anyone thinks I should).  For Mageia 4 it'll be included in the next update in the future.

URL: (none) => http://lwn.net/Vulnerabilities/619214/

Comment 5 Rémi Verschelde 2014-11-07 16:45:18 CET
Testing procedure: https://bugs.mageia.org/show_bug.cgi?id=10637#c7

CC: (none) => remi
Whiteboard: MGA3TOO => MGA3TOO has_procedure

Comment 6 olivier charles 2014-11-07 21:33:59 CET
Tested on Mageia3-64 using procedure mentionned in comment 5

Before :
-------

Current packages, installed : 
- lib64ruby1.9-1.9.3.p484-1.mga3.x86_64
- lib64tcl8.5-8.5.13-1.mga3.x86_64
- lib64tk8.5-8.5.13-2.mga3.x86_64
- lib64yaml0_2-0.1.6-1.mga3.x86_64
- ruby-1.9.3.p484-1.mga3.x86_64
- ruby-irb-1.9.3.p484-1.mga3.noarch
- ruby-json-1.7.7-1.mga3.x86_64
- ruby-linecache19-0.5.13-5.1.mga3.x86_64
- ruby-rdoc-3.12.1-2.mga3.noarch
- ruby-RubyGems-1.8.27-1.mga3.noarch
- ruby-tk-1.9.3.p484-1.mga3.x86_64
- ruby-ruby-debug-base19-0.11.26-5.1.mga3.x86_64
- ruby-devel-1.9.3.p484-1.mga3.x86_64
- ruby-linecache19-0.5.13-5.1.mga3.x86_64
- tcl-8.5.13-1.mga3.x86_64
- tk-8.5.13-2.mga3.x86_64

Ran 
- ruby test
- irb + tk test
- irb + linecache test
- debug19 test

in this latter test for ruby-ruby-debug19, I had to make following changes :
$ ruby -rdebug rubytest.rb (instead of $ rdebug rubytest.rb)

and further on :
(rdb:1) c    (instead of : (rdb:1) continue)
All tests passed.


After :
-----

Testing packages :
- lib64ruby1.9-1.9.3.p550-1.mga3.x86_64
- ruby-1.9.3.p550-1.mga3.x86_64
- ruby-devel-1.9.3.p550-1.mga3.x86_64
- ruby-irb-1.9.3.p550-1.mga3.noarch
- ruby-tk-1.9.3.p550-1.mga3.x86_64

Re-ran the same tests, all OK.

CC: (none) => olchal
Whiteboard: MGA3TOO has_procedure => MGA3TOO has_procedure MGA3-64-OK

Comment 7 Len Lawrence 2014-11-08 21:47:21 CET
Marking it OK for mga4 as well.
Len Lawrence 2014-11-08 21:47:49 CET

Whiteboard: MGA3TOO has_procedure MGA3-64-OK => MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK

Comment 8 Shlomi Fish 2014-11-12 18:35:12 CET
Test in comment 5 tested fine on MGA4-32 - before and after the upgrade . Marking as such.

CC: (none) => shlomif
Whiteboard: MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK => MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK MGA4-32-OK

Comment 9 Shlomi Fish 2014-11-12 18:42:27 CET
(In reply to Shlomi Fish from comment #8)
> Test in comment 5 tested fine on MGA4-32 - before and after the upgrade .
> Marking as such.

Working fine on MGA3-32bit (i586). Marking as such.

Whiteboard: MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK MGA4-32-OK => MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK MGA4-32-OK MGA3-32-OK

Comment 10 Len Lawrence 2014-11-13 01:04:11 CET
Testing on mga4 32bit virtualbox.

Packages installed from Core 32bit Updates Testing:
ruby-2.0.0.p594-1.mga4
libruby2.0-2.0.0.p594-1.mga4
ruby-doc-2.0.0.p594-1.mga4
ruby-devel-2.0.0.p594-1.mga4
ruby-tk-2.0.0.p594-1.mga4
ruby-irb-2.0.0.p594-1.mga4

Core Release image support libraries for Tk:
tkimg-1.4-2.mga4.i586
There is an unresolved bug in tkimg associated with PNG images.

Note that MageiaUpdate does not select ruby-devel - install from the command line.
In mga4 rubygems is now included in the ruby package, hence no need for ruby-Rubygems.

Ran some general tests as before; no problems.
A demonstration script for JPEG image handling in ruby-tk has been attached together with a specimen image.
Comment 11 Len Lawrence 2014-11-13 01:06:52 CET
Created attachment 5591 [details]
Ruby-tk image display test

Use the supplied JPEG image files if you wish.
Comment 12 Len Lawrence 2014-11-13 01:08:05 CET
Created attachment 5592 [details]
Test image for rubyimage.rb
Comment 13 Len Lawrence 2014-11-13 01:09:24 CET
Created attachment 5593 [details]
Test image 2 for rubyimage.rb
Comment 14 claire robinson 2014-11-13 09:41:32 CET
Good testing on this one guys. Don't forget to validate updates when they're ready. I'll upload the advisory and validate this one now.
Comment 15 claire robinson 2014-11-13 09:50:28 CET
Advisory uploaded. Validating.

Could sysadmin please push to 3 & 4 updates

Thanks

Keywords: (none) => validated_update
Whiteboard: MGA3TOO has_procedure MGA3-64-OK MGA4-64-OK MGA4-32-OK MGA3-32-OK => MGA3TOO has_procedure advisory MGA3-64-OK MGA4-64-OK MGA4-32-OK MGA3-32-OK
CC: (none) => sysadmin-bugs

Comment 16 Mageia Robot 2014-11-14 01:58:11 CET
An update for this issue has been pushed to Mageia Updates repository.

http://advisories.mageia.org/MGASA-2014-0443.html

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


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