Bug 1312337 (CVE-2016-9082)

Summary: CVE-2016-9082 cairo: Out of bounds read in read_png/write_png in cairo-png.c
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: bmcclain, cfergeau, dblechte, eedri, gklein, lsurette, mgoldboi, michal.skrivanek, otte, phracek, rbalakri, sardella, security-response-team, sherold, slawomir, srevivo, ykaul, ylavi
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-19 19:58:58 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: 1384554, 1384555, 1384556    
Bug Blocks: 1312341, 1382656, 1382664    
Attachments:
Description Flags
Backtrace report none

Description Adam Mariš 2016-02-26 13:10:34 UTC
It was found that specially crafted SVG file can trigger crash in png_write_row when converting the given SVG using librsvg2 and cairo. Crash happens inside libpng when trying to access invalid pointer.

Acknowledgements:

Name: Gustavo Grieco

Comment 1 Adam Mariš 2016-02-26 13:14:49 UTC
Created attachment 1130832 [details]
Backtrace report

Comment 3 Adam Mariš 2016-10-13 10:17:21 UTC
*** Bug 1382656 has been marked as a duplicate of this bug. ***

Comment 4 Adam Mariš 2016-10-13 10:38:05 UTC
CVE request:

http://seclists.org/oss-sec/2016/q4/44

Upstream bug:

https://bugs.freedesktop.org/show_bug.cgi?id=98165

Comment 5 Adam Mariš 2016-10-13 14:21:05 UTC
Created cairo tracking bugs for this issue:

Affects: fedora-all [bug 1384554]

Comment 6 Adam Mariš 2016-10-13 14:21:17 UTC
Created mingw-cairo tracking bugs for this issue:

Affects: fedora-all [bug 1384555]
Affects: epel-7 [bug 1384556]

Comment 7 Stefan Cornelius 2016-10-19 19:54:29 UTC
The upstream bug mentions a separate issue that may cause out-of-bounds writes. While this looks correct initially, I don't think that this is feasible:
The memory is allocated using _cairo_malloc_ab(), which has a built-in overflow check. As far as I can tell, this will catch the problem before we can reach the problematic code.

This leaves only the out-of-bounds read, which, all things considered, isn't really that dangerous.

Comment 8 Paul Howarth 2016-10-21 10:17:11 UTC
*** Bug 1382658 has been marked as a duplicate of this bug. ***

Comment 9 Paul Howarth 2016-10-21 10:18:31 UTC
*** Bug 1382659 has been marked as a duplicate of this bug. ***

Comment 10 Paul Howarth 2016-10-21 10:20:10 UTC
*** Bug 1382662 has been marked as a duplicate of this bug. ***

Comment 11 Adam Mariš 2016-10-27 11:26:23 UTC
Proposed patch:

https://bugs.freedesktop.org/attachment.cgi?id=127421