Bug 1664699 (CVE-2018-1000876)

Summary: CVE-2018-1000876 binutils: integer overflow leads to heap-based buffer overflow in objdump
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abhgupta, darunesh, dbaker, erik-fedora, fweimer, jokerman, kanderso, klember, ktietz, law, mcermak, mnewsome, mpolacek, nickc, ohudlick, rjones, sipoyare, sthangav, trankin, tvainio, virt-maint
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 19:20:33 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: 1664713, 1664714, 1664715, 1665884, 1665885, 1665886, 1665887, 1665888, 1916672, 1916673    
Bug Blocks: 1664717    

Description Andrej Nemec 2019-01-09 13:34:11 UTC
An integer overflow was found in objdump, bfd_get_dynamic_reloc_upper_bound and bfd_canonicalize_dynamic_reloc functions of binutils. A local attacker could use this to crash the application or potentially achieve code execution.

Upstream issue:

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

Upstream patch:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a551c7a1b80fca579461774860574eabfd7f18f

Comment 1 Andrej Nemec 2019-01-09 13:48:06 UTC
Created binutils tracking bugs for this issue:

Affects: fedora-all [bug 1664713]


Created mingw-binutils tracking bugs for this issue:

Affects: epel-all [bug 1664715]
Affects: fedora-all [bug 1664714]

Comment 2 Riccardo Schirone 2019-01-11 14:36:41 UTC
On 32bit architectures, where the C `long` type is 32bit in size, function bfd/elf.c:_bfd_elf_get_dynamic_reloc_upper_bound() has an integer overflow in the way the size necessary to store relocations is computed. A crafted ELF file with particular section header information associated with SHT_REL/SHT_RELA sections may trigger this integer overflow. The size returned by _bfd_elf_get_dynamic_reloc_upper_bound() is then used to allocate a buffer on the heap, that is written to in bfd/elf.c:_bfd_elf_canonicalize_dynamic_reloc() where an out-of-bound write may happen.

However, the attacker has no control over the written data, because they are the addresses (on the heap) of other data structures.

Comment 3 Riccardo Schirone 2019-01-11 15:16:32 UTC
> On 32bit architectures, where the C `long` type is 32bit in size, ...

Actually, it is not necessary to be on 32bit architectures, but just to use 32bit compiled binutils libraries (libbfd).

Comment 5 Riccardo Schirone 2019-01-14 10:53:21 UTC
Decreasing Impact of this flaw to Moderate because of the unlikelihood of running a 32bit compiled objdump and/or having a compiled binary that uses 32bit compiled binutils libraries to analyze binaries from a not trusted source.

Comment 8 errata-xmlrpc 2019-08-06 12:10:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 9 Product Security DevOps Team 2019-08-06 19:20:33 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-2018-1000876