Bug 605448 (CVE-2010-0211)

Summary: CVE-2010-0211 openldap: modrdn processing uninitialized pointer free
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: jplans, jzeleny, nalin, omoris, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-05 06:34:14 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: 606369, 606374, 606375, 606377, 606399, 606400, 615903    
Bug Blocks:    

Description Vincent Danen 2010-06-18 00:20:39 UTC
A vulnerability was found in OpenLDAP during the processing of a modrdn call with a specially crafted destination rdn string.  An unauthenticated user could cause slapd to segfault or abort.

Quoting the report:

In the function modrdn.c:386:slap_modrdn2mods() a call is made to
448:*desc->ad_type->sat_equality->smr_normalize() without checking its
return value. In this case the call fails and leaves mod_tmp->sml_nvalues
uninitialized which leads to an invalid free() later in
modrdn.c:202:slap_mods_free(). The breakdown of smr_normalize() is caused
by invalid UTF-8 sequences, which are passed to the software via
hex-formatted strings. It could be possible to insert and execute malicious
code by careful manipulation of the program state prior to triggering the
vulnerability. At least with a vanilla compilation of 2.4.22 it proved
possible to freely control the invalid pointer being freed. For example,
the following kind of log message is produced:

    * ** glibc detected *** /usr/sbin/slapd: double free or corruption (out): 0x002ce400 ***

This has been reportedly tested against upstream 2.4.22 as well as 2.4.11 (Debian) and 2.4.21 (Ubuntu).

Acknowledgements:

Red Hat would like to thank CERT-FI for responsibly reporting this flaw, who
credit Ilkka Mattila and Tuomas Salomäki for the discovery of the issue.

Comment 7 Tomas Hoger 2010-06-21 13:01:14 UTC
In openldap 2.4.x, this issue is pre-auth.  In older versions (such as those shipped with RHEL-4 or RHEL-5), this problem can only be triggered by by an authenticated user with sufficient privileges to perform modrdn (modify relative distinguished name, or entry rename) operation.  selfwrite privilege to an entry is not sufficient.

glibc malloc checks mitigate the impact of the invalid free flaw.

Comment 16 Tomas Hoger 2010-07-19 08:52:39 UTC
Fixed upstream in 2.4.23.  Upstream bug report is public now:
  http://www.openldap.org/its/index.cgi/Software%20Bugs?id=6570

Comment 18 errata-xmlrpc 2010-07-20 15:42:11 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2010:0542 https://rhn.redhat.com/errata/RHSA-2010-0542.html

Comment 19 errata-xmlrpc 2010-07-20 16:34:51 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2010:0543 https://rhn.redhat.com/errata/RHSA-2010-0543.html