Bug 1440788 (CVE-2017-0553) - CVE-2017-0553 libnl: Integer overflow in nlmsg_reserve()
Summary: CVE-2017-0553 libnl: Integer overflow in nlmsg_reserve()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2017-0553
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: impact=moderate,public=20170207,repor...
Depends On: 1440789 1442723
Blocks: 1415638 1440792
TreeView+ depends on / blocked
 
Reported: 2017-04-10 13:21 UTC by Adam Mariš
Modified: 2019-06-11 11:13 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
An integer overflow leading to a heap-buffer overflow was found in the libnl library. An attacker could use this flaw to cause an application compiled with libnl to crash or possibly execute arbitrary code in the context of the user running such an application.
Clone Of:
Environment:
Last Closed: 2019-06-08 03:10:05 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:2299 normal SHIPPED_LIVE Moderate: NetworkManager and libnl3 security, bug fix and enhancement update 2017-08-01 12:40:28 UTC

Description Adam Mariš 2017-04-10 13:21:27 UTC
An integer overflow vulnerability was found in nlmsg_reserve() triggered by crafted @len argument resulting into reserving too few bytes.

Upstream patch:

http://git.infradead.org/users/tgr/libnl.git/commit/3e18948f17148e6a3c4255bdeaaf01ef6081ceeb

Comment 1 Adam Mariš 2017-04-10 13:22:16 UTC
Created libnl3 tracking bugs for this issue:

Affects: fedora-all [bug 1440789]

Comment 2 Huzaifa S. Sidhpurwala 2017-04-17 09:20:13 UTC
Analysis:

The commit messages raises a very important point about libnl:

"In general, libnl functions are not robust against calling with
invalid arguments. Thus, never call libnl functions with invalid
arguments. In case of nlmsg_reserve() this means never provide
a @len argument that causes overflow."

The function nlmsg_reserve() is called with a very large value of len, later when the following code is run, it results in a integer overflow:

"tlen = pad ? ((len + (pad - 1)) & ~(pad - 1)) : len;"

This later causes too small a buffer to be allocated and buffer overflow when data is eventually copied into it.

The commit however assumes that arguement "pad" is untrued, in case it is not, this may causes additional issues.

Also other functions may need an audit, if libnl API functions are called with untrusted value and the assumption is that libnl will sanitize them. (Which does not currently happen).

Finally this may cause arbitrary code execution in the context of the user running the library.

Comment 4 errata-xmlrpc 2017-08-01 09:31:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:2299 https://access.redhat.com/errata/RHSA-2017:2299


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