CVE-2026-40370: SQL Server Remote Code Execution Vulnerability

Overview

Severity
High (CVSS 8.8)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C
Category
Remote Code Execution
Exploit Status
Not Exploited
Exploitation Likelihood
Less Likely
Patch Tuesday
2026-May
Released
2026-05-12

Description

External control of file name or path in SQL Server allows an authorized attacker to execute code over a network.

FAQ

How could an attacker exploit this vulnerability? An authenticated attacker with explicit permissions could exploit the vulnerability by logging in to the SQL server and could then elevate their privileges to sysadmin. According to the CVSS metric, the attack vector is network (AV:N), and privilege required is low (PR:L). What is the target used in the context of the remote code execution? The attacker for this vulnerability could target the server accounts in an arbitrary or remote code execution. As an authenticated user, the attacker could attempt to trigger malicious code in the context of the server's account through a network call. The privilege requirement is low because the attacker needs to be authenticated as a normal user. I am running SQL Server on my system. What action do I need to take? Update your relevant version of SQL Server. Any applicable driver fixes are included in those updates. There are GDR and/or CU (Cumulative Update) updates offered for my version of SQL Server. How do I know which update to use? First, determine your SQL Server version number. For more information on determining your SQL Server version number, see Microsoft Knowledge Base Article 321185 - How to determine the version, edition, and update level of SQL Server and its components. Second, in the following table, locate your version number or the version range that your version number falls within. The corresponding update is the one you need to install. Note If your SQL Server version number is not represented in the table below, your SQL Server version is no longer supported. Please upgrade to the latest Service Pack or SQL Server product to apply this and future security updates. Update Number Title Version Apply if current product version is… This security update also includes servicing releases up through… 5089899 Security update for SQL Server 2025 CU4+GDR 17.0.4040.1 17.0.4006.2 - 17.0.4035.5 KB5081495 - Previous SQL2025 RTM CU4 5091223 Security update for

Affected Products (10)

SQL Server

  • Microsoft SQL Server 2025 for x64-based Systems (CU4)
  • Microsoft SQL Server 2022 for x64-based Systems (CU 24)
  • Microsoft SQL Server 2017 for x64-based Systems (GDR)
  • Microsoft SQL Server 2019 for x64-based Systems (GDR)
  • Microsoft SQL Server 2016 for x64-based Systems Service Pack 3 (GDR)
  • Microsoft SQL Server 2016 for x64-based Systems Service Pack 3 Azure Connect Feature Pack
  • Microsoft SQL Server 2017 for x64-based Systems (CU 31)
  • Microsoft SQL Server 2022 for x64-based Systems (GDR)
  • Microsoft SQL Server 2025 for x64-based Systems (GDR)
  • Microsoft SQL Server 2019 for x64-based Systems (CU 32)

Security Updates (10)

Acknowledgments

<a href="https://twitter.com/chudypb">Piotr Bazydło (@chudypb)</a>

Revision History

  • 2026-05-12: Information published.