Latest news
Sybase Adaptive Server buffer overflow in xp_freedll extended stored procedure
http://www.appsecinc.com/resources/alerts/sybase/02-0003.html
To determine if you should apply this hot fix, download AppDetective for Sybase from http://www.sybasesecurity.net/products/appdetective/sybase/.
Risk level: High
Threat: Allows a non-privileged login to gain full control of the server
Versions Affected: Sybase Adaptive Server 12.0 and 12.5
Summary:
The extended stored procedure xp_freedll contains a buffer overflow that may allow an attacker to overwrite the stack and execute arbitrary code under the security context of the server. Execute permissions are granted to public in the sybsystemprocs database on this extended stored procedure.
Details:
Sybase Adaptive Server provides an extended stored procedure (ESP) called xp_freedll in the database sybsystemprocs. This ESP is used to release a DLL that has been loaded by another extended stored procedure.
Xp_freedll accepts a single parameter that is the name of the DLL to free. Xp_freedll does not validate the length of the string passed into the first parameter. It then attempts to copy an overly long string into a small memory buffer. This memory copy results in the stack and the stack pointer being overwritten with the buffer. Once the stack pointer is overwritten, execution can be redirected to an arbitrary location in memory and opcodes injected into the long string passed to the ESP can be executed. This allows the attacker to run arbitrary code under the security context of the extended stored procedure server.
Below is an example of overflowing the buffer using the SQL tool isql.exe.
Memory corruption first occurs with a buffer of length 45.
1> xp_freedll 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.dll'
2> GO
Msg 11496, Level 16, State 7:
Procedure 'xp_freedll', Line 2:
Cannot read from site 'MRFREEZE_XP'. Please check the XP Server error log file for detailed error description. (return status = -6)
With a buffer of 53 bytes in length, an exception is thrown.
1> xp_freedll 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.dll'
2> GO
Encountered an exception(0) in ESP xp_freedll in DLL sybsyesp. If this is an user DLL check the code else contact Sybase Technical Support.
(return status = 1)
The following entries are recorded into the event logs. 11403: Encountered an exception(0) in ESP xp_freedll in DLL sybsyesp. If this is an user DLL check the code else contact Sybase Technical Support.
11403: Encountered an exception(193) in ESP xp_freedll in DLL sybsyesp. If this is an user DLL check the code else contact Sybase Technical Support.
11403: Encountered an exception(997) in ESP xp_freedll in DLL sybsyesp. If this is an user DLL check the code else contact Sybase Technical Support.
At 54 bytes in length, the follow memory locations appear in the event logs:
11451: MRFREEZE_XP: XP Server Error: 16142/10/1: Server process
address 0x696c6c not in pool in 'srv_senddone()' .
11451: MRFREEZE_XP: XP Server Error: 16142/10/1: Server process
address 0x696c6c not in pool in 'srv_sendinfo()' .
11451: MRFREEZE_XP: XP Server Error: 16142/10/1: Server process
address 0x696c6c not in pool in 'srv_sendstatus' .
At 55 bytes in length, the follow memory locations appear in the event logs:
11451: MRFREEZE_XP: XP Server Error: 16142/10/1: Server process address 0x642e5858 not in pool in 'srv_senddone()' .
Notice that the memory location has been modified to include 5858 which is the X we used in the buffer overflow.
As we continue to increase the buffer size, we see that the address is completely overwritten by the buffer.
11451: MRFREEZE_XP: XP Server Error: 16142/10/1: Server process
address 0x58585858 not in pool in 'srv_sendstatus' .
Fix:
Execute permissions on the extended stored procedure xp_freedll in the sybsystemprocs database should be revoked from public.
You should also apply the following patches:
12.5.0.2 - 11/14/2002
12.0.0.6 ESD#1 - 11/5/2002
These patches can be downloaded from http://downloads.sybase.com/swd/swx
Thank you,
support@appsecinc.com
Application Security, Inc.
phone: 212-490-6022
fax: 212-490-6456
-Protection Where It Counts-
Application Security, Inc.
www.appsecinc.com
As pioneers in application security, we are an organization dedicated to the security, defense, and protection of one of the most commonly overlooked areas of security - the application layer. Application Security, Inc. provides solutions to proactively secure (penetration testing/vulnerability assessment), actively defend/monitor (intrusion detection), and protect (encryption) your most critical applications.
Spotlight

A closer look at Mega cloud storage
Posted on 21 May 2013. | Once a novelty, nowadays many cloud storage services are fighting for their piece of the market in the virtual world. Mega offers 50GB of free space with great pricing on Pro accounts.

The CSO perspective on healthcare security and compliance
Posted on 20 May 2013. | Randall Gamby is the CSO of the Medicaid Information Service Center of New York. In this interview he discusses healthcare security and compliance challenges and offers a variety of tips.

Cyber espionage campaign uses professionally-made malware
Posted on 20 May 2013. | A massive cyber espionage campaign has been hitting government ministries, IT companies, academic research institutions, and more.

Ransomware adds password stealing to its arsenal
Posted on 17 May 2013. | Microsoft researchers are warning about a new variant of the well-known Reveton ransomware doing rounds.

IT security jobs: What's in demand and how to meet it
Posted on 15 May 2013. | Let's say you want a career in information security, where do you start? What credentials do you need? What are employers looking for? Read on to find some answers.
By subscribing to our early morning news update, you will receive a daily digest of the latest security news published on Help Net Security.
With over 500 issues so far, reading our newsletter every Monday morning will keep you up-to-date with security risks out there.






