Bug 20091 - icoutils new security issues in wrestool (CVE-2017-5208, CVE-2017-533[1-3])
Summary: icoutils new security issues in wrestool (CVE-2017-5208, CVE-2017-533[1-3])
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 5
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL: https://lwn.net/Vulnerabilities/711047/
Whiteboard: advisory MGA5-64-OK
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2017-01-08 17:56 CET by David Walser
Modified: 2017-02-07 14:35 CET (History)
4 users (show)

See Also:
Source RPM: icoutils-0.31.0-4.mga5.src.rpm
CVE:
Status comment:


Attachments
ico files from Win10 (304.90 KB, application/zip)
2017-01-09 11:35 CET, Herman Viaene
Details
A PoC for the bug (937 bytes, application/octet-stream)
2017-02-07 10:59 CET, Lewis Smith
Details

Description David Walser 2017-01-08 17:56:09 CET
A CVE has been requested for a crash issue in wrestool in icoutils:
http://openwall.com/lists/oss-security/2017/01/08/1

Patched packages uploaded for Mageia 5 and Cauldron.

Advisory pending CVE.

Updated packages in core/updates_testing:
========================
icoutils-0.31.0-4.1.mga5

from icoutils-0.31.0-4.1.mga5.src.rpm
Comment 1 Herman Viaene 2017-01-09 11:34:36 CET
MGA5-32 on AcerD620 Xfce
No installation issues.
Copied some .ico file from Win10 and tried some commands
$ wrestool -l folder.ico 
wrestool: folder.ico: premature end
$ icotool -l folder.ico 
--icon --index=1 --width=48 --height=48 --bit-depth=4 --palette-size=16
--icon --index=2 --width=32 --height=32 --bit-depth=4 --palette-size=16
--icon --index=3 --width=16 --height=16 --bit-depth=4 --palette-size=16
folder.ico: clr_important field in bitmap should be zero
--icon --index=4 --width=48 --height=48 --bit-depth=8 --palette-size=256
folder.ico: clr_important field in bitmap should be zero
--icon --index=5 --width=32 --height=32 --bit-depth=8 --palette-size=256
folder.ico: clr_important field in bitmap should be zero
--icon --index=6 --width=16 --height=16 --bit-depth=8 --palette-size=256
--icon --index=7 --width=256 --height=256 --bit-depth=32 --palette-size=0
--icon --index=8 --width=48 --height=48 --bit-depth=32 --palette-size=0
--icon --index=9 --width=32 --height=32 --bit-depth=32 --palette-size=0
--icon --index=10 --width=16 --height=16 --bit-depth=32 --palette-size=0
no success (my knowledge fails) getting something usefull from extresso command (dumps what is probably hex graphic info to CLI)
Is there something special with W10 ico files???
Attaching zip file with ico files

CC: (none) => herman.viaene

Comment 2 Herman Viaene 2017-01-09 11:35:33 CET
Created attachment 8848 [details]
ico files from Win10
Comment 3 David Walser 2017-01-09 16:26:19 CET
CVE assigned:
http://openwall.com/lists/oss-security/2017/01/08/5

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

Updated icoutils package fixes security vulnerability:

An integer overflow on 64-bit systems in the wrestool utility in icoutils can
cause a crash (CVE-2017-5208).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5208
http://openwall.com/lists/oss-security/2017/01/08/5

Summary: icoutils new security issue in wrestool => icoutils new security issue in wrestool (CVE-2017-5208)

Comment 4 David Walser 2017-01-09 23:28:27 CET
Debian has issued an advisory for this today (January 9):
https://www.debian.org/security/2017/dsa-3756

URL: (none) => https://lwn.net/Vulnerabilities/711047/

Comment 5 David Walser 2017-01-10 15:23:02 CET
Additional fixes in 0.31.1, freeze push requested:
http://openwall.com/lists/oss-security/2017/01/10/4

Whiteboard: (none) => feedback

Comment 6 David Walser 2017-01-10 22:21:07 CET
Updated packages in core/updates_testing:
========================
icoutils-0.31.1-1.mga5

from icoutils-0.31.1-1.mga5.src.rpm

Whiteboard: feedback => (none)

Comment 7 David Walser 2017-01-11 11:49:37 CET
More CVEs assigned:
http://openwall.com/lists/oss-security/2017/01/11/3

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

