Discussion:
HP Radia Notify Daemon: Multiple Buffer Overflow Vulnerabilities
(too old to reply)
John Cartwright
2005-06-01 19:33:46 UTC
Permalink
HP Radia Notify Daemon: Multiple Buffer Overflow Vulnerabilities
John Cartwright <***@grok.org.uk>
1st June 2005

Introduction
------------
Hewlett-Packard's (formerly Novadigm) Radia contains a component known
as the Radia Notify Daemon. This RADEXECD component is a small server
process that listens for commands via a TCP socket and executes them
on behalf of an administrator or other Radia process. A total of three
remotely-exploitable overflows have been found in various versions of
this software.

Overview
--------
The 'nvd_exec' function contains two remotely-exploitable stack-based
overflows in version 3.1.2.0. The vulnerability occurs when a crafted
command is sent to a RADEXECD process with parameters of a greater
length than the buffer used to store them via an unbounded strcpy
operation. In a typical configuration this vulnerability may be
exploited remotely by an unauthenticated attacker to gain the
privileges of the RADEXECD component, observed to be
NT_AUTHORITY\SYSTEM during testing.

In addition, the earlier version of 3.1.0.0 has a similar flaw
involving a malformed file extension. This bug was reported via
development contacts to Novadigm (pre-HP) approximately 12 months ago
but the status and availability of the fix was unknown at the time of
writing.

Analysis
--------
The nvd_exec (as labelled in disassembly from embedded 'comments')
function is designed as a wrapper to the Windows CreateProcess API
call. Upon validation of its arguments, nvd_exec creates the relevant
StartupInfo structures, executes the target process, and waits for
it to terminate. This function accepts five parameters, beginning with
the application name to execute and its parameters.

Although generic restrictions on string lengths exist in the protocol
definition (see below), there is no specific check for an overly-long
parameter string at this stage in execution. A stack-based parameter
buffer of approximately 512 characters is used to store this
information during parsing, which can be overrun by one of two
unbounded strcpy calls inside nvd_exec:

.text:00406193 mov ecx, [ebp+arg_params] ; attacker-supplied
.text:00406196 push ecx ; char *
.text:00406197 lea edx [ebp+parambuf] ; actually 516 chars
.text:0040619D push edx ; char *
.text:0040619E call _strcpy ; overflow here

The second instance has the same bug:

.text:004061AE mov ecx, [ebp+arg_params] ; attacker-supplied
.text:004061B1 push ecx ; char *
.text:004061B2 lea edx, [ebp+parambuf] ; actually 516 chars
.text:004061B8 push edx ; char *
.text:004061B9 call _strcpy ; overflow here

Due to the positioning of the stack variables it is possible to
overwrite the return address of the function by overflowing the buffer:

FFFFFDF0 parambuf db 516 dup(?) ; buffer to overflow
FFFFFFF4 rc dd ;
FFFFFFFC pBuf dd ;
00000000 s db 4 dup(?) ; saved stack ptr
00000004 r db 4 dup(?) ; return address
00000008 arg_app dd ? ; application name
00000008 arg_params dd ? ; parameter information

By default, nvd_exec can be accessed by unauthenticated users by
crafting an appropriate request and submitting it to the RADEXECD port.

The older version of this software is vulnerable to a sprintf-based
overflow caused by poor error handling logic: in this instance it is
the extension of the command variable which causes the problem:

.text:00405B46 cmp [ebp+ext_ptr], 0 ; have we found the '.' ?
.text:00405B4D jz short loc_405B9F ; no extension (safe)
.text:00405B4F mov edx, [ebp+ext_ptr] ;
.text:00405B55 push edx ; char *
.text:00405B56 call _strlen ; calc extension length
.text:00405B5B add esp, 4 ;
.text:00405B5E cmp eax, 4 ; should be 4 eg '.foo'
.text:00405B61 jz short local_405B9F ; OK, continue
.text:00405B63 mov eax, [ebp+arg_app] ; the *complete* argument
.text:00405B66 push eax ;
.text:00405B67 push offset aFileExtMsg ; "File extension ... %s"
.text:00405B6C lea ecx, [ebp+buffer] ; fixed size buffer
.text:00405B72 push ecx ;
.text:00405B73 call _sprintf ; overflow here

