Bug 1661518 (CVE-2018-5808) - CVE-2018-5808 LibRaw: stack-based buffer overflow in find_green() leads to arbitrary code execution
Summary: CVE-2018-5808 LibRaw: stack-based buffer overflow in find_green() leads to ar...
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2018-5808
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1661519
Blocks: 1661524
TreeView+ depends on / blocked
 
Reported: 2018-12-21 12:57 UTC by Laura Pardo
Modified: 2021-02-16 22:36 UTC (History)
1 user (show)

Fixed In Version: LibRaw 0.18.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-03 09:15:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Laura Pardo 2018-12-21 12:57:23 UTC
A flaw was found in LibRaw versions prior to 0.18.9. An error within the "find_green()" function (internal/dcraw_common.cpp) can be exploited to cause a stack-based buffer overflow and subsequently execute arbitrary code. 


References:
https://github.com/LibRaw/LibRaw/blob/master/Changelog.txt 
https://secuniaresearch.flexerasoftware.com/advisories/81800/ 
https://secuniaresearch.flexerasoftware.com/secunia_research/2018-9/

Upstream commit:
https://github.com/LibRaw/LibRaw/commit/fd6330292501983ac75fe4162275794b18445bd9

Comment 1 Laura Pardo 2018-12-21 12:57:33 UTC
Created LibRaw tracking bugs for this issue:

Affects: epel-6 [bug 1661519]

Comment 2 Riccardo Schirone 2019-01-03 09:03:54 UTC
Increase Impact of the flaw to Important and set C:H/I:H/A:H because arbitrary code execution may be possible on affected versions.

Comment 3 Riccardo Schirone 2019-01-03 09:08:51 UTC
RHEL 7 is not affected by this flaw because the attacker does not have control over the width field as find_green() function is always called after hardcoding values in width/height fields that are less then 2064.

Comment 4 Riccardo Schirone 2019-01-03 09:12:14 UTC
On the affected versions, function find_green() in internal/dcraw_common.cpp does not correctly check the "width" value, which is used to read/write from/to an array of 2064 elements. By providing a specially crafted image that is able to reach the find_green() function with a width greater than 2064, an attacker could overwrite data on the stack and execute arbitrary code.

Comment 5 Riccardo Schirone 2019-01-03 09:15:05 UTC
Statement:

This issue did not affect the versions of LibRaw as shipped with Red Hat Enterprise Linux 7 as it does not allow an attacker enough control to corrupt the internal state.


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