Bug 1036988 - (CVE-2017-8353) VUL-1: CVE-2017-8353: ImageMagick, GraphicsMagick: denial of service (memory leak) via a crafted file (ReadPICTImage func in pict.c)
(CVE-2017-8353)
VUL-1: CVE-2017-8353: ImageMagick, GraphicsMagick: denial of service (memory ...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: unspecified
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/184619/
CVSSv2:SUSE:CVE-2017-8353:4.3:(AV:N/A...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-30 20:38 UTC by Mikhail Kasimov
Modified: 2019-05-01 13:46 UTC (History)
2 users (show)

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


Attachments
CVE-2017-8353_memory-leak-in-ReadPICTImage-16_testcase (14.49 KB, image/x-pict)
2017-04-30 20:38 UTC, Mikhail Kasimov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kasimov 2017-04-30 20:38:48 UTC
Created attachment 723262 [details]
CVE-2017-8353_memory-leak-in-ReadPICTImage-16_testcase

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

In ImageMagick 7.0.5-5, the ReadPICTImage function in pict.c allows attackers to cause a denial of service (memory leak) via a crafted file.

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

Hyperlink

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

[2] Testcase: https://github.com/bestshow/p0cs/blob/master/memory-leak-in-ReadPICTImage-16.pict

[3] https://github.com/ImageMagick/ImageMagick/commit/a537c728561b7eedb17ee50c615e11dec005213a (master)

[4] https://github.com/ImageMagick/ImageMagick/commit/d41fb52eb5b30e70cdc85ab6649ccac000924511 (ImageMagick-6)


(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 Johannes Segitz 2017-05-02 10:52:24 UTC
GraphicsMagick isn't directly affected because some checks are missing. But some of the checks looks like we might want to backport, e.g.
https://github.com/ImageMagick/ImageMagick/commit/d41fb52eb5b30e70cdc85ab6649ccac000924511
line 1275
if (p > (pixels+extent+3*image->columns))
Comment 2 Petr Gajdos 2017-05-12 10:02:55 UTC
(In reply to Johannes Segitz from comment #1)
> GraphicsMagick isn't directly affected because some checks are missing. But
> some of the checks looks like we might want to backport, e.g.
> https://github.com/ImageMagick/ImageMagick/commit/
> d41fb52eb5b30e70cdc85ab6649ccac000924511

Yeah, but it it is not subject of this bug.
Comment 3 Petr Gajdos 2017-05-15 12:35:52 UTC
For 12/ImageMagick I get:

BEFORE

$ valgrind --leak-check=full identify memory-leak-in-ReadPICTImage-16.pict
[..]
==9225== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
$

I get also one relevant (CloneImage()) leak error for all others. 42.2/GraphicsMagick has that partially fixed.


For ImageMagick,

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

is required too. For GraphicsMagick, there are plenty of commits to mitigate source leaks.

AFTER

$ valgrind --leak-check=full identify memory-leak-in-ReadPICTImage-16.pict
[..]
==9296== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
$

Affected: all versions of ImageMagick and GraphicsMagick
Comment 4 Petr Gajdos 2017-05-17 15:12:56 UTC
I believe all fixed.
Comment 6 Bernhard Wiedemann 2017-05-17 16:03:58 UTC
This is an autogenerated message for OBS integration:
This bug (1036988) was mentioned in
https://build.opensuse.org/request/show/495650 42.2 / GraphicsMagick
Comment 8 Swamp Workflow Management 2017-05-26 10:09:12 UTC
openSUSE-SU-2017:1413-1: An update that fixes four vulnerabilities is now available.

Category: security (moderate)
Bug References: 1036985,1036986,1036988,1036990
CVE References: CVE-2017-8350,CVE-2017-8351,CVE-2017-8353,CVE-2017-8355
Sources used:
openSUSE Leap 42.2 (src):    GraphicsMagick-1.3.25-11.6.1
Comment 11 Swamp Workflow Management 2017-06-06 16:13:29 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 13 Swamp Workflow Management 2017-06-14 13:13:20 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 14 Swamp Workflow Management 2017-06-19 10:12:12 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 15 Swamp Workflow Management 2017-06-19 13:11:31 UTC
SUSE-SU-2017:1600-1: An update that fixes 17 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1033091,1034876,1036978,1036980,1036981,1036984,1036985,1036986,1036987,1036988,1036990,1037527,1038000,1040025,1040304,1040332,984144
CVE References: CVE-2014-9847,CVE-2017-7606,CVE-2017-7941,CVE-2017-8344,CVE-2017-8345,CVE-2017-8346,CVE-2017-8349,CVE-2017-8350,CVE-2017-8351,CVE-2017-8352,CVE-2017-8353,CVE-2017-8355,CVE-2017-8765,CVE-2017-8830,CVE-2017-9098,CVE-2017-9142,CVE-2017-9144
Sources used:
SUSE Studio Onsite 1.3 (src):    GraphicsMagick-1.2.5-4.77.1
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    GraphicsMagick-1.2.5-4.77.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    GraphicsMagick-1.2.5-4.77.1
Comment 16 Marcus Meissner 2017-06-20 08:03:47 UTC
released
Comment 17 Petr Gajdos 2017-08-09 10:22:40 UTC
GraphicsMagick default branch at 15108:19f1771574cc seem to have this issue.
Comment 18 Petr Gajdos 2017-08-11 13:14:02 UTC
Upstream applied the fix.
Comment 19 Petr Gajdos 2018-04-24 08:45:34 UTC
Security team, please note that this bug was reported as bug 1055010 for GraphicsMagick. Therefore, I will remove this bug and CVE from GraphicsMagick changelog.
Comment 20 Marcus Meissner 2018-05-11 10:14:33 UTC
done