Bug 1050119 - (CVE-2017-11528) VUL-2: CVE-2017-11528: GraphicsMagick, ImageMagick: ReadDIBImage in coders/dib.c allows remote attackers to cause DoS
(CVE-2017-11528)
VUL-2: CVE-2017-11528: GraphicsMagick, ImageMagick: ReadDIBImage in coders/di...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P4 - Low : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/189006/
CVSSv2:SUSE:CVE-2017-11528:5.0:(AV:N/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-24 09:50 UTC by Johannes Segitz
Modified: 2018-05-18 15:32 UTC (History)
2 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Reproducer (40 bytes, image/x-dib)
2017-07-24 09:50 UTC, Johannes Segitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Segitz 2017-07-24 09:50:26 UTC
Created attachment 733486 [details]
Reproducer

CVE-2017-11528

The ReadDIBImage function in coders/dib.c in ImageMagick before 6.9.9-0 and 7.x
before 7.0.6-1 allows remote attackers to cause a denial of service (memory
leak) via a crafted file.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11528
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867811
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11528
https://github.com/ImageMagick/ImageMagick/issues/522
Comment 1 Marcus Meissner 2017-09-28 09:41:01 UTC
dib colormap. limited to a certain amount (2^16 * sizeof(small entry))
deferable
Comment 2 Petr Gajdos 2018-02-21 12:29:15 UTC
BEFORE

12/ImageMagick

$ valgrind -q --leak-check=full identify memory-leak-ReadDIBImage
identify: insufficient image data in file `memory-leak-ReadDIBImage' @ error/dib.c/ReadDIBImage/634.
==19930== 8 bytes in 1 blocks are definitely lost in loss record 2 of 10
==19930==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==19930==    by 0x841A7CC: ???
==19930==    by 0x4EBFE3A: ReadImage (constitute.c:601)
==19930==    by 0x4FD16B8: ReadStream (stream.c:974)
==19930==    by 0x4EBF980: PingImage (constitute.c:278)
==19930==    by 0x4EBFBBA: PingImages (constitute.c:373)
==19930==    by 0x535850B: IdentifyImageCommand (identify.c:322)
==19930==    by 0x5385C52: MagickCommandGenesis (mogrify.c:166)
==19930==    by 0x400891: IdentifyMain (identify.c:80)
==19930==    by 0x400891: main (identify.c:93)
==19930== 
$
[leak reproduced]

11/ImageMagick

$ valgrind -q --leak-check=full identify memory-leak-ReadDIBImage
identify: Insufficient image data in file `memory-leak-ReadDIBImage'.
==19938== 
==19938== 8 bytes in 1 blocks are definitely lost in loss record 1 of 2
==19938==    at 0x4C256AE: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==19938==    by 0x9F08F63: ???
==19938==    by 0x4E94D87: ReadImage (constitute.c:441)
==19938==    by 0x52D0C14: IdentifyImageCommand (identify.c:297)
==19938==    by 0x400DA7: main (identify.c:101)
$
[leak reproduced]

11/GraphicsMagick
$ valgrind -q --leak-check=full gm identify memory-leak-ReadDIBImage
==19952== Use of uninitialised value of size 8
==19952==    at 0x8028DEB: ReadDIBImage (dib.c:655)
==19952==    by 0x4EA01CC: ReadImage (constitute.c:6000)
==19952==    by 0x4EFC39D: ReadStream (pixel_cache.c:3653)
==19952==    by 0x4EA0FA8: PingImage (constitute.c:5770)
==19952==    by 0x4E86A87: IdentifyImageCommand (command.c:7204)
==19952==    by 0x4E73683: MagickCommand (command.c:7657)
==19952==    by 0x4E737FE: GMCommand (command.c:15277)
==19952==    by 0x76E2585: (below main) (in /lib64/libc-2.9.so)
==19952== 
==19952== Use of uninitialised value of size 8
==19952==    at 0x8028E43: ReadDIBImage (dib.c:665)
==19952==    by 0x4EA01CC: ReadImage (constitute.c:6000)
==19952==    by 0x4EFC39D: ReadStream (pixel_cache.c:3653)
==19952==    by 0x4EA0FA8: PingImage (constitute.c:5770)
==19952==    by 0x4E86A87: IdentifyImageCommand (command.c:7204)
==19952==    by 0x4E73683: MagickCommand (command.c:7657)
==19952==    by 0x4E737FE: GMCommand (command.c:15277)
==19952==    by 0x76E2585: (below main) (in /lib64/libc-2.9.so)
gm identify: Unexpected end-of-file (memory-leak-ReadDIBImage).
$
[no leak observed]

42.3/GraphicsMagick

$ valgrind -q --leak-check=full gm identify memory-leak-ReadDIBImage
gm identify: Unexpected end-of-file (memory-leak-ReadDIBImage).
gm identify: Request did not return an image.
$
[no issue observed]

PATCH

https://github.com/ImageMagick/ImageMagick/commit/e5b294754697d9e261224ad4f6e8eeee9e04275f

12,11/ImageMagick: code affected
42.3/GraphicsMagick: frees correctly
11/GraphicsMagick: missing the check completely, will add the check together with the free

AFTER

12/ImageMagick

$ valgrind -q --leak-check=full identify memory-leak-ReadDIBImage
identify: insufficient image data in file `memory-leak-ReadDIBImage' @ error/dib.c/ReadDIBImage/636.
$
[leak vanished]

11/ImageMagick

$ valgrind -q --leak-check=full identify memory-leak-ReadDIBImage
identify: Insufficient image data in file `memory-leak-ReadDIBImage'.
$
[leak vanished]

11/GraphicsMagick

$ valgrind -q --leak-check=full gm identify memory-leak-ReadDIBImage
gm identify: Unexpected end-of-file (memory-leak-ReadDIBImage).
$
[use of uninitialized memory vanished]
Comment 3 Petr Gajdos 2018-02-21 12:30:07 UTC
Will submit for 12/ImageMagick, 11/ImageMagick and 11/GraphicsMagick.
Comment 4 Petr Gajdos 2018-02-21 13:39:55 UTC
I believe all fixed.
Comment 6 Swamp Workflow Management 2018-03-01 20:15:41 UTC
SUSE-SU-2018:0581-1: An update that fixes 35 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1042824,1042911,1048110,1048272,1049374,1049375,1050048,1050119,1050122,1050126,1050132,1050617,1052207,1052248,1052251,1052254,1052472,1052688,1052711,1052747,1052750,1052754,1052761,1055069,1055229,1056768,1057163,1058009,1072898,1074119,1074170,1075821,1076182,1078433
CVE References: CVE-2017-11166,CVE-2017-11170,CVE-2017-11448,CVE-2017-11450,CVE-2017-11528,CVE-2017-11530,CVE-2017-11531,CVE-2017-11533,CVE-2017-11537,CVE-2017-11638,CVE-2017-11642,CVE-2017-12418,CVE-2017-12427,CVE-2017-12429,CVE-2017-12432,CVE-2017-12566,CVE-2017-12654,CVE-2017-12663,CVE-2017-12664,CVE-2017-12665,CVE-2017-12668,CVE-2017-12674,CVE-2017-13058,CVE-2017-13131,CVE-2017-14060,CVE-2017-14139,CVE-2017-14224,CVE-2017-17682,CVE-2017-17885,CVE-2017-17934,CVE-2017-18028,CVE-2017-9405,CVE-2017-9407,CVE-2018-5357,CVE-2018-6405
Sources used:
SUSE Linux Enterprise Workstation Extension 12-SP3 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Workstation Extension 12-SP2 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Software Development Kit 12-SP2 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Server 12-SP3 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Server 12-SP2 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    ImageMagick-6.8.8.1-71.42.1
SUSE Linux Enterprise Desktop 12-SP2 (src):    ImageMagick-6.8.8.1-71.42.1
Comment 9 Swamp Workflow Management 2018-03-06 23:14:29 UTC
openSUSE-SU-2018:0621-1: An update that fixes 35 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1042824,1042911,1048110,1048272,1049374,1049375,1050048,1050119,1050122,1050126,1050132,1050617,1052207,1052248,1052251,1052254,1052472,1052688,1052711,1052747,1052750,1052754,1052761,1055069,1055229,1056768,1057163,1058009,1072898,1074119,1074170,1075821,1076182,1078433
CVE References: CVE-2017-11166,CVE-2017-11170,CVE-2017-11448,CVE-2017-11450,CVE-2017-11528,CVE-2017-11530,CVE-2017-11531,CVE-2017-11533,CVE-2017-11537,CVE-2017-11638,CVE-2017-11642,CVE-2017-12418,CVE-2017-12427,CVE-2017-12429,CVE-2017-12432,CVE-2017-12566,CVE-2017-12654,CVE-2017-12663,CVE-2017-12664,CVE-2017-12665,CVE-2017-12668,CVE-2017-12674,CVE-2017-13058,CVE-2017-13131,CVE-2017-14060,CVE-2017-14139,CVE-2017-14224,CVE-2017-17682,CVE-2017-17885,CVE-2017-17934,CVE-2017-18028,CVE-2017-9405,CVE-2017-9407,CVE-2018-5357,CVE-2018-6405
Sources used:
openSUSE Leap 42.3 (src):    ImageMagick-6.8.8.1-55.1
Comment 11 Swamp Workflow Management 2018-03-14 20:08:40 UTC
SUSE-SU-2018:0672-1: An update that fixes 6 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1042911,1050119,1050132,1052754,1072898,1077737
CVE References: CVE-2017-11528,CVE-2017-11533,CVE-2017-12663,CVE-2017-17500,CVE-2017-17682,CVE-2017-9405
Sources used:
SUSE Studio Onsite 1.3 (src):    GraphicsMagick-1.2.5-4.78.41.1
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    GraphicsMagick-1.2.5-4.78.41.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    GraphicsMagick-1.2.5-4.78.41.1
Comment 12 Swamp Workflow Management 2018-03-22 11:10:19 UTC
SUSE-SU-2018:0770-1: An update that fixes 6 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1042911,1050119,1050122,1050132,1052754,1072898
CVE References: CVE-2017-11528,CVE-2017-11530,CVE-2017-11533,CVE-2017-12663,CVE-2017-17682,CVE-2017-9405
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.37.1
SUSE Linux Enterprise Server 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.37.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.37.1
Comment 13 Marcus Meissner 2018-05-18 15:32:19 UTC
released