Bug 21493 - ruby-rubyzip new security issue CVE-2017-5946
Summary: ruby-rubyzip new security issue CVE-2017-5946
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 MGA6-64-OK MGA6-32-OK MGA5-64...
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2017-08-11 01:30 CEST by David Walser
Modified: 2017-08-13 15:18 CEST (History)
8 users (show)

See Also:
Source RPM: ruby-rubyzip-1.1.7-1.mga6.src.rpm
CVE:
Status comment:


Attachments
Sample script to demonstrate zip functions from the rubyzip gem (1.91 KB, application/x-ruby)
2017-08-12 03:33 CEST, Len Lawrence
Details
Sample script to exercize the ruby-zip gem (2.24 KB, application/x-ruby)
2017-08-12 03:58 CEST, Len Lawrence
Details
Sample script to exercise the ruby-zip gem (2.27 KB, application/x-ruby)
2017-08-12 08:44 CEST, Len Lawrence
Details
Sample script to demonstrate zip methods from the ruby zip gem (2.27 KB, application/x-ruby)
2017-08-12 09:10 CEST, Len Lawrence
Details
Sample script to demonstrate zip methods in ruby (2.27 KB, application/x-ruby)
2017-08-12 10:48 CEST, Len Lawrence
Details

Description David Walser 2017-08-11 01:30:43 CEST
openSUSE has issued an advisory today (August 10):
https://lists.opensuse.org/opensuse-updates/2017-08/msg00025.html

The issue is fixed upstream in 1.2.1 according to the SUSE bug:
https://bugzilla.suse.com/show_bug.cgi?id=1027050

Mageia 5 is also affected.
David Walser 2017-08-11 01:30:54 CEST

Whiteboard: (none) => MGA6TOO, MGA5TOO

Comment 1 Marja Van Waes 2017-08-11 11:17:38 CEST
Assigning to all packagers collectively, since there is no registered maintainer for this package.

Also CC'ing some committers.

CC: (none) => cooker, marja11, pterjan, shlomif
Assignee: bugsquad => pkg-bugs

Comment 2 Nicolas Lécureuil 2017-08-11 18:36:39 CEST
for the reccord, the fix https://github.com/rubyzip/rubyzip/commit/ce4208fdecc2ad079b05d3c49d70fe6ed1d07016

CC: (none) => mageia

Nicolas Lécureuil 2017-08-11 18:37:03 CEST

Version: Cauldron => 6
Whiteboard: MGA6TOO, MGA5TOO => MGA5TOO

Comment 3 Nicolas Lécureuil 2017-08-11 20:50:14 CEST
pushed in updates_testing

src.rpm:
        ruby-rubyzip-1.1.4-3.1.mga5
        ruby-rubyzip-1.1.7-1.1.mga6

Assignee: pkg-bugs => qa-bugs

Comment 4 David Walser 2017-08-11 23:22:44 CEST
Advisory:
========================

Updated ruby-rubyzip packages fix security vulnerability:

A directory traversal vulnerability could lead to access and overwrite files
that are outside of the restricted directory (CVE-2017-5946).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5946
https://lists.opensuse.org/opensuse-updates/2017-08/msg00025.html
========================

Updated packages in core/updates_testing:
========================
ruby-rubyzip-1.1.4-3.1.mga5
ruby-rubyzip-doc-1.1.4-3.1.mga5
ruby-rubyzip-1.1.7-1.1.mga6
ruby-rubyzip-doc-1.1.7-1.1.mga6

from SRPMS:
ruby-rubyzip-1.1.4-3.1.mga5.src.rpm
ruby-rubyzip-1.1.7-1.1.mga6.src.rpm
Comment 5 Len Lawrence 2017-08-12 01:43:55 CEST
mga6  x86_64

Installed the pre-update packages and developed a short test script based on the documentation at https://mensfeld.pl/2011/12/using-ruby-and-zip-library-to-compress-directories-and-read-single-file-from-compressed-collection/

It successfully creates a zip file for a designated directory and this can be unzipped using unzip.  However, I am having trouble extracting single files using the test script.  Pursuing this tomorrow.

CC: (none) => tarazed25

Comment 6 Len Lawrence 2017-08-12 03:28:43 CEST
Attaching a test script.  Ran this again to generate a zip file and managed to extract a single file and write its contents to a new file.

