Bug 1852490 (CVE-2020-0182)

Summary: CVE-2020-0182 libexif: out of bounds read due to a missing bounds check in exif_entry_get_value function in exif-entry.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: ajax, caillon+fedoraproject, gnome-sig, john.j5live, mcatanza, rdieter, rhbugs, rhughes, rstrode, sandmann, thomasj, yselkowi
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: 2020-09-29 22:02:05 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: 1852491, 1853460, 1853461    
Bug Blocks: 1852493    

Description Guilherme de Almeida Suckevicz 2020-06-30 14:27:45 UTC
In exif_entry_get_value of exif-entry.c, there is a possible out of bounds read due to a missing bounds check. This could lead to local information disclosure with no additional execution privileges needed. User interaction is not needed for exploitation.

References:
https://source.android.com/security/bulletin/pixel/2020-06-01
https://android.googlesource.com/platform/external/libexif/+/4b7b14770c4290eaeaebadf0e99ffdfdbd8f725c

Comment 1 Guilherme de Almeida Suckevicz 2020-06-30 14:28:03 UTC
Created libexif tracking bugs for this issue:

Affects: fedora-all [bug 1852491]

Comment 2 Todd Cullum 2020-07-02 18:04:52 UTC
There is a possible small out-of-bounds read in exif_entry_get_value() in cases where entry->data is not NULL-terminated or smaller than 7 bytes in length. This is because the standard does not require the entry->data to be NULL terminated or a specific length. Since the code checked for example, strncmp ((char *)entry->data, "Minolta", 7)), there was a possibility of a limited out-of-bounds read here. The patch ensures that before strncmp() is called, the entry size is large enough to not read out-of-bounds data. Information disclosure is very limited here though for each entry because there is already a hardcoded relatively small value passed to strncmp() in the lenth parameter. This could likely also cause functional issues in cases where the strncmp() fails due to an unexpected entry->data string.

Comment 4 Todd Cullum 2020-07-02 18:10:52 UTC
Mitigation:

This flaw could be mitigated by not passing untrusted input to libexif.

Comment 7 errata-xmlrpc 2020-09-29 20:51:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:4040 https://access.redhat.com/errata/RHSA-2020:4040

Comment 8 Product Security DevOps Team 2020-09-29 22:02:05 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-0182

Comment 9 errata-xmlrpc 2020-11-04 03:43:24 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2020:4766 https://access.redhat.com/errata/RHSA-2020:4766