Bug 1379587 (CVE-2016-6823)

Summary: CVE-2016-6823 ImageMagick: Integer overflow within BMP encoder/writer
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, dmcphers, ethan, jhorak, jialiu, jokerman, kseifried, lmeyer, mmccomas, nmurray, pahan, slawomir, tiwillia
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-03 22:47:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1378790    
Bug Blocks: 1378785    

Description Andrej Nemec 2016-09-27 07:46:36 UTC
A vulnerability was found in ImageMagick. Converting a maliciously crafted image (e.g. PNM) into BMP format can trigger an integer overflow within the BMP coder, possibly leading to a heap-based buffer overflow.

Upstream fix:

https://github.com/ImageMagick/ImageMagick/commit/e7094d16cd8aee6bb48cf1d369f617f7edf89993
https://github.com/ImageMagick/ImageMagick/commit/4cc6ec8a4197d4c008577127736bf7985d632323

Debian bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834504

References:

http://seclists.org/oss-sec/2016/q3/611

Comment 1 Andrej Nemec 2016-09-27 07:51:54 UTC
Created ImageMagick tracking bugs for this issue:

Affects: fedora-all [bug 1378790]

Comment 2 Stefan Cornelius 2016-09-27 12:12:55 UTC
The POC actually causes an endless loop. We're probably missing some EOF checks in loops. Upstream seems to have tackled the loop problem in:

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

Additionally, the patch for the integer overflow does not really work for me. The compiler optimizes the check into nothing. Even if that's changed, it still does not seem to work properly.

Comment 3 Stefan Cornelius 2018-04-03 22:47:26 UTC
Statement:

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.