Bug 1588056 (CVE-2018-10850)

Summary: CVE-2018-10850 389-ds-base: race condition on reference counter leads to DoS using persistent search
Product: [Other] Security Response Reporter: Cedric Buissart <cbuissar>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: mreynolds, nkinder, rmeggins, tbordaz
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base 1.4.0.10, 389-ds-base 1.3.8.3 Doc Type: If docs needed, set a value
Doc Text:
A race condition was found in the way 389-ds-base handles persistent search, resulting in a crash if the server is under load. An anonymous attacker could use this flaw to trigger a denial of service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-18 18:07:20 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: 1588057, 1588059, 1628676    
Bug Blocks: 1566206    

Description Cedric Buissart 2018-06-06 14:26:41 UTC
The bug is related to incoming connection handling in DS. A connection data structure contains a refcnt. The refcnt accounts the number of pending requests. When a connection needs to be cleanup (upon closure, timeout...) the core server waits for refcnt to be 0. It basically waits for all pending requests to complete before cleaning the structure.

The refcnt does not account specific LDAP request (persistent search), so if an event occurs on the connection (closure) the core server may reset the structure although a request is still going on. 

Anonymous user are allowed to trigger a persistent search so in theory anyone sending persistent search and closing  the connection hits that bug. 
Under normal use, most of the time the problem is not detected. Sometime there are error written in the log when an invalid refcnt is found. But depending on dispatch dynamic of the threads handling connection event it can crash.

Comment 4 Cedric Buissart 2018-06-06 15:04:34 UTC
Acknowledgments:

Name: Thierry Bordaz (Red Hat)

Comment 5 Cedric Buissart 2018-06-11 09:16:24 UTC
Upstream fix :
 - Ticket 49768 - Under network intensive load persistent search can erronously decrease connection refcnt
https://pagure.io/389-ds-base/c/8f04487f99a

Comment 6 Cedric Buissart 2018-06-11 09:24:07 UTC
External References:

https://pagure.io/389-ds-base/issue/49768

Comment 8 errata-xmlrpc 2018-09-25 19:05:44 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:2757 https://access.redhat.com/errata/RHSA-2018:2757