Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-28933

CVE-2024-28933: Microsoft ODBC Driver RCE Vulnerability

CVE-2024-28933 is a remote code execution vulnerability in Microsoft ODBC Driver for SQL Server that enables attackers to execute arbitrary code. This article covers the technical details, affected versions, and mitigation strategies.

Published:

CVE-2024-28933 Overview

CVE-2024-28933 is a remote code execution vulnerability in the Microsoft ODBC Driver for SQL Server. The flaw is rooted in an integer underflow condition ([CWE-191]) that affects the driver across Windows, Linux, and macOS, as well as bundled deployments inside SQL Server 2019, SQL Server 2022, Visual Studio 2019, and Visual Studio 2022. An attacker can trigger code execution in the context of the client process when a user is induced to connect to an attacker-controlled SQL Server endpoint. Microsoft addressed the issue through its April 2024 security update cycle.

Critical Impact

Successful exploitation allows arbitrary code execution on the system running the vulnerable ODBC client, leading to full compromise of confidentiality, integrity, and availability.

Affected Products

  • Microsoft ODBC Driver for SQL Server (Windows, Linux, macOS)
  • Microsoft SQL Server 2019 and SQL Server 2022 (x64)
  • Microsoft Visual Studio 2019 and Visual Studio 2022

Discovery Timeline

  • 2024-04-09 - CVE-2024-28933 published to NVD with Microsoft security update
  • 2025-01-14 - Last updated in NVD database

Technical Details for CVE-2024-28933

Vulnerability Analysis

The Microsoft ODBC Driver for SQL Server processes Tabular Data Stream (TDS) protocol messages returned by a SQL Server endpoint. The vulnerability is classified as an integer underflow ([CWE-191]) within the driver's response-handling logic. When the driver computes buffer sizes or offsets from server-supplied length fields, a crafted value can wrap below zero and be interpreted as a very large unsigned quantity. The resulting out-of-bounds memory access can be steered toward arbitrary code execution in the client process.

Exploitation requires user interaction: a victim must initiate or accept an ODBC connection to a malicious server. The attack succeeds over the network, requires no prior authentication on the target client, and yields high impact across confidentiality, integrity, and availability.

Root Cause

The underlying defect is improper validation of size or length values received from the server side of an ODBC session. An attacker-controlled length is used in arithmetic that produces a negative intermediate value, which underflows to a large positive value when cast to an unsigned type. Subsequent memory operations rely on this corrupted size, enabling heap corruption that the attacker can shape into control-flow hijacking.

Attack Vector

An attacker hosts a malicious SQL Server endpoint and lures a victim, often through phishing, malicious shortcuts, or a compromised application configuration, into connecting using a vulnerable ODBC client. Tools such as sqlcmd, applications linking msodbcsql, and integrated tooling within Visual Studio and SQL Server are common triggers. Once the connection is established, the attacker returns a crafted TDS response that drives the integer underflow during message parsing.

No verified public proof-of-concept code is available. Refer to the Microsoft Security Update CVE-2024-28933 advisory for vendor technical details.

Detection Methods for CVE-2024-28933

Indicators of Compromise

  • Outbound TCP connections to untrusted hosts on port 1433 or other TDS listener ports originating from developer workstations or application servers.
  • Unexpected child processes spawned by sqlcmd.exe, bcp.exe, devenv.exe, or processes loading msodbcsql17.dll or msodbcsql18.dll.
  • Crash dumps or Windows Error Reporting events referencing msodbcsql*.dll with access violations during TDS response parsing.

Detection Strategies

  • Inventory hosts running vulnerable versions of the ODBC Driver for SQL Server using software asset management or endpoint queries against installed package metadata.
  • Hunt for ODBC client processes initiating connections to SQL Server hosts outside approved database subnets.
  • Correlate process-load events for msodbcsql* libraries with subsequent suspicious child processes, shellcode-like memory regions, or LOLBin execution.

Monitoring Recommendations

  • Enable command-line and module-load auditing on developer and database administrator workstations.
  • Restrict egress to TDS ports through network segmentation and log all permitted flows for review.
  • Alert on Visual Studio or SQL Server Management Studio invoking unusual scripting hosts such as powershell.exe or cmd.exe shortly after a database connection event.

How to Mitigate CVE-2024-28933

Immediate Actions Required

  • Apply the Microsoft April 2024 security update for the ODBC Driver for SQL Server on all affected Windows, Linux, and macOS endpoints.
  • Update SQL Server 2019, SQL Server 2022, Visual Studio 2019, and Visual Studio 2022 installations to versions that ship the patched driver.
  • Block outbound TDS traffic (default TCP 1433) from end-user workstations to untrusted networks at the perimeter and host firewall.

Patch Information

Microsoft released fixed builds of the ODBC Driver for SQL Server through the April 2024 update. Refer to the Microsoft Security Update CVE-2024-28933 advisory for the specific driver versions, package downloads, and platform-specific installation guidance. SQL Server and Visual Studio cumulative updates released in the same cycle replace the bundled driver.

Workarounds

  • Until patches are deployed, prohibit connections from ODBC clients to SQL Server endpoints outside of trusted database VLANs.
  • Enforce application allowlisting to limit which processes can load msodbcsql17.dll or msodbcsql18.dll.
  • Train developers and database administrators to reject unexpected connection prompts and to validate server hostnames before authenticating.
bash
# Example: verify installed ODBC driver version on Linux
odbcinst -q -d -n "ODBC Driver 18 for SQL Server"
dpkg -l | grep msodbcsql18

# Example: block outbound TDS to untrusted networks (iptables)
iptables -A OUTPUT -p tcp --dport 1433 -d 10.0.0.0/8 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 1433 -j DROP

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.