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.
Upstream commits that look relevant: http://www.openldap.org/lists/openldap-commit/201006/msg00003.html http://www.openldap.org/lists/openldap-commit/201006/msg00004.html http://www.openldap.org/lists/openldap-commit/201006/msg00005.html or: http://www.openldap.org/lists/openldap-commit/201006/msg00028.html And the upstream bug report: http://www.openldap.org/its/index.cgi/Software%20Bugs?id=6570 which is currently still private.
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.
Fixed upstream in 2.4.23. Upstream bug report is public now: http://www.openldap.org/its/index.cgi/Software%20Bugs?id=6570
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
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