Bug 1559241 (CVE-2018-8769)

Summary: CVE-2018-8769 elfutils: buffer over-read in ebldynamictagname.c:ebl_dynamic_tag_name() allows for denial of service
Product: [Other] Security Response Reporter: Sam Fowler <sfowler>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aoliva, drepper, dsmith, fche, jakub, kanderso, mcermak, me, mjw, mjw, mnewsome, ohudlick, rschiron
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
An out-of-bound read flaw has been found in elfutils in the ebl_dynamic_tag_name function of ebldynamictagname.c file. An attacker could exploit this by supplying a crafted ELF file to display wrong data or potentially cause a crash in eu-readelf and eu-elflint binaries.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-06 13:02:41 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: 1559242, 1559243    
Bug Blocks: 1559245    

Description Sam Fowler 2018-03-22 04:20:12 UTC
elfutils between commits 88f3d2daa107b09fdba376a82bce7ed534c93645 and
92581d7eb483cb039e60112b0a03a04c2ffa4df4 is vulnerable to a buffer over-read in
the ebldynamictagname.c:ebl_dynamic_tag_name() function. An attacker could
exploit this by supplying a crafted ELF file to display wrong data or
potentially cause a crash in eu-readelf and eu-elflint binaries, depending on
how programs are compiled.

Upstream Issue:
https://sourceware.org/bugzilla/show_bug.cgi?id=22976

Upstream Patch:
https://sourceware.org/ml/elfutils-devel/2018-q1/msg00078.html

Comment 1 Sam Fowler 2018-03-22 04:20:42 UTC
Created elfutils tracking bugs for this issue:

Affects: fedora-all [bug 1559243]

Comment 4 Mark Wielaard 2018-03-22 08:15:51 UTC
Note that this is only used by eu-readelf and eu-elflint, it isn't exposed through any library.

It isn't in upstream 0.170, but can though a backport of upstream commit:

commit 88f3d2daa107b09fdba376a82bce7ed534c93645
Author: Mark Wielaard <mark>
Date:   Sat Feb 17 00:23:19 2018 +0100

    libelf: Sync elf.h from glibc.
    
    Signed-off-by: Mark Wielaard <mark>

Which is part of elfutils-0.170-elf_sync.patch which was added in Fedora in 0.170-9.

Comment 6 Frank Ch. Eigler 2018-03-27 20:27:34 UTC
ISTM the CVSS score overstates the severity of this bug.  I cannot think of a way in which confidentiality or availability is harmed by this, so 3.3=low seems to be more accurate.

https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

Given that a fix is already in upstream elfutils, any objections to CLOSED/NEXTRELEASE for the fedora BZ?

Comment 7 Riccardo Schirone 2018-04-06 12:45:42 UTC
I lowered the CVSSv3 score. Only Availability is affected, because you could make the program crash in case ebl_dynamic_tag_name returns a pointer to unmapped memory. It could also print other strings or values found in the process memory, but there is no way for an attacker to extract those strings, so I didn't put C:L.

Comment 8 Riccardo Schirone 2018-04-06 12:50:40 UTC
Correction to previous comment: depending on how the programs gets compiled, the ebl_dynamic_tag_name function could either return a valid or an invalid pointer. In the first case you would just see a wrong string when displaying ELF info, in the second case you would get a crash. Thus I:L, A:L in the CVSSv3 score.

Comment 10 Eric Christensen 2018-04-09 21:08:24 UTC
Statement:

This issue did not affect the versions of elfutils as shipped with Red Hat Enterprise Linux 5, 6, and 7 as they did not include the vulnerable commit.

This issue did not affect the versions of elfutils as shipped with Red Hat Developer Toolset 6 and 7 as they did not include the vulnerable commit.