Bug 1424987 (CVE-2017-2625)

Summary: CVE-2017-2625 libXdmcp: weak entropy usage for session keys
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: btissoir, sandmann, security-response-team, slong
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
It was discovered that libXdmcp used weak entropy to generate session keys. On a multi-user system using xdmcp, a local attacker could potentially use information available from the process list to brute force the key, allowing them to hijack other users' sessions.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-01 00:37:13 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: 1427716, 1431689    
Bug Blocks: 1424993    

Description Martin Prpič 2017-02-20 09:25:40 UTC
The following flaw was reported in libXdmcp:

Summary and Impact
------------------

XDM uses weak entropy to generate the session keys on non-BSD systems:

    void
    XdmcpGenerateKey (XdmAuthKeyPtr key)
    {
    #ifndef HAVE_ARC4RANDOM_BUF
        long    lowbits, highbits;
    
        srandom ((int)getpid() ^ time((Time_t *)0));
        lowbits = random ();
        highbits = random ();
        getbits (lowbits, key->data);
        getbits (highbits, key->data + 4);
    #else
        arc4random_buf(key->data, 8);
    #endif
    }

On multi user systems it might possible to check the PID of the process and how long it is running to get an estimate of these values, which could allow an attacker to attach to the session of a different user.

Comment 1 Martin Prpič 2017-02-20 09:25:43 UTC
Acknowledgments:

Name: Eric Sesterhenn (X41 D-Sec GmbH)

Comment 2 Doran Moppert 2017-02-27 06:28:05 UTC
Adjusted CVSS to include PR:L (attacker must have local shell privileges).

This could be quite a serious attack against xdmcp-based terminal servers in the absence of process namespaces, but this is no longer a common setup.

Comment 5 Doran Moppert 2017-02-27 06:38:49 UTC
It appears that Fedora can enable arc4random in libXdmcp by adding `BuildRequires: libbsd-devel`.

Comment 6 Doran Moppert 2017-03-01 00:17:41 UTC
Created libXdmcp tracking bugs for this issue:

Affects: fedora-all [bug 1427716]

Comment 7 Eric Christensen 2017-07-26 14:04:14 UTC
Statement:

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 9 errata-xmlrpc 2017-08-01 16:04:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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