Bug 1848000 (CVE-2020-11017)

Summary: CVE-2020-11017 freerdp: Double free in cliprdr_server_receive_capabilities could result in data corruption
Product: [Other] Security Response Reporter: Michael Kaplan <mkaplan>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: mads, mailinglists, negativo17, oholy, pahan
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: freerdp 2.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-23 05:20:26 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: 1848001, 1848002, 1848003    
Bug Blocks: 1848044    

Description Michael Kaplan 2020-06-17 14:16:51 UTC
In FreeRDP less than or equal to 2.0.0, by providing manipulated input a malicious client can create a double free condition and crash the server. This is fixed in version 2.1.0.

References:
https://pub.freerdp.com/cve/CVE-2020-11017/
https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-q5c8-fm29-q57c

Comment 1 Michael Kaplan 2020-06-17 14:17:20 UTC
Created freerdp tracking bugs for this issue:

Affects: epel-all [bug 1848001]
Affects: fedora-all [bug 1848002]


Created freerdp1.2 tracking bugs for this issue:

Affects: fedora-all [bug 1848003]

Comment 2 Todd Cullum 2020-06-23 01:08:29 UTC
Technical Summary:

The freerdp server function cliprdr_server_receive_capabilities() reads data bytes out of an input stream that is received from the freerdp client application. One data point that is read by cliprdr_server_receive_capabilities() is the UINT16, capabilitySetLength. capabilitySetLength is used to control the caps_set_size variable, that is subsequently passed in a call to realloc()[1] as the size parameter. A malicious client could cause a call to realloc(capabilities.capabilitySets, 0), which would free the memory pointed to by capabilities.capabilitySets[2]. The code directly after the call to realloc() checks for NULL in order to avoid a potential NULL pointer reference in the case where realloc() were to fail. However, the code attempts to free capabilities.capabilitySets if the return from realloc() is NULL.

This is a problem because a call to realloc(capabilities.capabilitySets, 0) will have already freed the memory pointed to by capabilities.capabilitySets and thus trigger a double-free if capabilitySetLength is 0.

Exploiting this flaw could crash the freerdp server remotely and lead to a denial of service. The vulnerable functionality is in the clipboard functionality, which can be disabled in the server settings.

1. https://github.com/FreeRDP/FreeRDP/blob/aa07efeb18ac9eb8df3ce8410b116b8c4b080270/channels/cliprdr/server/cliprdr_main.c#L489
2. https://linux.die.net/man/3/realloc

Comment 3 Todd Cullum 2020-06-23 01:39:16 UTC
Statement:

This flaw does not affect any versions of freerdp as shipped with Red Hat Enterprise Linux. Versions of freerdp shipped with Red Hat Enterprise Linux 6, 7, and 8 do not have the vulnerable code.

Comment 4 Todd Cullum 2020-06-23 01:39:17 UTC
Mitigation:

Disable clipboard functionality in the freerdp server settings.

Comment 5 Product Security DevOps Team 2020-06-23 05:20:26 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-2020-11017