Bug 1625429 (CVE-2018-16412)

Summary: CVE-2018-16412 ImageMagick: heap-based buffer over-read in the ParseImageResourceBlocks function in coders/psd.c
Product: [Other] Security Response Reporter: Laura Pardo <lpardo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: jhorak, mike, pahan, rschiron
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-09-18 12:56: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: 1625432    
Bug Blocks: 1625433    

Description Laura Pardo 2018-09-04 22:14:38 UTC
A flaw was found in ImageMagick 7.0.8-11 Q16 has a heap-based buffer over-read in the coders/psd.c ParseImageResourceBlocks function.


References:
https://github.com/ImageMagick/ImageMagick/issues/1250

Comment 1 Laura Pardo 2018-09-04 22:16:40 UTC
Created ImageMagick tracking bugs for this issue:

Affects: fedora-all [bug 1625432]

Comment 2 Riccardo Schirone 2018-09-18 12:01:05 UTC
Statement:

This issue did not affect the versions of ImageMagick as shipped with Red Hat Enterprise Linux 5, 6 and 7 as they did not include the vulnerable code.

Comment 4 Riccardo Schirone 2018-09-18 12:47:19 UTC
ParseImageResourceBlocks function in coders/psd.c does not check if the the read value plus the base `p` buffer may overflow. Thus a big `count` value can bypass the check and result in an out-of-bound read later on during the execution of the function.