Bug 2030307 (CVE-2021-4091)

Summary: CVE-2021-4091 389-ds-base: double free of the virtual attribute context in 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: low Docs Contact:
Priority: low    
Version: unspecifiedCC: abokovoy, ldap-maint, mreynolds, security-response-team, sgouvern, spichugi, tbordaz, vashirov
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base 2.2.0 Doc Type: If docs needed, set a value
Doc Text:
A double free was found in the way 389-ds-base handles virtual attributes context in persistent searches. An attacker could send a series of search requests, forcing the server to behave unexpectedly, and crash.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-16 19:01:29 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: 2027783, 2030367, 2030368, 2031046, 2039356, 2047261, 2048530, 2056481, 2060110, 2065569    
Bug Blocks: 2028842, 2031062    

Description Cedric Buissart 2021-12-08 12:36:11 UTC
When a worker thread processes a persisten search, it duplicates the private pblock and spawns a dedicated thread to handle the persistent search.
It will later free that cloned pblock.

However, both pblock (original an cloned) refer to the same virtual attribute context, resulting in the context be freed once per pblock instance.

389-ds-base-1.3.6.4 and newer (including 1.4 and 2.0) are expected to be vulnerable to this flaw.

The flaw has been introduced by the following commit : https://github.com/389ds/389-ds-base/commit/74c666b83e3e1789c2ef3f7935c327bd7555193e

Comment 6 Cedric Buissart 2022-01-27 13:25:46 UTC
Created 389-ds-base tracking bugs for this issue:

Affects: fedora-all [bug 2047261]

Comment 7 errata-xmlrpc 2022-02-22 17:05:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2022:0628 https://access.redhat.com/errata/RHSA-2022:0628

Comment 8 errata-xmlrpc 2022-03-15 10:06:01 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:0889 https://access.redhat.com/errata/RHSA-2022:0889

Comment 9 errata-xmlrpc 2022-03-16 15:19:11 UTC
This issue has been addressed in the following products:

  Red Hat Directory Server 11.3 for RHEL 8

Via RHSA-2022:0952 https://access.redhat.com/errata/RHSA-2022:0952

Comment 10 Product Security DevOps Team 2022-03-16 19:01:27 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-2021-4091

Comment 11 Cedric Buissart 2022-03-22 09:35:07 UTC
Upstream fix :
- Issue 5218 - double-free of the virtual attribute context in persistent search
https://github.com/389ds/389-ds-base/commit/a3c298f8140d3e4fa1bd5a670f1bb965a21a9b7b

Comment 12 errata-xmlrpc 2022-04-19 15:37:03 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

Via RHSA-2022:1410 https://access.redhat.com/errata/RHSA-2022:1410