Bug 1928794 (CVE-2020-24870)

Summary: CVE-2020-24870 LibRaw: Stack buffer overflow in LibRaw::identify_process_dng_fields() in identify.cpp
Product: [Other] Security Response Reporter: Pedro Sampaio <psampaio>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dchen, debarshir, gwync, hobbes1069, jridky, manisandro, mattdm, mattia.verga, nphilipp, rdieter, sebastian, siddharth.kde, sipoyare, than, thibault
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: LibRaw 0.20.1 Doc Type: If docs needed, set a value
Doc Text:
A stack buffer overflow vulnerability was found in LibRaw. This flaw allows a malicious user to send a crafted image that, when parsed by an application linked to LibRaw, leads to a denial of service or potential code execution.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 23:24: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:
Embargoed:
Bug Depends On: 1928801, 1928796, 1928798, 1928800, 1928802, 1931841    
Bug Blocks: 1928799    

Description Pedro Sampaio 2021-02-15 15:14:47 UTC
A flaw was found in libraw. Stack buffer overflow in LibRaw::identify_process_dng_fields in identify.cpp may lead to local denial of service or local arbitrary code execution from a user crafted file.

References:

https://github.com/LibRaw/LibRaw/commit/4feaed4dea636cee4fee010f615881ccf76a096d
https://github.com/LibRaw/LibRaw/issues/330

Comment 1 Pedro Sampaio 2021-02-15 15:16:03 UTC
Created LibRaw tracking bugs for this issue:

Affects: fedora-all [bug 1928796]


Created kf5-libkdcraw tracking bugs for this issue:

Affects: epel-8 [bug 1928801]
Affects: fedora-all [bug 1928800]


Created mingw-LibRaw tracking bugs for this issue:

Affects: fedora-all [bug 1928798]


Created rawtherapee tracking bugs for this issue:

Affects: fedora-all [bug 1928802]

Comment 3 Mauro Matteo Cascella 2021-02-23 11:44:57 UTC
Function LibRaw::identify_process_dng_fields() in src/metadata/identify.cpp was introduced to LibRaw in version 0.20.0 via commit [1]. However, the same vulnerable code (to be precise, part of it) was already present in internal/dcraw_common.cpp since 0.19.0 [2]. For this reason, I'd consider the version of LibRaw as shipped with RHEL-8 (0.19.5) to be potentially affected by this flaw. Note that the bug is not easily reproducible on RHEL.

[1] https://github.com/LibRaw/LibRaw/commit/d1975cb0e055d2bfe58c9d845c9a3e57c346a2f9
[2] https://github.com/LibRaw/LibRaw/commit/291039ba1f8c546b9100261f769f1cf6b70de7b5

Comment 5 Mauro Matteo Cascella 2021-03-05 15:15:27 UTC
Statement:

LibRaw is not supposed to be used in RHEL by network-facing applications, thus reducing the impact of this flaw.

Comment 6 Mauro Matteo Cascella 2021-03-05 15:17:16 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1853477#c2.

Comment 7 errata-xmlrpc 2021-11-09 18:30:34 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:4381 https://access.redhat.com/errata/RHSA-2021:4381

Comment 8 Product Security DevOps Team 2021-11-09 23:24:36 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-24870