Bug 1664699 (CVE-2018-1000876) - CVE-2018-1000876 binutils: integer overflow leads to heap-based buffer overflow in objdump
Summary: CVE-2018-1000876 binutils: integer overflow leads to heap-based buffer overfl...
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2018-1000876
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1664713 1664714 1664715 1665884 1665885 1665886 1665887 1665888 1916672 1916673
Blocks: 1664717
TreeView+ depends on / blocked
 
Reported: 2019-01-09 13:34 UTC by Andrej Nemec
Modified: 2024-03-25 15:11 UTC (History)
21 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2075 0 None None None 2019-08-06 12:10:50 UTC

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


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