CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-32167
6.70.05%

CVE-2026-32167: Microsoft SQL Server Elevation of Privilege via Internal SQL Injection

Alon Barad
Alon Barad
Software Engineer

Apr 16, 2026·5 min read·5 visits

Active Exploitation

Executive Summary (TL;DR)

A critical SQL injection flaw in SQL Server internal system procedures allows highly privileged local users to escalate to full sysadmin or OS-level control. Patches are available in the April 2026 security updates.

CVE-2026-32167 is an Elevation of Privilege vulnerability in Microsoft SQL Server caused by improper neutralization of special elements (SQL Injection). Affecting multiple versions from 2016 to 2025, the flaw permits authenticated attackers with high database privileges to execute arbitrary SQL commands under elevated permissions, potentially compromising the host system.

Vulnerability Overview

Microsoft SQL Server contains a vulnerability (CVE-2026-32167) that allows an authenticated, high-privileged user to escalate their privileges within the database instance. The flaw originates in the database engine's processing of specific system stored procedures and dynamic management views. By exploiting this vulnerability, an attacker bypasses standard role-based access controls to execute arbitrary SQL commands.

The vulnerability is officially classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). It primarily affects the internal parameter handling mechanisms of the SQL Server engine across multiple supported versions, including 2016 through 2025. Microsoft released patches for this issue during the April 14, 2026 Patch Tuesday update cycle.

Although the base CVSS score is 6.7 (Medium), the severity of the concrete impact is high. The medium scoring reflects the stringent prerequisite that an attacker must already possess high-level privileges within the database environment. Consequently, the attack surface is limited to insiders or threat actors who have already compromised highly privileged accounts during an intrusion.

Root Cause Analysis

The root cause of CVE-2026-32167 is insufficient input sanitization within specific internal system functions and stored procedures. The database engine fails to properly parameterize or escape user-supplied strings before concatenating them into dynamic SQL statements executed internally. This lack of neutralization allows malicious input to alter the syntactic structure of the resulting SQL command.

When a highly privileged user passes a crafted payload into the vulnerable parameter, the internal execution context misinterprets the input boundary. The injected payload appends new SQL directives or modifies existing internal queries. Because these internal procedures execute under elevated system contexts, the injected directives inherit those same elevated permissions.

The flaw demonstrates a failure in defense-in-depth within the SQL Server engine's internal architecture. System procedures that accept string inputs and subsequently execute dynamic SQL via sp_executesql or similar internal mechanisms must rigorously validate and strongly type all parameters. The absence of these strict controls in the affected procedures directly enables the injection condition.

Exploitation Mechanics

Exploitation requires the attacker to possess an established session on the target SQL Server instance. Furthermore, the authenticating account must hold significant database-level permissions, such as the db_owner role, though lacking global sysadmin authority. This prerequisite satisfies the High Privileges Required (PR:H) metric in the CVSS vector.

The attacker initiates the exploit by calling the vulnerable system stored procedure and supplying a specifically crafted string as an argument. The payload typically utilizes standard SQL injection techniques, such as appending single quotes, terminating the current statement with semicolons, and appending the malicious payload.

-- Example conceptual exploitation vector
EXEC sys.sp_vulnerable_internal_proc 
    @param = 'valid_input''; EXEC sp_addsrvrolemember ''attacker'', ''sysadmin''; --'

Upon execution, the database engine processes the concatenated string in the context of the SQL Server service account. The injected commands execute successfully, granting the attacker the specified elevated access. The attacker subsequently utilizes this access to execute secondary payloads or pivot further into the environment.

Impact Assessment

Successful exploitation results in a complete compromise of the SQL Server instance. The attacker gains the ability to execute arbitrary queries with sysadmin privileges or directly as the database service account. This level of access permits the unauthorized disclosure, modification, or destruction of all data residing within the compromised instance.

The vulnerability directly impacts the confidentiality, integrity, and availability of the database system, resulting in high scores across all three impact metrics. Attackers can exfiltrate sensitive tables, deploy ransomware payloads directly into database structures, or drop entire databases. The access also allows the modification of audit logs to conceal the intrusion.

Beyond the database boundary, the elevated access poses a severe risk to the underlying host operating system. Attackers with sysadmin privileges can enable advanced configuration options, such as xp_cmdshell, to execute arbitrary operating system commands. This mechanism frequently serves as a pivot point for lateral movement within the broader network environment.

Remediation and Mitigation

Administrators must apply the security updates provided by Microsoft in the April 2026 Patch Tuesday release to address the root cause. Microsoft has released specific updates for various branches, including Cumulative Updates (CU) and General Distribution Releases (GDR). System owners must verify their specific SQL Server version and apply the corresponding Knowledge Base (KB) update, such as KB5084815 for SQL Server 2022.

In environments where immediate patching is not feasible, administrators should enforce the principle of least privilege. Review all database users and roles to ensure that high-level permissions, such as db_owner or db_securityadmin, are restricted to strictly necessary service accounts and trusted personnel. Revoking these privileges from excessive accounts mitigates the primary attack vector.

Additionally, administrators should proactively harden the SQL Server instance to reduce the post-exploitation impact. Disable features such as xp_cmdshell, OPENROWSET, and OPENDATASOURCE unless explicitly required by business operations. Monitor SQL Server audit logs for abnormal execution patterns of system stored procedures by non-administrative users to detect potential exploitation attempts.

Technical Appendix

CVSS Score
6.7/ 10
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
EPSS Probability
0.05%
Top 83% most exploited

Affected Systems

Microsoft SQL Server 2016 SP3Microsoft SQL Server 2017Microsoft SQL Server 2019Microsoft SQL Server 2022Microsoft SQL Server 2025

Affected Versions Detail

Product
Affected Versions
Fixed Version
SQL Server 2016 SP3
Microsoft
13.0.0 to 13.0.6485.013.0.6485.1
SQL Server 2017
Microsoft
14.0.0 to 14.0.3525.014.0.3525.1
SQL Server 2019
Microsoft
15.0.0 to 15.0.4465.015.0.4465.1
SQL Server 2022
Microsoft
16.0.0 to 16.0.4250.016.0.4250.1
SQL Server 2025
Microsoft
17.0.1050.2 to 17.0.4030.017.0.4030.1
AttributeDetail
CWE IDCWE-89
Attack VectorLocal
CVSS Score6.7 (Medium)
EPSS Score0.00053
ImpactElevation of Privilege
Exploit Statusactive

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-89
SQL Injection

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Vulnerability Timeline

Vulnerability officially disclosed and patched by Microsoft
2026-04-14
Initial reports from security researchers highlight vulnerability risk
2026-04-14
Secondary reports suggest active exploitation detected in the wild
2026-04-15

References & Sources

  • [1]Microsoft Security Response Center (MSRC) Advisory
  • [2]Microsoft Support KB5084815
  • [3]Zero Day Initiative (ZDI) Blog
  • [4]CVE.org Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.