Bug 1801661 (CVE-2019-16709)

Summary: CVE-2019-16709 ImageMagick: memory leak in coders/dps.c
Product: [Other] Security Response Reporter: Dhananjay Arunesh <darunesh>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: fedora, jhorak, mike, pahan, rschiron
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ImageMagick 7.0.8-36, ImageMagick 6.9.10-36 Doc Type: If docs needed, set a value
Doc Text:
A memory leak was discovered in ImageMagick in function ReadDPSImage. A long-running application that uses ImageMagick to parse DPS image may be vulnerable to this flaw and crash due to some memory that is never freed.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 22:36:03 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: 1801663, 1801664, 1812614    
Bug Blocks: 1801685    

Description Dhananjay Arunesh 2020-02-11 13:06:53 UTC
A vulnerability was found in ImageMagick 7.0.8-35 has a memory leak in coders/dps.c, as demonstrated by XCreateImage.

Reference:
https://github.com/ImageMagick/ImageMagick/issues/1531

Comment 1 Dhananjay Arunesh 2020-02-11 13:08:52 UTC
Created ImageMagick tracking bugs for this issue:

Affects: epel-8 [bug 1801664]
Affects: fedora-all [bug 1801663]

Comment 2 Michael Cronenworth 2020-02-11 13:33:20 UTC
Do you have any evidence that this CVE affects the ImageMagick packages in Fedora or EPEL?

- The CVE reports this against version 7.x and not 6.x.
- Fedora and EPEL only ship version 6.x.
- The 7.x fix was made in April 2019.
- The 6.x version in Fedora and EPEL are from source dated January 2020.

Please update and close any bugs as I do not believe they affect Fedora or EPEL. If this is the case please update your scripts to not spam me again.

Comment 3 Dhananjay Arunesh 2020-02-11 14:51:26 UTC
In reply to comment #2:
> Do you have any evidence that this CVE affects the ImageMagick packages in
> Fedora or EPEL?
> 
> - The CVE reports this against version 7.x and not 6.x.
> - Fedora and EPEL only ship version 6.x.
> - The 7.x fix was made in April 2019.
> - The 6.x version in Fedora and EPEL are from source dated January 2020.
> 
> Please update and close any bugs as I do not believe they affect Fedora or
> EPEL. If this is the case please update your scripts to not spam me again.

As per our manifest file we ship ImageMagick 6.x in fedora and epel, the reported issue was in 7.x. Just to double check whether 6.x is affected or not marked fedora and epel as affected

Comment 5 Riccardo Schirone 2020-03-11 17:17:03 UTC
In reply to comment #2:
> Do you have any evidence that this CVE affects the ImageMagick packages in
> Fedora or EPEL?

We do not usually do an analysis of the community components, so it's your responsability as a package maintainer to check whether a CVE affects your component or not. We just create a tracking bug so that you are notified of the possible issue and act on it.

> 
> - The CVE reports this against version 7.x and not 6.x.

True, however we cannot just trust the CVE description as many times they are not that precise. For example, even though the description only mention ImageMagick 7, the same flaw exists in ImageMagick before 6.9.10-36.  You can find the commit that patches it in comment 4 (it was not listed as a reference of the CVE and it was not referenced in the github issue)

> - Fedora and EPEL only ship version 6.x.
> - The 7.x fix was made in April 2019.
> - The 6.x version in Fedora and EPEL are from source dated January 2020.

Good point, however without proper information it is not always possible to do this kind of reasoning. Again, as said the ImageMagick6 fix was not immediately available, so comparing dates is not always a good solution.

> 
> Please update and close any bugs as I do not believe they affect Fedora or
> EPEL. If this is the case please update your scripts to not spam me again.

To wrap up, when we create these flaw bugs we don't (always) have all the info necessary to judge whether a given version is affected or not (there is also backporting to consider). When it's clear Fedora/Epel are not affected, we try to not create bug trackers, but when it is not, we create trackers for the community components, so that the community maintainers can have a better look at those and choose what to do, as you are the one who best know the component. If you do find out a given flaw, like this one, does not affect the component in any supported Fedora/Epel version, then feel free to close the tracking bug with CURRENTRELEASE or NOTABUG. When things are not clear (and that often happens with ImageMagick, where we cannot just trust the CVE description) we prefer to create one more bugzilla bug, instead of not opening it and risk the flaw is not noticed.

Comment 7 errata-xmlrpc 2020-03-31 19:33:10 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:1180 https://access.redhat.com/errata/RHSA-2020:1180

Comment 8 Product Security DevOps Team 2020-03-31 22:36:03 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-16709