Bug 1055855 - (CVE-2017-13658) VUL-2: CVE-2017-13658: GraphicsMagick, ImageMagick: A missing NULL check in the ReadMATImage function in coders/mat.c could leading to a denial of service
(CVE-2017-13658)
VUL-2: CVE-2017-13658: GraphicsMagick, ImageMagick: A missing NULL check in t...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/191007/
CVSSv3:SUSE:CVE-2017-13658:5.3:(AV:N/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-28 07:17 UTC by Alexander Bergmann
Modified: 2018-02-12 08:29 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Bergmann 2017-08-28 07:17:17 UTC
CVE-2017-13658

Current Description

In ImageMagick before 6.9.9-3 and 7.x before 7.0.6-3, there is a missing NULL check in the ReadMATImage function in coders/mat.c, leading to a denial of service (assertion failure and application exit) in the DestroyImageInfo function in MagickCore/image.c.

Upstream issue:
https://github.com/ImageMagick/ImageMagick/issues/598

Upstream fix:
https://github.com/ImageMagick/ImageMagick/commit/e5c063a1007506ba69e97a35effcdef944421c89

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-13658
http://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-13658.html
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-13658
Comment 1 Marcus Meissner 2017-09-29 08:10:07 UTC
controlled abort. deferable.
Comment 2 Petr Gajdos 2018-01-08 08:45:39 UTC
12/ImageMagick

BEFORE

$ valgrind -q --leak-check=full identify assertion_failed_in_DestroyImageInfo_2
identify: improper image header `assertion_failed_in_DestroyImageInfo_2' @ error/mat.c/ReadMATImage/686.
==18183== 26,216 (16,792 direct, 9,424 indirect) bytes in 1 blocks are definitely lost in loss record 15 of 15
==18183==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18183==    by 0x4F48E1F: AcquireImageInfo (image.c:334)
==18183==    by 0x4F4AB3D: CloneImageInfo (image.c:936)
==18183==    by 0x8418267: ???
==18183==    by 0x4EBFE1A: ReadImage (constitute.c:601)
==18183==    by 0x4FD1658: ReadStream (stream.c:974)
==18183==    by 0x4EBF960: PingImage (constitute.c:278)
==18183==    by 0x4EBFB9A: PingImages (constitute.c:373)
==18183==    by 0x535850B: IdentifyImageCommand (identify.c:322)
==18183==    by 0x5385C52: MagickCommandGenesis (mogrify.c:166)
==18183==    by 0x400891: IdentifyMain (identify.c:80)
==18183==    by 0x400891: main (identify.c:93)
==18183== 
$

AFTER

$ valgrind -q --leak-check=full identify assertion_failed_in_DestroyImageInfo_2
identify: improper image header `assertion_failed_in_DestroyImageInfo_2' @ error/mat.c/ReadMATImage/948.
$

Assertion is not reproducible but a leak is fixed.
Comment 4 Petr Gajdos 2018-01-08 11:07:30 UTC
11/ImageMagick

BEFORE

$ valgrind -q --leak-check=full identify assertion_failed_in_DestroyImageInfo_2
identify: no decode delegate for this image format `assertion_failed_in_DestroyImageInfo_2'.
$

AFTER

$ valgrind -q --leak-check=full identify assertion_failed_in_DestroyImageInfo_2
identify: no decode delegate for this image format `assertion_failed_in_DestroyImageInfo_2'.
$

Not reproducible with the testcase. Because I am about to update mat.c (almost) to the state of 6.9.9-31, I believe the fix is in if applicable.
Comment 6 Petr Gajdos 2018-01-08 14:53:56 UTC
HG/GraphicsMagick

$ valgrind -q --leak-check=full gm identify assertion_failed_in_DestroyImageInfo_2
gm identify: Improper image header (assertion_failed_in_DestroyImageInfo_2).
gm identify: Request did not return an image.
$

42.2/GraphicsMagick

$ valgrind -q --leak-check=full gm identify assertion_failed_in_DestroyImageInfo_2
gm identify: Improper image header (assertion_failed_in_DestroyImageInfo_2).
gm identify: Request did not return an image.
$

11/GraphicsMagick

$ valgrind -q --leak-check=full gm identify assertion_failed_in_DestroyImageInfo_2
gm identify: No decode delegate for this image format (assertion_failed_in_DestroyImageInfo_2).
$

11/GraphicsMagick: no clone_info
42.x/GraphicsMagick: clone_info freed via ThrowMATReaderException
HG/GraphicsMagick: clone_info freed via Throw*MATReaderException
Comment 7 Petr Gajdos 2018-01-08 14:54:15 UTC
Will submit for 12/ImageMagick and 11/ImageMagick.
Comment 8 Petr Gajdos 2018-01-08 15:26:50 UTC
I believe all fixed.
Comment 10 Swamp Workflow Management 2018-01-18 14:09:48 UTC
SUSE-SU-2018:0130-1: An update that fixes 21 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1047044,1047898,1050120,1050606,1051446,1052468,1052550,1052710,1052720,1052731,1052732,1055065,1055323,1055434,1055855,1058640,1059751,1074123,1074969,1074973,1074975
CVE References: CVE-2017-10800,CVE-2017-11141,CVE-2017-11529,CVE-2017-11644,CVE-2017-11724,CVE-2017-12434,CVE-2017-12564,CVE-2017-12667,CVE-2017-12670,CVE-2017-12672,CVE-2017-12675,CVE-2017-13060,CVE-2017-13146,CVE-2017-13648,CVE-2017-13658,CVE-2017-14326,CVE-2017-14533,CVE-2017-17881,CVE-2017-18022,CVE-2018-5246,CVE-2018-5247
Sources used:
SUSE Linux Enterprise Workstation Extension 12-SP3 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Workstation Extension 12-SP2 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Software Development Kit 12-SP2 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Server 12-SP3 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Server 12-SP2 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    ImageMagick-6.8.8.1-71.26.1
SUSE Linux Enterprise Desktop 12-SP2 (src):    ImageMagick-6.8.8.1-71.26.1
Comment 11 Swamp Workflow Management 2018-01-18 14:14:46 UTC
SUSE-SU-2018:0132-1: An update that fixes 31 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1042948,1047044,1047898,1049373,1050120,1050606,1051412,1051446,1052252,1052468,1052550,1052710,1052720,1052731,1052732,1052771,1055065,1055323,1055434,1055855,1058082,1058640,1059751,1072902,1074122,1074123,1074425,1074610,1074969,1074973,1074975
CVE References: CVE-2017-1000445,CVE-2017-1000476,CVE-2017-10800,CVE-2017-11141,CVE-2017-11449,CVE-2017-11529,CVE-2017-11644,CVE-2017-11724,CVE-2017-11751,CVE-2017-12430,CVE-2017-12434,CVE-2017-12564,CVE-2017-12642,CVE-2017-12667,CVE-2017-12670,CVE-2017-12672,CVE-2017-12675,CVE-2017-13060,CVE-2017-13146,CVE-2017-13648,CVE-2017-13658,CVE-2017-14249,CVE-2017-14326,CVE-2017-14533,CVE-2017-17680,CVE-2017-17881,CVE-2017-17882,CVE-2017-18022,CVE-2017-9409,CVE-2018-5246,CVE-2018-5247
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.22.1
SUSE Linux Enterprise Server 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.22.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    ImageMagick-6.4.3.6-7.78.22.1
Comment 12 Swamp Workflow Management 2018-01-20 17:14:03 UTC
openSUSE-SU-2018:0155-1: An update that fixes 21 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1047044,1047898,1050120,1050606,1051446,1052468,1052550,1052710,1052720,1052731,1052732,1055065,1055323,1055434,1055855,1058640,1059751,1074123,1074969,1074973,1074975
CVE References: CVE-2017-10800,CVE-2017-11141,CVE-2017-11529,CVE-2017-11644,CVE-2017-11724,CVE-2017-12434,CVE-2017-12564,CVE-2017-12667,CVE-2017-12670,CVE-2017-12672,CVE-2017-12675,CVE-2017-13060,CVE-2017-13146,CVE-2017-13648,CVE-2017-13658,CVE-2017-14326,CVE-2017-14533,CVE-2017-17881,CVE-2017-18022,CVE-2018-5246,CVE-2018-5247
Sources used:
openSUSE Leap 42.3 (src):    ImageMagick-6.8.8.1-49.1
openSUSE Leap 42.2 (src):    ImageMagick-6.8.8.1-30.21.1
Comment 13 Marcus Meissner 2018-02-12 08:29:44 UTC
reelased