Microsoft SQL Server up to 2005 sp_replwritetovarbin memory corruption
| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 4.8 | $0-$5k | 0.00 |
Summary
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.
Details
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.
Product
Type
Vendor
Name
Version
License
Website
- Vendor: https://www.microsoft.com/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔍VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 5.0VulDB Meta Temp Score: 4.8
VulDB Base Score: 5.0
VulDB Temp Score: 4.8
VulDB Vector: 🔍
VulDB Reliability: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍
NVD Base Score: 🔍
Exploiting
Class: Memory corruptionCWE: 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-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
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 Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: DisableStatus: 🔍
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: 🔍
Timeline
12/09/2008 🔍12/09/2008 🔍
12/09/2008 🔍
12/09/2008 🔍
12/09/2008 🔍
12/10/2008 🔍
12/10/2008 🔍
12/10/2008 🔍
12/17/2008 🔍
12/17/2008 🔍
12/19/2008 🔍
12/22/2008 🔍
02/11/2009 🔍
05/25/2025 🔍
Sources
Vendor: microsoft.comAdvisory: 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
Entry
Created: 12/19/2008 12:26Updated: 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.
No comments yet. Languages: en.
Please log in to comment.