JDBC Driver for SQL Server Spoofing Vulnerability (CVE-2025-59250)
The JDBC driver for SQL Server did not properly validate the Common Name field in TLS certificates, so a certificate with a spoofed CN in the OU field was trusted. An attacker who tricked a victim into connecting to a malicious server could intercept SQL credentials and perform a machine-in-the-middle attack on encrypted database traffic.
Originally disclosed on Microsoft
Description
Improper input validation in JDBC Driver for SQL Server allows an unauthorized attacker to perform spoofing over a network.
FAQ
How could an attacker exploit this vulnerability? An attacker could exploit the vulnerability by tricking a victim into connecting to a malicious server using techniques like DNS poisoning or phishing. Once connected, the attacker presents a legitimate TLS certificate with a spoofed Common Name (CN) in the Organizational Unit (OU) field. The JDBC driver mistakenly trusts this certificate, allowing the attacker to intercept SQL credentials and perform a machine-in-the-middle attack on encrypted database traffic.
JDBC Driver for SQL Server
JDBC Driver for 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 improper input validation of the certificate's Common Name, which the driver accepted when placed in the Organizational Unit field instead of the expected field.
Impact
An attacker could intercept SQL credentials and perform a machine-in-the-middle attack on encrypted database traffic.
What the attacker needed
Victim connects to a malicious server; attacker has a legitimate TLS certificate; DNS poisoning or phishing
The fix
The driver should be fixed to validate the certificate's Common Name in the correct field and reject certificates where it appears only in the Organizational Unit field.
How it was found
- Trick the victim into connecting to a malicious server using techniques such as DNS poisoning or phishing.
- Present a legitimate TLS certificate with a spoofed Common Name in the Organizational Unit field.
- Rely on the JDBC driver trusting the certificate, then intercept SQL credentials and machine-in-the-middle the encrypted database traffic.
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 database client connects to a server, it checks a digital certificate to confirm it is talking to the right machine. This driver checked the wrong part of the certificate, so a fake server could present a certificate that looked valid. That let an attacker sit between the user and the real database and steal login details.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.