Microsoft SQL Server up to 2005 sp_replwritetovarbin memory corruption

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
4.8$0-$5k0.00

Summaryinfo

A vulnerability was found in Microsoft SQL Server up to 2005 and classified as problematic. This affects the function sp_replwritetovarbin. Such manipulation leads to memory corruption. This vulnerability is documented as CVE-2008-5416. The attack can be executed remotely. Additionally, an exploit exists. It is suggested to disable the affected component.

Detailsinfo

A vulnerability was found in Microsoft SQL Server up to 2005 (Database Software). It has been rated as problematic. Affected by this issue is the function sp_replwritetovarbin. The manipulation with an unknown input leads to a memory corruption vulnerability. Using CWE to declare the problem leads to CWE-119. The product performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer. Impacted is confidentiality, integrity, and availability. CVE summarizes:

Heap-based buffer overflow in Microsoft SQL Server 2000 SP4, 8.00.2050, 8.00.2039, and earlier; SQL Server 2000 Desktop Engine (MSDE 2000) SP4; SQL Server 2005 SP2 and 9.00.1399.06; SQL Server 2000 Desktop Engine (WMSDE) on Windows Server 2003 SP1 and SP2; and Windows Internal Database (WYukon) SP2 allows remote authenticated users to cause a denial of service (access violation exception) or execute arbitrary code by calling the sp_replwritetovarbin extended stored procedure with a set of invalid parameters that trigger memory overwrite, aka "SQL Server sp_replwritetovarbin Limited Memory Overwrite Vulnerability."

The weakness was released 12/09/2008 by Bernhard Mueller with SEC Consult (Website). The advisory is shared for download at sec-consult.com. This vulnerability is handled as CVE-2008-5416 since 12/10/2008. The attack may be launched remotely. A simple authentication is needed for exploitation. Technical details as well as a public exploit are known.

A public exploit has been developed by Guido Landi and been published 2 weeks after the advisory. The exploit is available at exploit-db.com. It is declared as highly functional. As 0-day the estimated underground price was around $25k-$100k. The vulnerability scanner Nessus provides a plugin with the ID 35635 (MS09-004: Vulnerability in Microsoft SQL Server Could Allow Remote Code Execution (959420) (uncredentialed check)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family Windows and running in the context l. The commercial vulnerability scanner Qualys is able to test this issue with plugin 90475 (Microsoft SQL Server Remote Memory Corruption Vulnerability (MS09-004)).

The best possible mitigation is suggested to be disabling the affected component. Attack attempts may be identified with Snort ID 15143. In this case the pattern s|00|p|00|_|00|r|00|e|00|p|00|l|00|w|00|r|00|i|00|t|00|e|00|t|00|o|00|v|00|a|00|r|00|b|00|i|00|n|00| is used for detection. Furthermore it is possible to detect and prevent this kind of attack with TippingPoint and the filter 6768.

The vulnerability is also documented in the databases at X-Force (47182), Exploit-DB (7501), Tenable (35635), SecurityFocus (BID 32710†) and OSVDB (50589†). VulDB is the best source for vulnerability data and more expert information about this specific topic.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 5.0
VulDB Meta Temp Score: 4.8

VulDB Base Score: 5.0
VulDB Temp Score: 4.8
VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Memory corruption
CWE: CWE-119
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Yes

Availability: 🔍
Access: Public
Status: Highly functional
Author: Guido Landi
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 35635
Nessus Name: MS09-004: Vulnerability in Microsoft SQL Server Could Allow Remote Code Execution (959420) (uncredentialed check)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Context: 🔍

OpenVAS ID: 800082
OpenVAS Name: Microsoft SQL Server sp_replwritetovarbin() BOF Vulnerability
OpenVAS File: 🔍
OpenVAS Family: 🔍

Saint ID: exploit_info/ms_sql_spreplwritetovarbin
Saint Name: Microsoft SQL Server spreplwritetovarbin Buffer Overflow

Qualys ID: 🔍
Qualys Name: 🔍

MetaSploit ID: ms09_004_sp_replwritetovarbin.rb
MetaSploit Name: MS09-004 Microsoft SQL Server sp_replwritetovarbin Memory Corruption
MetaSploit File: 🔍

Exploit-DB: 🔍

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Disable
Status: 🔍

0-Day Time: 🔍
Exploit Delay Time: 🔍
Snort ID: 15143
Snort Message: SQL sp_replwritetovarbin unicode vulnerable function attempt
Snort Pattern: 🔍
TippingPoint: 🔍

McAfee IPS: 🔍
McAfee IPS Version: 🔍

ISS Proventia IPS: 🔍
PaloAlto IPS: 🔍
Fortigate IPS: 🔍

Timelineinfo

12/09/2008 🔍
12/09/2008 +0 days 🔍
12/09/2008 +0 days 🔍
12/09/2008 +0 days 🔍
12/09/2008 +0 days 🔍
12/10/2008 +0 days 🔍
12/10/2008 +0 days 🔍
12/10/2008 +0 days 🔍
12/17/2008 +7 days 🔍
12/17/2008 +0 days 🔍
12/19/2008 +2 days 🔍
12/22/2008 +3 days 🔍
02/11/2009 +51 days 🔍
05/25/2025 +5946 days 🔍

Sourcesinfo

Vendor: microsoft.com

Advisory: sec-consult.com
Researcher: Bernhard Mueller
Organization: SEC Consult
Status: Confirmed
Confirmation: 🔍

CVE: CVE-2008-5416 (🔍)
GCVE (CVE): GCVE-0-2008-5416
GCVE (VulDB): GCVE-100-3896

OVAL: 🔍
IAVM: 🔍

CERT: 🔍
X-Force: 47182 - Microsoft SQL Server sp_replwritetovarbin() buffer overflow, High Risk
SecurityFocus: 32710 - Microsoft SQL Server 'sp_replwritetovarbin' Remote Memory Corruption Vulnerability
Secunia: 33034 - Microsoft SQL Server "sp_replwritetovarbin()" Buffer Overflow, Less Critical
OSVDB: 50589 - Microsoft SQL Server 2000 sp_replwritetovarbin() Stored Procedure Overflow
SecurityTracker: 1021490 - Microsoft SQL Server Heap Overflow Lets Remote Authenticated Users Execute Arbitrary Code
Vulnerability Center: 20208 - [MS09-004] Microsoft SQL Server \, High
Vupen: ADV-2008-3380

scip Labs: https://www.scip.ch/en/?labs.20161013

Entryinfo

Created: 12/19/2008 12:26
Updated: 05/25/2025 01:48
Changes: 12/19/2008 12:26 (115), 08/09/2017 14:07 (7), 03/17/2021 06:44 (2), 11/19/2024 10:16 (15), 01/05/2025 20:08 (1), 05/25/2025 01:48 (2)
Complete: 🔍
Cache ID: 216:D03:103

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Want to stay up to date on a daily basis?

Enable the mail alert feature now!