cbcvebase.
CVE-2008-5416
published 2008-12-10

CVE-2008-5416: 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…

PriorityP272critical9CVSS 2.0
AVNACLAuSCCICAC
EXPLOIT
EPSS
87.04%
99.8th percentile
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."

Affected

7 ranges
VendorProductVersion rangeFixed in
microsoftsql_server——
microsoftsql_server——
vmwareesxi——
vmwarevmware_tools——
vmwarevmware_vcenter_server——
vmwarevmware_vsphere——
vmwarevmware_workstation——

Detection & IOCsextracted from sources · hover to see the quote

commandsp_replwritetovarbin↗
port1434↗
processsqlservr.exe↗
bytes↗
\x81\xc4\xf0\xef\xff\xff
  • →Monitor SQL Server audit logs and network traffic for sp_replwritetovarbin invocations, especially from non-replication accounts or via SQL injection vectors. ↗
  • →Snort/IDS rules were released on 2008-12-11 specifically to detect exploitation of CVE-2008-5416; reference VRT advisory vrt-rules-2008-12-11 for rule content. ↗
  • →The exploit uses a PrependEncoder stub (\x81\xc4\xf0\xef\xff\xff — ADD ESP,-4112) prepended to shellcode; scanning SQL Server payloads for this byte sequence can identify exploit attempts. ↗
  • →The exploit targets TCP port 1433 (default MSSQL) and uses UDP port 1434 for fingerprinting; anomalous UDP 1434 probes followed by TCP 1433 sp_replwritetovarbin calls are a strong indicator. ↗
  • →The exploit payload space is 512 bytes with EXITFUNC=seh; look for SEH-based shellcode patterns in MSSQL TDS streams following sp_replwritetovarbin calls. ↗
  • ·Exploitation requires an authenticated database session; however, the vulnerability can also be reached via SQL injection, lowering the effective authentication barrier. ↗
  • ·The MSSQL server service does not automatically restart by default after a crash; a failed exploit that crashes the service before stack hijack will result in a persistent DoS. ↗
  • ·Microsoft silently patched this vulnerability in SQL Server 2005 SP3 before the public MS09-004 advisory; environments on SP3 may already be protected without explicit patch awareness. ↗
  • ·The Metasploit SQL-injection variant (ms09_004_sp_replwritetovarbin_sqli) uses automatic target detection and ROP chains entirely within sqlservr.exe address space, making it highly reliable across multiple SP levels. ↗
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.