Bug 1853477 (CVE-2020-15503) - CVE-2020-15503 LibRaw: lack of thumbnail size range check can lead to buffer overflow
Summary: CVE-2020-15503 LibRaw: lack of thumbnail size range check can lead to buffer ...
Alias: CVE-2020-15503
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1853478 1853479 1853528 1853529
Blocks: 1852094
TreeView+ depends on / blocked
Reported: 2020-07-02 18:57 UTC by Guilherme de Almeida Suckevicz
Modified: 2021-04-02 08:48 UTC (History)
10 users (show)

Fixed In Version: LibRaw 0.20-RC1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-11-04 02:26:17 UTC

Attachments (Terms of Use)
Backported patch (4.42 KB, patch)
2020-07-03 16:59 UTC, Gwyn Ciesla
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4451 0 None None None 2020-11-04 01:05:11 UTC

Description Guilherme de Almeida Suckevicz 2020-07-02 18:57:22 UTC
LibRaw before 0.20-RC1 lacks a thumbnail size range check. This affects decoders/unpack_thumb.cpp, postprocessing/mem_image.cpp, and utils/thumb_utils.cpp. For example, malloc(sizeof(libraw_processed_image_t)+T.tlength) occurs without validating T.tlength.

Reference and upstream commit:

Comment 1 Guilherme de Almeida Suckevicz 2020-07-02 18:57:42 UTC
Created LibRaw tracking bugs for this issue:

Affects: fedora-all [bug 1853478]

Created mingw-LibRaw tracking bugs for this issue:

Affects: fedora-all [bug 1853479]

Comment 2 Todd Cullum 2020-07-02 23:39:57 UTC
This flaw exists in libraw_cxx.cpp instead of the files listed in the upstream patch. The vulnerable methods LibRaw::dcraw_make_mem_thumb() and LibRaw::kodak_thumb_loader(), and LibRaw::unpack_thumb() exist there in LibRaw 0.19.4 and 0.19.5 which are shipped in RHEL-7 and RHEL-8 respectively. LibRaw is used in UI code within RHEL (kdegraphics, shotwell). In this case, an attacker would need to provide a crafted image file to a user to be processed by LibRaw using one of these UI applications. However, if LibRaw were used in an application that was provided untrusted input over a network, there would be more impact here.

Comment 3 Todd Cullum 2020-07-02 23:46:11 UTC

While the vulnerable code exists in versions of LibRaw shipped with Red Hat Enterprise Linux 7 and 8, LibRaw is not used in services which accept data directly from a network, reducing impact.

Comment 5 Gwyn Ciesla 2020-07-03 16:59:17 UTC
Created attachment 1699874 [details]
Backported patch

This is my backport of the upstream fix for this CVE, I've applied it to Fedora 31 and 32 for 0.19.5.

Comment 6 errata-xmlrpc 2020-11-04 01:05:09 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 7 Product Security DevOps Team 2020-11-04 02:26:17 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Note You need to log in before you can comment on or make changes to this bug.