Bug 1291312 (CVE-2015-8540)

Summary: CVE-2015-8540 libpng: underflow read in png_check_keyword()
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: cwarfiel, drizt72, erik-fedora, fedora-mingw, jrusnack, ktietz, lfarkas, nforro, paul, phracek, rdieter, rjones, slawomir, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libpng 1.6.0, libpng 1.5.26, libpng 1.4.19, libpng 1.2.56, libpng 1.0.66 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-21 14:37:16 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: 1291314, 1291315, 1291316, 1291317, 1291318, 1291319, 1291320    
Bug Blocks: 1291322    

Description Martin Prpič 2015-12-14 14:42:48 UTC
An underflow read was found in png_check_keyword in pngwutil.c in libpng-1.2.54:

If the data of "key" is only ' ' (0x20), it will read a byte before the buffer in line 1288.

This issue impacts upstream versions 1.2.55, 1.0.65, 1.4.18, and 1.5.25 of libpng.

An attacker could possibly use this flaw to cause an out-of-bounds read by tricking an unsuspecting user into processing a specially crafted PNG image.

CVE assignment:

http://seclists.org/oss-sec/2015/q4/469

Upstream issue:

http://sourceforge.net/p/libpng/bugs/244/

Upstream patch:

http://sourceforge.net/p/libpng/code/ci/d9006f683c641793252d92254a75ae9b815b42ed/

Comment 1 Martin Prpič 2015-12-14 14:43:54 UTC
Created libpng tracking bugs for this issue:

Affects: fedora-all [bug 1291314]

Comment 2 Martin Prpič 2015-12-14 14:44:02 UTC
Created libpng10 tracking bugs for this issue:

Affects: epel-6 [bug 1291318]
Affects: fedora-all [bug 1291320]

Comment 3 Martin Prpič 2015-12-14 14:44:08 UTC
Created libpng12 tracking bugs for this issue:

Affects: fedora-all [bug 1291315]

Comment 4 Martin Prpič 2015-12-14 14:44:14 UTC
Created libpng15 tracking bugs for this issue:

Affects: fedora-all [bug 1291316]

Comment 5 Martin Prpič 2015-12-14 14:44:21 UTC
Created mingw-libpng tracking bugs for this issue:

Affects: fedora-all [bug 1291317]
Affects: epel-7 [bug 1291319]

Comment 9 Stefan Cornelius 2015-12-21 14:41:18 UTC
It seems like this is only an issue when an application uses a untrusted input when *writing* a PNG file. Only reading a PNG file should not be enough to trigger this. Since this is a library, it's hard to predict the exact criticality, as it depends on the application using it. For the most common scenarios, this should not be a major problem, it'll probably not even lead to a crash.

Comment 10 Fedora Update System 2015-12-28 22:56:11 UTC
libpng10-1.0.66-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2015-12-31 01:50:41 UTC
libpng10-1.0.66-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-01-02 22:21:23 UTC
libpng12-1.2.56-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-01-02 23:19:47 UTC
libpng12-1.2.56-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2016-01-03 20:25:33 UTC
libpng10-1.0.66-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 errata-xmlrpc 2016-02-02 10:05:29 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 6
  Supplementary for Red Hat Enterprise Linux 5

Via RHSA-2016:0101 https://rhn.redhat.com/errata/RHSA-2016-0101.html

Comment 16 errata-xmlrpc 2016-02-02 10:06:57 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 5

Via RHSA-2016:0100 https://rhn.redhat.com/errata/RHSA-2016-0100.html

Comment 17 errata-xmlrpc 2016-02-02 13:53:43 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 7
  Supplementary for Red Hat Enterprise Linux 6

Via RHSA-2016:0099 https://rhn.redhat.com/errata/RHSA-2016-0099.html

Comment 19 errata-xmlrpc 2016-07-18 13:55:55 UTC
This issue has been addressed in the following products:

  Red Hat Satellite 5.6
  Red Hat Satellite 5.7

Via RHSA-2016:1430 https://access.redhat.com/errata/RHSA-2016:1430