exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

CYBSEC-presapigsbo.txt

CYBSEC-presapigsbo.txt
Posted Jan 20, 2007
Authored by Mariano Nunez Di Croce | Site cybsec.com

CYBSEC Security Advisory - A specially crafted HTTP request can trigger a remote buffer overflow in SAP IGS service.

tags | advisory, remote, web, overflow
SHA-256 | 140dce31f80c33f96fc4f5fb9d11c258d9cfcfeed32188954f44e87decf132c7

CYBSEC-presapigsbo.txt

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


(The following advisory is also available in PDF format for download at:
http://www.cybsec.com/vuln/CYBSEC-Security_Pre-Advisory_SAP_IGS_Remote_Buffer_Overflow.pdf )

This advisory contains the full-detailed information regarding the vulnerability described in "CYBSEC Security Pre-Advisory: SAP Internet Graphics
Service (IGS) Remote Buffer Overflow".


CYBSEC S.A.
www.cybsec.com

Advisory Name: SAP Internet Graphics Service (IGS) Remote Buffer Overflow
==============

Vulnerability Class: Heap Buffer Overflow
====================

Release Date: 2007-01-18
=============

Affected Applications:
======================
* SAP IGS 6.40 Patchlevel <= 15
* SAP IGS 7.00 Patchlevel <= 3

Affected Platforms:
===================
* AIX 64 bits
* HP-UX on IA64 64bit
* HP-UX on PA-RISC 64bit
* Linux on IA32 32bit
* Linux on IA64 64bit
* Linux on Power 64bit
* Linux on x86_64 64bit
* Linux on zSeries 64bit
* OS/400 V5R2M0
* Solaris on SPARC 64bit
* TRU64 64bit
* Windows Server on IA32 32bit
* Windows Server on IA64 64bit
* Windows Server on x64 64bit

Local / Remote: Remote
===============

Severity: High
=========

Author: Mariano Nuñez Di Croce
=======

Vendor Status:
==============
* Confirmed, update released.

Reference to Vulnerability Disclosure Policy:
=============================================
http://www.cybsec.com/vulnerability_policy.pdf

Product Overview:
==================
"The IGS provides a server architecture where data from an SAP System or other sources can be used to generate graphical or non-graphical output."

It is important to note that IGS is installed and activated by default with the Web Application Server (versions >= 6.30)

Vulnerability Description:
==========================
A specially crafted HTTP request can trigger a remote buffer overflow in SAP IGS service.

Technical Details:
==================

The ADM:GETLOGFILE command receives a portwatcher as a parameter. If the specified portwatcher is not found, an error message is returned to the client.

The vulnerability specifically exists in the processing of this error message.
The message is build by the use of the _snprintf() function, which helps to prevent the occurrence of buffer overflows by limiting the number of bytes
written to the destination buffer:

- ------------------------------------------------------------------------------------------
8B5424 14 MOV EDX,DWORD PTR SS:[ESP+14] ; Portwatcher string (controlled)
52 PUSH EDX
68 B49C5700 PUSH igsmux.00579CB4 ; ASCII "Could not find portwatcher %s"
8D8424 B0000000 LEA EAX,DWORD PTR SS:[ESP+B0] ; Destination buffer
68 00040000 PUSH 400 ; Output 1024 bytes max
50 PUSH EAX
E8 DA881100 CALL <JMP.&MSVCR71._snprintf>
- ------------------------------------------------------------------------------------------

Therefore, if a parameter of more than 998 bytes is received, only the first 1024 bytes of the resulting string (after concatenation) would be stored
in the destination buffer and no overflow would occur.

To present this error message to the client, an HTTP response is crafted. Its content is prepared in a buffer stored in the heap. After some
procedures, the error message string is copied to this buffer:

- ------------------------------------------------------------------------------
8B4D 0C MOV ECX,DWORD PTR SS:[EBP+C] ; _snprintf() result value
8B75 08 MOV ESI,DWORD PTR SS:[EBP+8] ; Error message string
8DB8 A0000000 LEA EDI,DWORD PTR DS:[EAX+A0] ; Destination buffer
8BC1 MOV EAX,ECX
C1E9 02 SHR ECX,2
F3:A5 REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:[ESI]
- ------------------------------------------------------------------------------

The _snprintf() function returns the total amount of bytes written, so above code would not seem to be unreasonable. The problem is that, if the
source buffer is larger than the maximum number of characters to store (count), a particular behavior takes place:

?If the number of bytes required to store the data exceeds count, then count bytes of data are stored in buffer and a negative value is returned? [MSDN]

Therefore, if the string is larger than 1024 bytes, after the first instruction of the presented code ECX would contain a negative number treated as
unsigned, resulting in a very big number. Then, when the memory copy operation takes place, heap space reserved would be overflowed.

This will overwrite heap block structures, which would eventually be used and result in the execution of the famous set of instructions:

- --------------------------------------------------
8901 MOV DWORD PTR DS:[ECX],EAX
8948 04 MOV DWORD PTR DS:[EAX+4],ECX
- --------------------------------------------------

As both ECX and EAX can be controlled, an arbitrary DWORD overwrite is possible, leading to the possibility of executing arbitrary code.

Impact:
=======
Under UNIX systems, successful exploitation of this vulnerability may allow an attacker to execute remote code with the privileges of the SAP System
Administrator account (<SID>adm), allowing him to take full control of the SAP system installation.

Under Microsoft Windows systems, successful exploitation of this vulnerability may allow an attacker to execute remote code with the privileges of the
LocalSystem account, allowing him to take full control of the entire system.

Solutions:
==========
SAP has released patches to address this vulnerability. Affected customers should apply the patches immediately.
More information can be found on SAP Note 968423.

Vendor Response:
================
* 2006-06-02: Initial Vendor Contact.
* 2006-06-09: Vendor Confirmed Vulnerability.
* 2006-07-03: Vendor Releases Update for version 6.40.
* 2006-07-13: Vendor Releases Update for version 7.00.
* 2006-08-10: Pre-Advisory Public Disclosure.
* 2007-01-18: Advisory Public Disclosure.

Special Thanks:
===============
Thanks goes to Carlos Diaz and Victor Montero.

Contact Information:
====================
For more information regarding the vulnerability feel free to contact the author at mnunez <at> cybsec <dot> com.


For more information regarding CYBSEC: www.cybsec.com
(c) 2007 - CYBSEC S.A. Security Systems
- --
- ----------------------------------------------
CYBSEC S.A. Security Systems
CYBSEC-LABS Security Research Team
Tel/Fax: (54-11) 4371-4444
Web: http://www.cybsec.com
PGP: http://www.cybsec.com/pgp/advisories.txt
- ----------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFr5HCvWPewvmdrSgRApYcAJ9ge3bUP2o6Sjlm1bABDzjucdQP6wCfRMEc
+G3qS/EunPwkD6GJqkwEUVA=
=ocHG
-----END PGP SIGNATURE-----
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close