PRL-2011-06

#####################################################################################

Application:   IBM Tivoli Directory Server SASL Bind Request Remote Code Execution Vulnerability

Platforms:   Windows

Exploitation:   Remote code execution

CVE Number:   CVE-2011-1206

ZDI number:   ZDI-11-136

{PRL}:   2011-06

Author:   Francis Provencher (Protek Research Lab’s)

WebSite:   http://www.protekresearchlab.com/

Twitter:   @ProtekResearch

#####################################################################################

1) Introduction
2) Report Timeline
3) Technical details
4) POC

#####################################################################################

===============
1) Introduction
===============

IBM Tivoli Directory Server (ITDS), formerly known as IBM Directory Server,

is an IBM implementation of the Lightweight Directory Access Protocol,

and is part of the IBM Tivoli Identity & Access Management portfolio.

IBM Tivoli Directory Server is a powerful, security-rich and standards-compliant

enterprise directory for corporate intranets and the Internet. Directory Server is

built to serve as the identity data foundation for rapid development and deployment

of Web applications and security and identity management initiatives by including

strong management, replication and security features.Several authentication methods

are available with IBM Tivoli Directory Server, beyond basic usernames and passwords.

ITDS supports digital certificate-based authentication, the Simple Authentication and

Security Layer (SASL), Challenge-Response Authentication Mechanism MD5 (CRAM-MD5),

and Kerberos authentication.IBM Tivoli Directory Server is a powerful LDAP

infrastructure that provides a foundation for deploying comprehensive identity management

applications and advanced software architectures.

(http://en.wikipedia.org/wiki/IBM_Tivoli_Directory_Server)

#####################################################################################

============================
2) Report Timeline
============================

2011-02-17 – Vulnerability reported to vendor
2011-04-18 – Coordinated public release of advisory

#####################################################################################

====================
3) Technical details
====================

This vulnerability allows remote attackers to execute arbitrary code on vulnerable

installations of IBM Tivoli Directory Server. Authentication is not required to

exploit this vulnerability. The specific flaw exists in how ibmslapd.exe handles

LDAP CRAM-MD5 packets. ibmslapd.exe listens by default on port TCP 389. When the

process receives an LDAP CRAM-MD5 packet, it uses libibmldap.dll to handle the

allocation of a buffer for the packet data. A specially crafted packet can cause

the ber_get_int function to allocate a buffer that is too small to fit the packet

data, causing a subsequent stack-based buffer overflow. This can be leveraged by

a remote attacker to execute arbitrary code under the context of the SYSTEM user.

#####################################################################################

===========
4) POC
===========

Here

################################################################################