Bug 1034870 - (CVE-2017-7943) VUL-1: CVE-2017-7943: ImageMagick: remote attack to consume an amount of available memory via a crafted file (ReadSVGImage function in svg.c)
(CVE-2017-7943)
VUL-1: CVE-2017-7943: ImageMagick: remote attack to consume an amount of avai...
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
CVSSv2:SUSE:CVE-2017-7943:2.6:(AV:N/A...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-19 08:47 UTC by Mikhail Kasimov
Modified: 2017-06-21 22:35 UTC (History)
3 users (show)

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


Attachments
memory-leak-in-svg_CVE-2017-7943_testcase (31.70 KB, image/svg+xml)
2017-04-19 08:47 UTC, Mikhail Kasimov
Details
memory-leak-in-svg.svg (137 bytes, text/plain)
2017-06-01 14:51 UTC, Marcus Meissner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kasimov 2017-04-19 08:47:08 UTC
Created attachment 721715 [details]
memory-leak-in-svg_CVE-2017-7943_testcase

Ref: https://nvd.nist.gov/vuln/detail/CVE-2017-7943
========================================================
Description

The ReadSVGImage function in svg.c in ImageMagick 7.0.5-4 allows remote attackers to consume an amount of available memory via a crafted file.

Source:  MITRE      Last Modified:  04/18/2017
========================================================

Hyperlink

[1] https://github.com/ImageMagick/ImageMagick/issues/427

[1]:
====================================================================
testcase:
https://github.com/bestshow/p0cs/blob/master/memory-leak-in-svg.svg


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

https://github.com/ImageMagick/ImageMagick/commit/2e3410d0a07c3e30a42c9626c00e180870907a6b
====================================================================


(open-)SUSE:

https://software.opensuse.org/package/ImageMagick

7.0.5.4 (TW, official repo)
6.8.8.1 (42.{1,2}, official repo)
Comment 1 Marcus Meissner 2017-04-19 11:58:10 UTC
IM on SLE11 and SLE12 affected

GM on SLE11 has no error exit path, assuming not affected.
Comment 2 Petr Gajdos 2017-04-24 13:47:13 UTC
Tried to reproduce with valgrind --leak-check=full, there is 24 errors, none of these is fixed by the patch, though.
Comment 3 Petr Gajdos 2017-04-25 06:14:09 UTC
(Tested with 7.0.5-4 .)
Comment 4 Petr Gajdos 2017-04-25 06:45:34 UTC
But the change seem to be apparent: memory holded by svg_info allocated on line coders/svg.c:3109 needs to be freed in case the ReadSVGImage() is aborted prematurely.
Comment 5 Petr Gajdos 2017-04-25 07:35:01 UTC
Affected: 11/ImageMagick, 12/ImageMagick
Comment 6 Petr Gajdos 2017-04-25 15:00:56 UTC
Packages submitted.
Comment 11 Marcus Meissner 2017-06-01 14:51:43 UTC
Created attachment 727346 [details]
memory-leak-in-svg.svg

actual svg. (previous one was the github download page I think)
Comment 12 Marcus Meissner 2017-06-01 14:57:24 UTC
this still reports "no decode delegate" for me though.

After some review I think the buggy codepath is only in the non-srvg builting svg implementation, so it will not get triggered, as we use librsvg.
Comment 13 Swamp Workflow Management 2017-06-06 16:11:33 UTC
SUSE-SU-2017:1489-1: An update that fixes 27 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1028075,1033091,1034870,1034872,1034876,1036976,1036977,1036978,1036980,1036981,1036982,1036983,1036984,1036985,1036986,1036987,1036988,1036989,1036990,1036991,1037527,1038000,1040025,1040303,1040304,1040306,1040332
CVE References: CVE-2017-6502,CVE-2017-7606,CVE-2017-7941,CVE-2017-7942,CVE-2017-7943,CVE-2017-8343,CVE-2017-8344,CVE-2017-8345,CVE-2017-8346,CVE-2017-8347,CVE-2017-8348,CVE-2017-8349,CVE-2017-8350,CVE-2017-8351,CVE-2017-8352,CVE-2017-8353,CVE-2017-8354,CVE-2017-8355,CVE-2017-8356,CVE-2017-8357,CVE-2017-8765,CVE-2017-8830,CVE-2017-9098,CVE-2017-9141,CVE-2017-9142,CVE-2017-9143,CVE-2017-9144
Sources used:
SUSE Linux Enterprise Workstation Extension 12-SP2 (src):    ImageMagick-6.8.8.1-70.1
SUSE Linux Enterprise Software Development Kit 12-SP2 (src):    ImageMagick-6.8.8.1-70.1
SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src):    ImageMagick-6.8.8.1-70.1
SUSE Linux Enterprise Server 12-SP2 (src):    ImageMagick-6.8.8.1-70.1
SUSE Linux Enterprise Desktop 12-SP2 (src):    ImageMagick-6.8.8.1-70.1
Comment 14 Swamp Workflow Management 2017-06-14 13:11:08 UTC
openSUSE-SU-2017:1560-1: An update that fixes 27 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1028075,1033091,1034870,1034872,1034876,1036976,1036977,1036978,1036980,1036981,1036982,1036983,1036984,1036985,1036986,1036987,1036988,1036989,1036990,1036991,1037527,1038000,1040025,1040303,1040304,1040306,1040332
CVE References: CVE-2017-6502,CVE-2017-7606,CVE-2017-7941,CVE-2017-7942,CVE-2017-7943,CVE-2017-8343,CVE-2017-8344,CVE-2017-8345,CVE-2017-8346,CVE-2017-8347,CVE-2017-8348,CVE-2017-8349,CVE-2017-8350,CVE-2017-8351,CVE-2017-8352,CVE-2017-8353,CVE-2017-8354,CVE-2017-8355,CVE-2017-8356,CVE-2017-8357,CVE-2017-8765,CVE-2017-8830,CVE-2017-9098,CVE-2017-9141,CVE-2017-9142,CVE-2017-9143,CVE-2017-9144
Sources used:
openSUSE Leap 42.2 (src):    ImageMagick-6.8.8.1-30.3.1
Comment 15 Swamp Workflow Management 2017-06-19 10:10:45 UTC
SUSE-SU-2017:1599-1: An update that fixes 25 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1033091,1034870,1034872,1034876,1036976,1036978,1036980,1036981,1036983,1036984,1036985,1036986,1036987,1036988,1036989,1036990,1037527,1038000,1040025,1040303,1040304,1040306,1040332
CVE References: CVE-2014-9846,CVE-2016-10050,CVE-2017-7606,CVE-2017-7941,CVE-2017-7942,CVE-2017-7943,CVE-2017-8344,CVE-2017-8345,CVE-2017-8346,CVE-2017-8348,CVE-2017-8349,CVE-2017-8350,CVE-2017-8351,CVE-2017-8352,CVE-2017-8353,CVE-2017-8354,CVE-2017-8355,CVE-2017-8357,CVE-2017-8765,CVE-2017-8830,CVE-2017-9098,CVE-2017-9141,CVE-2017-9142,CVE-2017-9143,CVE-2017-9144
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    ImageMagick-6.4.3.6-7.77.1
SUSE Linux Enterprise Server 11-SP4 (src):    ImageMagick-6.4.3.6-7.77.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    ImageMagick-6.4.3.6-7.77.1
Comment 16 Marcus Meissner 2017-06-20 07:21:51 UTC
released