Home Page | Skip to Navigation | Skip to Content | Skip to Search | Skip to Footer

Preemptive Protection against Microsoft SQL Server sp_replwritetovarbin Limited Memory Overwrite Vulnerability (MS09-004)

Subscribe

Check Point Reference: CPAI-2009-008
Date Published:
Severity:
Last Updated:
Source: Microsoft Security Bulletin MS09-004
Industry Reference(s): CVE-2008-5416
Protection Provided by: VPN-1
  • NGX R65
  • NGX R62
  • NGX R61
  • NGX R60
VSX
  • NGX R65
InterSpect
  • NGX
IPS-1
  • IPS-1
  • IPS-1 NGX R65
Who is Vulnerable?
SQL Server 2000 SP4
SQL Server 2000 (Itanium) SP4
SQL Server 2005 SP1
SQL Server 2005 SP2
SQL Server 2005 x64 Edition SP1
SQL Server 2005 x64 Edition SP2
SQL Server 2005 with SP1 (Itanium)
SQL Server 2005 with SP2 (Itanium)
Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) SP4
Microsoft SQL Server 2005 Express Edition SP1
Microsoft SQL Server 2005 Express Edition SP2
Microsoft SQL Server 2005 Express Edition with Advanced Services SP1
Microsoft SQL Server 2005 Express Edition with Advanced Services SP2
Microsoft SQL Server 2000 Desktop Engine (WMSDE)
Windows Internal Database (WYukon) SP2
Vulnerability Description
A remote code execution vulnerability has been reported in Microsoft SQL Server. Microsoft SQL Server is a relational database management system (RDBMS). The flaw is in the way that SQL Server checks parameters in the "sp_replwritetovarbin" extended stored procedure. By sending a specially crafted SQL script to a target server, a remote attacker may trigger this vulnerability to execute arbitrary code on the affected system.
Update/Patch Available
Apply patches:
Microsoft Security Bulletin MS09-004
Vulnerability Details
The vulnerability in the MSSQL extended stored procedure, "sp_replwritetovarbin," is due to an invalid parameter check. To exploit this issue, an attacker may create a query that calls the vulnerable extended stored procedure with an invalid parameter. Successful exploitation may allow the attacker to take complete control of an affected system.

Protection Overview
Users of SmartDefense Services and IPS-1 are preemptively protected against this vulnerability if the MS-SQL Server protection for blocking this vulnerablity in the Protection section of CPAI-2008-189 has been applied. No update is required to address this vulnerability.

By enabling this protection, SmartDefense Services will detect and block attempts to exploit this vulnerability. IPS-1 will detect and block attempts to access the sp_replwritetovarbin stored procedure.

To configure the defense, select your product from the list below and follow the related protection steps.

VPN-1 NGX R65 & R62

How Can I Protect My Network?
1. In the SmartDefense tab, click Application Intelligence > MS-SQL.
2. Select the following protection:

MS-SQL Server sp_replwritetovarbin Stored Procedure Buffer Overflow

3. In the configuration pane, under Settings > Mode, check Active.
4. The default port for MS-RPC is TCP 1433. In order to configure the protection to run on a different port, click on Application Intelligence > MS-SQL > MS-SQL Server protocol. In the configuration pane, choose the desired "MS-SQL Server Port".
5. Install policy on all modules.

How Do I Know if My Network is Under Attack?
SmartView Tracker will log the following entries:

Attack Name: Microsoft SQL Server Protection Violation
Attack Information: MS-SQL server sp_replwritetovarbin stored procedure buffer overflow

VPN-1 NGX R61 & R60

How Can I Protect My Network?
1. In the SmartDefense tree, click Application Intelligence > MS-SQL.
2. Select the following:

MS-SQL Server sp_replwritetovarbin Stored Procedure Buffer Overflow

3. The default port for MS-RPC is TCP 1433. In order to configure the protection to run on a different port, click on Application Intelligence > MS-SQL > MS-SQL Server protocol. In the configuration pane, choose the desired "MS-SQL Server Port".
4. Install policy on all modules.

How Do I Know if My Network is Under Attack?
SmartView Tracker will log the following entries:

Attack Name: Microsoft SQL Server Protection Violation
Attack Information: MS-SQL server sp_replwritetovarbin stored procedure buffer overflow

VPN-1 VSX NGX R65

How Can I Protect My Network?
1. In the SmartDefense tab, click Application Intelligence > MS-SQL.
2. Select the following protection:

MS-SQL Server sp_replwritetovarbin Stored Procedure Buffer Overflow

3. In the configuration pane, under Settings > Mode, check Active.
4. The default port for MS-RPC is TCP 1433. In order to configure the protection to run on a different port, click on Application Intelligence > MS-SQL > MS-SQL Server protocol. In the configuration pane, choose the desired "MS-SQL Server Port".
5. Install policy on all modules.

How Do I Know if My Network is Under Attack?
SmartView Tracker will log the following entries:

Attack Name: Microsoft SQL Server Protection Violation
Attack Information: MS-SQL server sp_replwritetovarbin stored procedure buffer overflow

InterSpect NGX

How Can I Protect My Network?
1. In the left pane, select Profiles > Default Protection and select the SmartDefense page of the profile.
2. In the SmartDefense tree, click Application Intelligence > MS-SQL.
3. Select the following:

MS-SQL Server sp_replwritetovarbin Stored Procedure Buffer Overflow

4. The default port for MS-RPC is TCP 1433. In order to configure the protection to run on a different port, click on Application Intelligence > MS-SQL > MS-SQL Server protocol. In the configuration pane, choose the desired "MS-SQL Server Port".
5. Install policy on all modules.

How Do I Know if My Network is Under Attack?
SmartView Tracker will log the following entries:

Attack Name: Microsoft SQL Server Protection Violation
Attack Information: MS-SQL server sp_replwritetovarbin stored procedure buffer overflow

IPS-1 & IPS-1 NGX R65

How Can I Protect My Network?
1. In the IPS-1 Policy Manager, click on the Protection tab.
2. In the Protection tree, click Application Intelligence > MS SQL, and select the SqlServer2000 protection group. 3. Click Mssql Stored Procedure Buffer Overflow (IPS-1 NGX R65 only).
4. In the configuration pane, under Settings, check Active.
5. Click on Install Policy.

How Do I Know if My Network is Under Attack?
Upon attack, the following entry will be logged:

Alert Name: Sqlserver 2k overflow detector
Description: Mssql Stored Procedure Buffer Overflow