Bug 1677536 (CVE-2019-7664) - CVE-2019-7664 elfutils: out of bound write in elf_cvt_note in libelf/note_xlate.h
Summary: CVE-2019-7664 elfutils: out of bound write in elf_cvt_note in libelf/note_xla...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2019-7664
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1677537 1679071 1679072
Blocks: 1677542
TreeView+ depends on / blocked
 
Reported: 2019-02-15 07:46 UTC by Dhananjay Arunesh
Modified: 2019-11-05 21:13 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:21:51 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2197 0 None None None 2019-08-06 12:27:16 UTC
Red Hat Product Errata RHSA-2019:3575 0 None None None 2019-11-05 21:13:47 UTC

Description Dhananjay Arunesh 2019-02-15 07:46:04 UTC
In elfutils 0.175, a negative-sized memcpy is attempted in elf_cvt_note in
libelf/note_xlate.h because of an incorrect overflow check. Crafted elf input
causes a segmentation fault, leading to denial of service (program crash).

Reference:
https://sourceware.org/bugzilla/show_bug.cgi?id=24084

Comment 1 Dhananjay Arunesh 2019-02-15 07:46:24 UTC
Created elfutils tracking bugs for this issue:

Affects: fedora-all [bug 1677537]

Comment 5 Huzaifa S. Sidhpurwala 2019-02-20 09:58:16 UTC
The vulnerable function was introduced via the following commit:
https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=c76f0b05676f6207affbfd85e75063db3b6eeccf;hp=cb6d865011ad98a8ac2018f072f396a2268739ca

This was released with elfutils 0.130

Comment 7 Mark Wielaard 2019-02-20 12:39:17 UTC
(In reply to Huzaifa S. Sidhpurwala from comment #5)
> The vulnerable function was introduced via the following commit:
> https://sourceware.org/git/?p=elfutils.git;a=commitdiff;
> h=c76f0b05676f6207affbfd85e75063db3b6eeccf;
> hp=cb6d865011ad98a8ac2018f072f396a2268739ca

That commit introduced elf_cvt_note with a bug that would miss len being smaller than a full header, which was part of elfutils-0.130.
That was fixed in commit 315ebd5288553448406d77b007ff658c1b83abb3 "Fix possible crash in note conversion." which was part of elfutils-0.139.
Then commit 5199e15870e05e5b0b9f98c20fc9b5427aa6dd6a "Recognize and parse GNU Property notes." added support for a new note type with different alignment/padding rules.
This commit (re)introduced the bug by using the wrong constant for the note header length (a corrupt note of 9, 10 or 11 bytes would now possibly trigger the bad memcpy for well chosen namesz and/or descsz values).
This was part of elfutils 0.175, but that commit was (also) backported to elfutils 0.174 for some Fedora and RHEL releases.

Comment 10 Dhananjay Arunesh 2019-02-25 06:15:20 UTC
In reply to comment #9:
> Huzaifa, I hate to quibble, but the "A:H" part in
> cvss3=5.5/CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H seems inflated too. 
> There is no service whose availability is hurt by this bug.  It is an
> ordinary crash-on-crafted-input bug, with no particular security relevance.

Updated A:L and severity to Low

Comment 11 errata-xmlrpc 2019-08-06 12:27:15 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2197 https://access.redhat.com/errata/RHSA-2019:2197

Comment 12 Product Security DevOps Team 2019-08-06 13:21:51 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-2019-7664

Comment 13 errata-xmlrpc 2019-11-05 21:13:46 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:3575 https://access.redhat.com/errata/RHSA-2019:3575


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