Bug 1468490 (CVE-2017-10979)

Summary: CVE-2017-10979 freeradius: Out-of-bounds write in rad_coalesce()
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: dpal, jdennis, lemenkov, nikolai.kondrashov, pkis, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: freeradius 2.2.10 Doc Type: If docs needed, set a value
Doc Text:
An out-of-bounds write flaw was found in the way FreeRADIUS server handled certain attributes in request packets. A remote attacker could use this flaw to crash the FreeRADIUS server or to execute arbitrary code in the context of the FreeRADIUS server process by sending a specially crafted request packet.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-02 09:37:04 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: 1469115, 1469116, 1471850    
Bug Blocks: 1468570    
Attachments:
Description Flags
Proposed patch none

Description Adam Mariš 2017-07-07 08:56:37 UTC
The rad_coalesce() function checks for WiMAX attributes which are too small, but it does not check for WiMAX attributes which are too large. As a result, the server can be convinced to read past the end of an attribute, and to write past the end of memory allocated via malloc().

The data being copied is taken from the attributes following the malformed WiMAX attribute, and is under the control of the attacker. While the packet has to be a "well formed" RADIUS packet, that requirement limits only the two octets which immediately follow the malformed WiMAX attribute. After that, there are up to 245 octets copied which are the complete control of the attacker.

The issue happens when the server receives any packet containing malformed WiMAX attributes, potentially leading to remote code execution.

Affected versions: 2.0.0 through 2.2.9, inclusive.

Comment 1 Adam Mariš 2017-07-07 08:56:45 UTC
Acknowledgments:

Name: the FreeRADIUS project
Upstream: Guido Vranken

Comment 2 Adam Mariš 2017-07-07 12:15:33 UTC
Created attachment 1295281 [details]
Proposed patch

Comment 6 Dhiru Kholia 2017-07-17 14:31:14 UTC
Created freeradius tracking bugs for this issue:

Affects: fedora-all [bug 1471850]

Comment 7 errata-xmlrpc 2017-07-18 03:42:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

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

Comment 8 Dhiru Kholia 2017-08-02 09:43:07 UTC
External References:

http://freeradius.org/security/fuzzer-2017.html