Leaving the updates until later - halfway through the night here.
Comment 7 Len Lawrence 2017-08-12 03:33:36 CEST
Created attachment 9587 [details]
Sample script to demonstrate zip functions from the rubyzip gem

Anybody wanting to use this should edit it to suit.
It should be fairly obvious where to change file names.
Comment 8 Len Lawrence 2017-08-12 03:58:55 CEST
Created attachment 9588 [details]
Sample script to exercize the ruby-zip gem

Attachment 9587 is obsolete: 0 => 1

Comment 9 Len Lawrence 2017-08-12 08:44:06 CEST
Created attachment 9589 [details]
Sample script to exercise the ruby-zip gem

Attachment 9588 is obsolete: 0 => 1

Comment 10 Len Lawrence 2017-08-12 09:10:33 CEST
Created attachment 9590 [details]
Sample script to demonstrate zip methods from the ruby zip gem

Sorry about that.  Forgot a one-line change in the shell operations.

Attachment 9589 is obsolete: 0 => 1

Comment 11 Len Lawrence 2017-08-12 09:39:10 CEST
mga6  x86_64  Mate

No reproducers available at this time.

Installed the updates.
$ rpm -qa | grep ruby | grep zip
ruby-rubyzip-doc-1.1.7-1.1.mga6
ruby-rubyzip-1.1.7-1.1.mga6

$ zipx data
Zipping directory data
-rw------- 1 lcl lcl 41743315 Aug 12 07:34 /home/lcl/data.zip
Difference between original and extracted files is :  :

Moved zip file to an out-of-the-way directory and unzipped it.
$ ls ~/tmp/*.zip
/home/lcl/tmp/data.zip
$ cd tmp
$ unzip data.zip
Archive:  data.zip
   creating: data/Christmas/
  inflating: data/Christmas/Cardlist  
......
  inflating: data/vlcchans.xspf      
   creating: data/web/
  inflating: data/web/googlemail     
  inflating: data/web/urls           
  inflating: data/xyz.odt            
finishing deferred symbolic links:
  data/calco/data        -> /home/lcl/.local/share/calco
$ ls -l
drwxr-xr-x 30 lcl lcl     4096 Aug 12 08:22 data/
-rw-------  1 lcl lcl 41743315 Aug 12 07:34 data.zip

Good for 64-bits.  These are noarch packages so there should be no surprises on 32-bit platforms.
Len Lawrence 2017-08-12 09:40:19 CEST

Whiteboard: MGA5TOO => MGA5TOO MGA6-64-OK

Comment 12 Len Lawrence 2017-08-12 10:07:52 CEST
mga6  i586 in virtualbox  Mate

Ran the tests outlined in comment 11 before and after the updates.
That went well.  OK for 32-bits.
Len Lawrence 2017-08-12 10:08:52 CEST

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

Comment 13 Len Lawrence 2017-08-12 10:48:34 CEST
Created attachment 9591 [details]
Sample script to demonstrate zip methods in ruby

Changed mv to cp.
Comment 14 Len Lawrence 2017-08-12 10:55:14 CEST
mga5  x86_64  KDE4

Installed the updates and used the tests from comment 11 to zip a directory and extract a file from it.  Copied the zip file to ~/tmp and extracted its contents using unzip.  All OK.
Len Lawrence 2017-08-12 10:55:29 CEST

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

Comment 15 Len Lawrence 2017-08-12 12:16:58 CEST
mga5  i586 on virtualbox  Mate

Ran the comment tests before and after the updates, with positive results.
This update can be validated.
Len Lawrence 2017-08-12 12:17:58 CEST

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs
Whiteboard: MGA5TOO MGA6-64-OK MGA6-32-OK MGA5-64-OK => MGA5TOO MGA6-64-OK MGA6-32-OK MGA5-64-OK MGA5-32-OK

Comment 16 Len Lawrence 2017-08-12 12:21:04 CEST
Why don't the balls turn green?
Lewis Smith 2017-08-13 11:04:33 CEST

CC: (none) => lewyssmith
Whiteboard: MGA5TOO MGA6-64-OK MGA6-32-OK MGA5-64-OK MGA5-32-OK => MGA5TOO MGA6-64-OK MGA6-32-OK MGA5-64-OK MGA5-32-OK advisory

Comment 17 Mageia Robot 2017-08-13 15:18:41 CEST
An update for this issue has been pushed to the Mageia Updates repository.

http://advisories.mageia.org/MGASA-2017-0264.html

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


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