Therefore supplying a string of the form ".AAAAAAAAAAAAAA..." is
sufficient to overflow this fixed-size buffer.

Exploitation
------------
Exploitation requires that the following steps be followed:

1) Attacker connects to RADEXECD port on target host
2) Attacker sends crafted remote execution request
3) Target host connects back to callback port on attacker
4) Target overflows buffer and executes shellcode

In order to craft a remote execution request, the protocol must be
analysed. RADEXECD employs a text-based protocol with requests
taking the form of:

<callback port>\0<username>\0<password>\0<command>\0
(where \0 is a NULL delimiter/terminator).

<callback port> is an attacker-supplied port which must be ready to
accept incoming connections. Testing has not revealed the purpose of
this port, and no data has been observed to travel over the connection
once established. Therefore from an exploitation point of view, it is
sufficient to place a netcat listener or similar on this port.

<username> and <password> are only checked if the corresponding global
configuration has specifically enabled security. Therefore in a typical
setup the strings 'user' and 'pass' are sufficient for exploitation
purposes.

<command> is a NULL-terminated ASCII string that contains the actual
command to be executed, with parameters. In order to exploit this
particular vulnerability, the command itself is not important, but we
use this part of the buffer to hold our return address and shellcode.
This must contain a '.' character to denote the extension portion of
the parameter.

So, in summary, a crafted request of this form is sufficient to exploit
this vulnerability:

<callback port>\0<username>\0<password>\0
"LIST " . (0x90 x <offset>) . <ret_addr> . "." . <shellcode>

Shellcode cannot include NULLs, dots, newlines, path components, etc.
In the test environment, <offset> was found to be 532 bytes for the
strcpy-based overflow and 454 bytes for the sprintf-based one.

When successfully overflowed, esp points to the extension component, so
<ret_addr> should be the address of a 'jmp esp' or 'call esp'
instruction. In a test XPSP1 environment, address 0x77E2EF63 was used
('call esp' from ADVAPI32.DLL.)

Workaround
----------
Disabling RADEXECD is impractical as it is essentially a core component
of the Radia suite. Access control lists on network devices should be
used to filter access to the configured RADEXECD port to mitigate this
attack vector until a patch is available.

Timeline
--------
3rd May 2005
- Vulnerabilities disclosed to Hewlett Packard.
- HP confirm and log as 'SSRT5962 Radia Notify Daemon buffer overflows'

17th May 2005
- HP reports that patches are under development.

1st June 2005
- Co-ordinated release.

Notes
-----
Versions under test (from .exe version resource) were RADEXECD.EXE
3.1.2.0 (strcpy-based overflow) and 3.1.0.0 (sprintf-based overflow)

This advisory will be archived at
http://www.grok.org.uk/advisories/radexecd.html
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/
John Cartwright
2005-06-02 15:56:59 UTC
Permalink
Hi

FYI, here is the associated HP bulletin:

Cheers
- John

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

HP SECURITY BULLETIN

HPSBMA01143 REVISION: 0

SSRT5962 rev.0 - HP OpenView Radia Management Applications - Radia
Notify Daemon Remote Unauthorized Access to Data and Denial of
Service (DoS)

NOTICE:
There are no restrictions for distribution of this Security
Bulletin provided that it remains complete and intact.

The information in this Security Bulletin should be acted upon
as soon as possible.

INITIAL RELEASE:
01 June 2005

POTENTIAL SECURITY IMPACT:
Remote Unauthorized Access to Data and Denial of Service (DoS)

SOURCE:
Hewlett-Packard Company
HP Software Security Response Team

VULNERABILITY SUMMARY:
A potential security vulnerability has been identified with HP
OpenView Radia Management Applications - Radia Notify Daemon
versions 2.x, 3.x, and 4.x where the potential vulnerability
could be exploited to allow a remote user to execute unauthorized
programs on managed client systems leading to unauthorized access
to data and Denial of Service (DoS).

REFERENCES:
None

SUPPORTED SOFTWARE VERSIONS*: ONLY impacted versions are listed.
HP OpenView Radia Management Applications 2.x, 3.x, and 4.x -
Radia Notify Daemon running on AIX, HP-UX , Linux, Microsoft
Windows 9x and Windows NT, Sun Solaris.

