Exiv2::PngImage::readMetadata() in pngimage.cpp in Exiv2 0.27.99.0 allows attackers to cause a denial of service (heap-based buffer over-read) via a crafted image file.
Created exiv2 tracking bugs for this issue:
Affects: fedora-all [bug 1747232]
same fix as CVE-2019-13504
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.
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.
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.
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):