Updated icoutils package fixes security vulnerability:

Multiple programming errors in the wrestool tool of the icoutils suite allows
denial of service or the execution of arbitrary code if a malformed binary is
parsed (CVE-2017-5208, CVE-2017-5331, CVE-2017-5332, CVE-2017-5333).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5208
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5331
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5332
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5333
http://openwall.com/lists/oss-security/2017/01/08/5
http://openwall.com/lists/oss-security/2017/01/11/3
https://www.debian.org/security/2017/dsa-3756

Summary: icoutils new security issue in wrestool (CVE-2017-5208) => icoutils new security issues in wrestool (CVE-2017-5208, CVE-2017-533[1-3])

Comment 8 Herman Viaene 2017-01-11 13:40:47 CET
Tried new version, same output as per Comment 1
Comment 9 David Walser 2017-01-15 00:15:08 CET
(In reply to David Walser from comment #7)
> More CVEs assigned:
> http://openwall.com/lists/oss-security/2017/01/11/3

Debian has issued an advisory for this today (January 14):
https://www.debian.org/security/2017/dsa-3765
Comment 10 David Walser 2017-01-16 18:50:38 CET
(In reply to David Walser from comment #9)
> (In reply to David Walser from comment #7)
> > More CVEs assigned:
> > http://openwall.com/lists/oss-security/2017/01/11/3
> 
> Debian has issued an advisory for this today (January 14):
> https://www.debian.org/security/2017/dsa-3765

LWN reference:
https://lwn.net/Vulnerabilities/711775/
Dave Hodgins 2017-02-03 00:27:55 CET

Whiteboard: (none) => advisory
CC: (none) => davidwhodgins

Comment 11 Lewis Smith 2017-02-07 10:54:38 CET
Testing M5_64

I too wasted time finding .ico files in a Win 8.1 system, and trying 'wrestool' on them with various options -l|x -t icon|--type=+icon. Everything ended in
 "wrestool: <pathname> premature end"
You can manipulate such icon files directly - no need for wrestool:

"The icoutils are a set of program for extracting and converting bitmaps from Microsoft Windows icon and cursor files. These files usually have the extension .ico or .cur, but they can also be embedded in executables and libraries (.dll-files). (Such embedded files are referred to as resources.)"

I tried finding a DLL with emebedded .ico files; a mug's game.

Back to the beginning: look at the refs:
 http://openwall.com/lists/oss-security/2017/01/08/5 ->
  https://bugs.debian.org/850017
"Calling ``wrestool -x [filename]`` with the attached file makes an exploitable crash."
Downloaded the attachment crash.zip which contains (+ a core file) 'crashfile' which I shall attach to this bug.

BEFORE this update: icoutils-0.31.0-4.mga5
 $ wrestool -x ./crashfile 
 Segmentation fault

AFTER the update: icoutils-0.31.1-1.mga5
 $ wrestool -x ./crashfile 
 wrestool: ./crashfile: premature end
which is OK for me. @Herman: like to have another go?

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

Comment 12 Lewis Smith 2017-02-07 10:59:10 CET
Created attachment 8941 [details]
A PoC for the bug

Run this with wrestool:
 $ wrestool -x ./crashfile 
It gives a Segmentation fault before the update; "premature end" after (in my case).
Comment 13 Herman Viaene 2017-02-07 11:08:30 CET
@ Lewis
I am not very willing to spend more time on this. These tools might be useful for some people willing to search and delve into the usage of these progs. The messages I get are not very helpful to say the least. As long as they don't crash or corrupt anything else, I would let them go.
Comment 14 Lewis Smith 2017-02-07 13:18:32 CET
> I am not very willing to spend more time on this. These tools might be
> useful for some people willing to search and delve into the usage of these
> progs. The messages I get are not very helpful to say the least. As long as
> they don't crash or corrupt anything else, I would let them go.
OK. I simply wondered whether you might be tempted by the simplicity of the POC test at the end of my Comment 11.
Never mind. I am validating this anyway. Grateful as always for your contribution.

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

Comment 15 Mageia Robot 2017-02-07 14:35:27 CET
An update for this issue has been pushed to the Mageia Updates repository.

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

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


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