The Radia Notify Daemon is used by the Radia Application Manager
(RAM) and the Radia Software Manager (RSM) products which are
components of the HP OpenView Radia Management Applications.

BACKGROUND:

HP Company wishes to thank John Cartwright < ***@grok.org.uk>
for reporting this vulnerability to us and assisting us to protect
all of our valued customers.

AFFECTED VERSIONS

For HP OpenView Radia Notify Daemon 2.x

AIX
=============
action: install RADAPPSAIX_00001

HP-UX B.10.20
HP-UX B.10.30
HP-UX B.11.00
HP-UX B.11.04
HP-UX B.11.11
HP-UX B.11.22
HP-UX B.11.23
=============
action: install RADAPPSHPUX1_00001

Linux
=============
action: install RADAPPSLNX_00001

SunOS
=============
action: install RADAPPSSOL_00001

Windows NT, 2000, 2003, XP
=============
action: install RADAPPSWIN32_00005

Windows 9x
=============
action: install RADAPPSWIN32_00008

For HP OpenView Radia Notify Daemon 3.x

AIX
=============
action: install RADAPPSAIX_00002

HP-UX B.10.20
HP-UX B.10.30
HP-UX B.11.00
HP-UX B.11.04
HP-UX B.11.11
HP-UX B.11.22
HP-UX B.11.23
=============
action: install RADAPPSHPUX1_00002

Linux
=============
action: install RADAPPSLNX_00002

SunOS
=============
action: install RADAPPSSOL_00002

Windows NT, 2000, 2003, XP
=============
action: install RADAPPSWIN32_00006

Windows 9x
=============
action: install RADAPPSWIN32_00009


For HP OpenView Radia Notify Daemon 4.x

Windows NT, 2000, 2003, XP
=============
action: install RADAPPSWIN32_00007

Windows 9x
=============
action: install RADAPPSWIN32_00010


END AFFECTED VERSIONS

RESOLUTION:
HP has made patches available to resolve the issue on:

http://support.openview.hp.com

Note: HP Passport sign-in is required to access the Software
patches.


Applying the Patch - Follow the appropriate instructions for
installing the patch using client self-maintenance:

Version 4.x:

1. Download the appropriate patch file from the previous list.

2. Extract the contents of the .ZIP file into the Radia
Configuration Server BIN folder.
(typically C:\Novadigm\ConfigurationServer\Bin on Windows)

3. Make a backup of the entire RCS database.

4. Stop the RCS service (ZTOPTASK).

5. Open a command prompt and change directories into the BIN
folder.

6. Use the ZEDMAMS utility to import the export decks into the RCS
database. The following command is an example:

ZEDMAMSVERB=IMPORT_INSTANCE,FILE=RAM_WIN32_NT_4_0_HF_RNT07118.XPI,
XPR=RAM_WIN32_NT_4_0_HF_RNT07118.XPR,PREVIEW=NO,REPLACE=YES,
CONTINUE=YES,DUPLICATES=MANAGE,COMMIT_CHANGES=YES

7. Repeat step 6 for each of the version 4.x patch packages to be
imported.

Note: The parameters FILE=xxxx.XPI and XPR=xxxx.XPR shown in the
previous example must be changed to the name of the export
deck files provided in each of the version 4.x patch files.

8. Verify that the import process returns a rc=4 or rc=0.

9. Start the RCS service.

10. Open the Radia System Explorer and refer to:
OV-EN018048 - Best Practices for Implementing Self-maintenance on
Radia Management Clients, Version 4.0.

Version 3.x and 2.x.

1. Download the appropriate patch file from the previous list.

2. Publish and deploy the patch as maintenance following:
OV-EN018727 - Radia Client Self-Maintenance Version 3.0


MANUAL ACTIONS: Yes - NonUpdate
Install the appropriate patch.

For HP OpenView Radia Notify Daemon 2.x:
RADAPPSAIX_00001 - AIX
RADAPPSHPUX1_00001 - HP-UX
RADAPPSLNX_00001 - Linux
RADAPPSSOL_00001 - Solaris
RADAPPSWIN32_00005 - Windows NT, 2000, 2003, XP
RADAPPSWIN32_00008 - Windows 9.x

