Bug 1608800 (CVE-2018-14550)

Summary: CVE-2018-14550 libpng: Stack-based buffer overflow in contrib/pngminus/pnm2png.c:get_token() potentially leading to arbitrary code execution
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bmcclain, dblechte, dfediuck, drizt72, eedri, erik-fedora, ktietz, mgoldboi, michal.skrivanek, nforro, paul, phracek, rdieter, rjones, sbonazzo, sherold, tgl, ylavi
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-10-18 09:34:51 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: 1608803, 1608804, 1608805, 1608806, 1608807, 1608808, 1608809, 1608810, 1608855    
Bug Blocks: 1608081    

Description Adam Mariš 2018-07-26 10:04:25 UTC
Stack-based buffer overflow in contrib/pngminus/pnm2png.c:get_token() function in libpng was found, possibly leading to arbitrary code execution when processing untrusted input.

Upstream bug:

https://github.com/glennrp/libpng/issues/246

Comment 1 Adam Mariš 2018-07-26 10:05:40 UTC
Created libpng tracking bugs for this issue:

Affects: fedora-all [bug 1608803]


Created libpng10 tracking bugs for this issue:

Affects: epel-6 [bug 1608810]
Affects: fedora-all [bug 1608804]


Created libpng12 tracking bugs for this issue:

Affects: fedora-all [bug 1608805]


Created libpng15 tracking bugs for this issue:

Affects: fedora-all [bug 1608806]


Created mingw-libpng tracking bugs for this issue:

Affects: epel-7 [bug 1608809]
Affects: fedora-all [bug 1608807]

Comment 4 Adam Mariš 2018-07-26 11:53:58 UTC
Statement:

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

Comment 5 Adam Mariš 2018-10-18 09:11:10 UTC
get_token() function parses provided pnm file and stores data into char array provided as argument. These arrays are allocated on stack with fixed size of 16 in pnm2png() function from where the get_token() function is called. There is no size check due to which the buffer overflow is possible. This vulnerability lies in third-party utility pnm2png which is not distributed with libpng and libpng12 packages in RHEL 5, 6 and 7.