Bug 1050606 - (CVE-2017-11644) VUL-1: CVE-2017-11644: GraphicsMagick, ImageMagick: Memory Leak in ReadMATImage() in coders/mat.c
(CVE-2017-11644)
VUL-1: CVE-2017-11644: GraphicsMagick, ImageMagick: Memory Leak in ReadMATIma...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P4 - Low : Minor
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/189160/
CVSSv2:SUSE:CVE-2017-11644:5.0:(AV:N/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-26 08:59 UTC by Johannes Segitz
Modified: 2020-06-11 20:31 UTC (History)
2 users (show)

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


Attachments
Reproducer (352 bytes, text/plain)
2017-07-26 08:59 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-26 08:59:00 UTC
Created attachment 733869 [details]
Reproducer

CVE-2017-11644

When ImageMagick 7.0.6-1 processes a crafted file in convert, it can
lead to a Memory Leak in the ReadMATImage() function in coders/mat.c.

valgrind --leak-check=full --show-leak-kinds=all convert memory-leak_ReadMATImage /dev/null

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11644
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11644
Comment 1 Marcus Meissner 2017-09-28 10:10:44 UTC
https://github.com/ImageMagick/ImageMagick/issues/587

image sized memory leak.
Comment 3 Petr Gajdos 2018-01-08 08:45:37 UTC
12/ImageMagick

BEFORE

$ valgrind -q --leak-check=full convert memory-leak_ReadMATImage /dev/null
convert: no decode delegate for this image format `memory-leak_ReadMATImage' @ error/constitute.c/ReadImage/555.
convert: no images defined `/dev/null' @ error/convert.c/ConvertImageCommand/3149.
$

AFTER

$ valgrind -q --leak-check=full convert memory-leak_ReadMATImage /dev/null
convert: no decode delegate for this image format `memory-leak_ReadMATImage' @ error/constitute.c/ReadImage/555.
convert: no images defined `/dev/null' @ error/convert.c/ConvertImageCommand/3149.
$

Not reproducible. --show-leak-kinds=all is a bit unfair as 

$ valgrind -q --leak-check=full --show-leak-kinds=all convert

shows a lot of leaks too.
Comment 5 Petr Gajdos 2018-01-08 11:06:48 UTC
11/ImageMagick

BEFORE

$ valgrind -q --leak-check=full convert memory-leak_ReadMATImage /dev/null
convert: no decode delegate for this image format `memory-leak_ReadMATImage'.
convert: missing an image filename `/dev/null'.
$

AFTER

$ valgrind -q --leak-check=full convert memory-leak_ReadMATImage /dev/null
convert: no decode delegate for this image format `memory-leak_ReadMATImage'.
convert: missing an image filename `/dev/null'.
$

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 7 Petr Gajdos 2018-01-08 14:53:38 UTC
HG/GraphicsMagick

$ valgrind -q --leak-check=full gm convert memory-leak_ReadMATImage bleble.mat
gm convert: Unable to uncompress image (memory-leak_ReadMATImage).
$

42.x/GraphicsMagick

$ valgrind -q --leak-check=full gm convert memory-leak_ReadMATImage bleble.mat
gm convert: Unable to uncompress image (memory-leak_ReadMATImage).
$

11/GraphicsMagick

$ valgrind -q --leak-check=full gm convert memory-leak_ReadMATImage bleble.mat
gm convert: Request did not return an image.
$

Does not reproduce.

11/GraphicsMagick: no image2 and clone_info variables
42.x/GraphicsMagick: seem to free image2 correctly
HG/GraphicsMagick: seem to free image2 correctly
Comment 8 Petr Gajdos 2018-01-08 15:01:47 UTC
Will submit for 12/ImageMagick and 11/ImageMagick.
Comment 9 Petr Gajdos 2018-01-08 15:26:52 UTC
I believe all fixed.
Comment 11 Swamp Workflow Management 2018-01-18 14:08:09 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 12 Swamp Workflow Management 2018-01-18 14:12:30 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 13 Swamp Workflow Management 2018-01-20 17:12:26 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 14 Marcus Meissner 2018-02-09 14:41:47 UTC
released