For HP OpenView Radia Notify Daemon 3.x:
RADAPPSAIX_00002 - AIX
RADAPPSHPUX1_00002 - HP-UX
RADAPPSLNX_00002 - Linux
RADAPPSSOL_00002 - Solaris
RADAPPSWIN32_00006 - Windows NT, 2000, 2003, XP
RADAPPSWIN32_00009 - Windows 9.x

For HP OpenView Radia Notify Daemon 4.x:
RADAPPSWIN32_00007 - Windows NT, 2000, 2003, XP
RADAPPSWIN32_00010 - Windows 9.x

BULLETIN REVISION HISTORY:
Revision 0: 1 June 2005
Initial release



SUPPORT: For further information, contact normal HP Services
support channel.

REPORT: To report a potential security vulnerability with any HP
supported product, send Email to: security-***@hp.com. It is
strongly recommended that security related information being
communicated to HP be encrypted using PGP, especially exploit
information. To obtain the security-alert PGP key please send an
e-mail message to security-***@hp.com with the Subject of
'get key' (no quotes).

SUBSCRIBE: To initiate a subscription to receive future HP
Security Bulletins via Email:

http://h30046.www3.hp.com/driverAlertProfile.php?regioncode=NA&
langcode=USENG&jumpid=in_SC-GEN__driverITRC&topiccode=ITRC

On the web page: ITRC security bulletins and patch sign-up
Under Step1: your IRTC security bulletins and patches
- check ALL categories for which alerts are required and
continue.
Under Step2: your IRTC operating systems
- verify your operating system selections are checked and
save.

To update an existing subscription:
http://h30046.www3.hp.com/subSignIn.php

Log in on the web page
Subscriber's choice for Business: sign-in.
On the Web page:
Subscriber's Choice: your profile summary
- use Edit Profile to update appropriate sections.

To review previously published Security Bulletins visit:
http://itrc.hp.com/service/cki/secBullArchive.do

* The Software Product Category that this Security Bulletin
relates to is represented by the 5th and 6th characters of the
Bulletin number:
GN = HP General SW,
MA = HP Management Agents,
MI = Misc. 3rd party SW,
MP = HP MPE/iX,
NS = HP NonStop Servers,
OV = HP OpenVMS,
PI = HP Printing & Imaging,
ST = HP Storage SW,
TL = HP Trusted Linux,
TU = HP Tru64 UNIX,
UX = HP-UX,
VV = HP Virtual Vault

System management and security procedures must be reviewed
frequently to maintain system integrity. HP is continually
reviewing and enhancing the security features of software products
to provide customers with current secure solutions.

"HP is broadly distributing this Security Bulletin in order to
bring to the attention of users of the affected HP products the
important security information contained in this Bulletin. HP
recommends that all users determine the applicability of this
information to their individual situations and take appropriate
action. HP does not warrant that this information is necessarily
accurate or complete for all user situations and, consequently, HP
will not be responsible for any damages resulting from user's use
or disregard of the information provided in this Bulletin. To the
extent permitted by law, HP disclaims all warranties, either
express or implied, including the warranties of merchantability
and fitness for a particular purpose, title and non-infringement."


(c)Copyright 2005 Hewlett-Packard Development Company, L.P.
Hewlett-Packard Company shall not be liable for technical or
editorial errors or omissions contained herein. The information
provided is provided "as is" without warranty of any kind. To the
extent permitted by law, neither HP nor its affiliates,
subcontractors or suppliers will be liable for incidental, special
or consequential damages including downtime cost; lost profits;
damages relating to the procurement of substitute products or
services; or damages for loss of data, or software restoration.
The information in this document is subject to change without
notice. Hewlett-Packard Company and the names of Hewlett-Packard
products referenced herein are trademarks of Hewlett-Packard
Company in the United States and other countries. Other product
and company names mentioned herein may be trademarks of their
respective owners.

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBQp75k+AfOvwtKn1ZEQIcDQCeKZbqzIf0VcxWxS7jdhnIEAh9TJYAn1gQ
g0hgMwzuMcet15SOM/Ism6aU
=rYxz
-----END PGP SIGNATURE-----
_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/

Loading...