Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain low-privilege SQL login
-
DeliveryConnect to SQL Server over network
-
ExploitInvoke feature with controlled file path
-
ExecutionRedirect path to attacker-controlled location
-
PersistExecute code as service account
-
ImpactFull compromise of database host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V5 - File Handling File name/path control
|
| Exploitation Conditions | Exploitation requires an authenticated SQL Server session at low privilege (CVSS PR:L) reachable over the network (AV:N), with no user interaction (UI:N) and low complexity (AC:L). The attacker must be able to reach a SQL Server feature that constructs a server-side file path from attacker-controlled input (CWE-73 external control of file name/path) - such as a path parameter in a file-handling database operation. Limiting factors: the attacker must already possess valid database credentials or a foothold via an application account, so unauthenticated internet exploitation is NOT possible; the target must be one of the listed unpatched 2016 SP3 / 2017 / 2019 / 2022 / 2025 builds; and reaching the vulnerable code path depends on the attacker's login having permission to invoke the affected file-path feature. |
| Impact | The signals are mixed and warrant a measured priority. CVSS 3.1 (AV:N/AC:L/PR:L/UI:N, C:H/I:H/A:H = 8.8) indicates network-reachable exploitation with low attacker complexity and no user interaction, but crucially PR:L means the attacker must already hold authenticated, low-privilege access to the SQL Server - this is not an unauthenticated internet-facing bug. SSVC reinforces a lower operational urgency: Exploitation is 'none' (no observed active exploitation), Automatable is 'no', while Technical Impact is 'total'. EPSS is very low (0.06%, 20th percentile) and the CVE is NOT on CISA KEV, so despite publicly available exploit code, there is no evidence of widespread or automated exploitation. The realistic risk is elevated for environments where lower-privileged users, application service accounts, or multi-tenant databases can reach the SQL instance, and lower for well-segmented instances with tightly controlled logins. Note a minor conflict: the vendor Tags label this 'Information Disclosure', yet the CVSS and description describe network code execution with full CIA impact - the CVSS/description take precedence, but verify the exact impact with the Microsoft advisory. |
| Exploit ScenarioDerived | An attacker who has obtained a low-privileged SQL Server login - for example through a compromised application service account or credential reuse - connects over the network and invokes a database operation whose file name/path parameter they control, steering it to an attacker-influenced location to write or execute code in the service account's context. Because publicly available exploit code exists and no user interaction is required, a knowledgeable attacker with valid credentials could operationalize this quickly, though full code execution here is a targeted, not mass-scannable, action (SSVC Automatable: no). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 23, 2026
Remote code execution in Microsoft SQL Server (2016 SP3 through 2025) lets an authenticated attacker with low-privilege database access run arbitrary code on the server via external control of a file name or path (CWE-73). The CVSS 3.1 base score is 8.8 with high impact to confidentiality, integrity, and availability; publicly available exploit code exists, though the flaw is not on CISA KEV and EPSS remains very low (0.06%, 20th percentile), indicating minimal observed exploitation to date. Microsoft has released patched builds across all affected branches.
RemediationAI
Apply the Microsoft security update for your servicing branch to reach the fixed build: SQL Server 2016 SP3 GDR 13.0.6490.1 (Azure Connect Feature Pack 13.0.7085.1), 2017 GDR 14.0.2110.2 or CU 31 14.0.3530.2, 2019 GDR 15.0.2170.1 or CU 32 15.0.4470.1, 2022 GDR 16.0.1180.1 or CU 24 16.0.4252.3, and 2025 GDR 17.0.1115.1 or CU 4 (see advisory). Obtain exact packages from the Microsoft MSRC Update Guide at https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-40370. Because exploitation requires an authenticated low-privilege login (PR:L), until patching is complete reduce exposure by auditing and removing unnecessary database logins, enforcing least-privilege so application accounts cannot invoke file-path-dependent features, and network-restricting the SQL listener (TCP 1433 or your configured port) to trusted application hosts via firewall/segmentation - trade-off: tighter network ACLs may break legitimate remote clients and require an allowlist. Enable SQL auditing/monitoring on file-related operations to detect abuse in the interim. Do not disable core file features (backup/restore, bulk operations) blindly, as this can break maintenance jobs.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 10 packages in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability is a CWE-73 (External Control of File Name or Path) weakness in Microsoft SQL Server, a widely deployed relational database engine. Affected components span the SQL Server 2016 Service Pack 3 (GDR and Azure Connect Feature Pack), 2017 (GDR/CU 31), 2019 (GDR/CU 32), 2022 (GDR/CU 24), and 2025 (GDR/CU 4) product lines per the provided CPE strings (cpe:2.3:a:microsoft:microsoft_sql_server_*). CWE-73 arises when an application uses attacker-influenced input to construct a file path without adequate validation or canonicalization; in a database engine this typically manifests through features that read or write server-side files (e.g., backup/restore paths, bulk import/export, or extensibility hooks). Because SQL Server's file operations execute in the context of the database service account, controlling the path enables reaching or overwriting files that lead to code execution over the network.
Know when Microsoft Sql Server 2016 Service Pack 3 Gdr gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Network-reachable code execution requiring an existing low-privilege SQL login (PR:L), no user interaction, low complexity, yielding full CIA impact within the unchanged service scope.
Primary rating from Vendor (microsoft).
CVSS VectorVendor: microsoft
DescriptionCVE.org
External control of file name or path in SQL Server allows an authorized attacker to execute code over a network.
Executive ViewAI
Microsoft SQL Server versions 2016 SP3 through 2025 contain a high-severity remote code execution vulnerability (CVE-2026-40370) that allows authenticated database users to execute arbitrary code on the server. While publicly available exploit code exists, observed exploitation remains minimal, and patches are available across all affected versions, enabling prompt risk mitigation.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Privilege elevation in Microsoft SQL Server (2016 SP3 through 2025) allows an authenticated attacker to inject crafted S
SQL injection in Microsoft SQL Server (versions 2016 through 2025) enables an authenticated attacker to escalate privile
Remote code execution in Microsoft SQL Server (2016 SP3 through 2025) arises from unsafe deserialization of untrusted da
Privilege escalation via external file path control in Microsoft SQL Server affects versions 2016 through 2025, exploita
Privilege escalation in Microsoft SQL Server lets an authenticated, low-privileged database user execute crafted SQL tha
Local privilege escalation in Microsoft SQL Server allows an authenticated low-privileged user with local access to expl
EUVD-2026-29652
GHSA-c4mg-2cmw-c72r
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB