Bug 1747231 (CVE-2019-14369)

Summary: CVE-2019-14369 exiv2: Heap-based buffer over-read in Exiv2::PngImage::readMetadata() in pngimage.cpp
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: jgrulich, michel, rdieter
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-27 12:45:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1747232    
Bug Blocks: 1747234    

Description Pedro Sampaio 2019-08-30 00:31:59 UTC
Exiv2::PngImage::readMetadata() in pngimage.cpp in Exiv2 allows attackers to cause a denial of service (heap-based buffer over-read) via a crafted image file.

Upstream bug:


Comment 1 Pedro Sampaio 2019-08-30 00:32:10 UTC
Created exiv2 tracking bugs for this issue:

Affects: fedora-all [bug 1747232]

Comment 2 Riccardo Schirone 2019-09-24 14:23:08 UTC
Upstream fix:

same fix as CVE-2019-13504

Comment 3 Riccardo Schirone 2019-09-24 14:40:21 UTC
This bug has the same root cause as CVE-2019-13504. From bug 1729034 comment 4:
> When seeking in MemIo (code in MemIo::Impl::seek) the new position is not 
> properly checked, thus it is possible to move the current position beyond 
> the limits of the memory buffer. If a read is done later (code in MemIo::Impl::read) 
> the maximum number of bytes to read is computed by subtracting the current position 
> value from the buffer's size value. When these two values are implemented as
> unsigned values (e.g. size_t), the computation may wraparound and more data than
> what really available would be reported, making it possible to read beyond the 
> buffer's limits.

Comment 4 Riccardo Schirone 2019-09-24 14:42:07 UTC

This issue did not affect the versions of exiv2 as shipped with Red Hat Enterprise Linux 7, and 8 as variables MemIo::Impl::size_ and MemIo::Impl::idx_ are of type long, making it impossible to trigger the integer wraparound that would lead to an out-of-bound read.

Comment 5 Riccardo Schirone 2019-09-27 09:37:04 UTC
The flaw seems to be introduced in commit https://github.com/Exiv2/exiv2/commit/c72d16f4c402a8acc2dfe06fe3d58bf6cf99069e, where MemIo::Impl fields were changed from long to size_t.

Comment 6 Product Security DevOps Team 2019-09-27 12:45:38 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):