Microsoft ODBC Driver Remote Code Execution Vulnerability (CVE-2024-21347)
A flaw in the Microsoft ODBC Driver for SQL Server allowed a malicious SQL database server to send specially crafted replies to a connecting client and execute arbitrary code in the context of the user's SQL client application. An attacker needed to trick an authenticated victim into connecting to the malicious database before exploitation could occur.
Originally disclosed on Microsoft
FAQ
According to the CVSS metric, the attack complexity is high (AC:H). What does that mean for this vulnerability? Successful exploitation of this vulnerability requires an attacker to take additional actions prior to exploitation to prepare the target environment.
FAQ
According to the CVSS metric, the attack vector is network (AV:N) and the user interaction is required (UI:R). What is the target context of the remote code execution? An authenticated victim who is connected to the network must be tricked or persuaded to connect to a malicious SQL database using their SQL client application. After the connection is made, the server can send specially crafted replies to the client that exploit the vulnerability and permit execution of arbitrary code within the context of the user's SQL client application.
FAQ
According to the CVSS metric, user interaction is required (UI:R) and privileges required are none (PR:N). What does that mean for this vulnerability? An unauthorized attacker must wait for a user to initiate a connection.
SQL Server
SQL Server
Microsoft
Microsoft
Customer Action Required
Yes
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the ODBC driver failed to properly validate or handle specially crafted replies from a server, leading to memory corruption during the connection handshake.
Impact
An attacker who gets a victim to connect to a malicious SQL database could execute arbitrary code within the context of the user's SQL client application, though exploitation requires preparation of the target environment and user interaction.
What the attacker needed
Victim connects to a malicious SQL database; attacker prepares the target environment
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program like a SQL client connects to a database, the two sides exchange messages. Here, a fake database server could send back a reply that the driver mishandled, letting the server run its own code on the victim's computer. The catch is that the victim first has to be persuaded to connect to that malicious server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.