Jul 20, 2026·5 min read·23 visits
An authenticated, low-privileged local attacker can exploit SQL command injection in SQL Server's internal administrative procedures to escalate privileges to sysadmin, gaining complete administrative control over the affected database instance.
CVE-2026-47296 is a high-severity local Elevation of Privilege (EoP) vulnerability in Microsoft SQL Server. The issue stems from the improper neutralization of special elements within internal database routines, allowing a low-privileged authenticated user to execute arbitrary database queries with the privileges of the database owner or system administrator. Microsoft has addressed this vulnerability in its July 2026 security updates.
Microsoft SQL Server utilizes internal stored procedures, functions, and views to perform system maintenance, metadata queries, and administrative integrations. To execute these specialized operations without granting excessive privileges to standard database users, the database engine implements context switching. These routines are designed to execute under the context of a highly privileged principal, such as the database owner (dbo) or a system administrator (sysadmin).
The vulnerability, classified under CWE-89, exists within the input validation mechanism of these administrative routines. If a low-privileged user possesses execution permissions on one of these objects, they can supply malformed parameters. The lack of structured separation between command logic and user-supplied data in the underlying routine allows input boundaries to be breached, enabling unauthorized execution of database commands.
The attack surface is exposed to any authenticated local user who can establish a database session. While typically classified as a local elevation of privilege vector, the threat model extends to multi-tenant environments, web applications utilizing shared database connections, and SaaS platforms that permit standard users to execute raw query parameters.
The root cause of CVE-2026-47296 resides in the insecure construction of dynamic SQL statements within administrative stored procedures. In Microsoft SQL Server, developers frequently use the WITH EXECUTE AS clause or cryptographic signatures to run routines with elevated rights. When these routines execute, SQL Server temporarily switches the execution context, granting the session the permissions of the target principal for the duration of the query execution.
The database engine relies on functions like EXEC() or sp_executesql to process commands dynamic in nature. A security boundary violation occurs when user input is concatenated directly into these execution strings. This implementation pattern fails to treat user-provided arguments as literal values, and instead parses them as executable syntax.
To trigger this vulnerability, an attacker must successfully connect to an affected SQL Server instance using valid database credentials. The attacker must then call a vulnerable system procedure and provide an input argument containing SQL command terminators and secondary payloads. When the database engine processes the concatenated string under the elevated context, it executes the secondary payload with the permissions of the elevated execution principal.
The following code structures demonstrate the insecure code pattern alongside the secure, parameterized pattern implemented by the official patches.
-- Vulnerable internal stored procedure pattern
CREATE PROCEDURE sys.sp_vulnerable_metadata_helper
@TargetTable NVARCHAR(256)
WITH EXECUTE AS OWNER -- Executes with db_owner context
AS
BEGIN
DECLARE @DynamicSQL NVARCHAR(MAX);
-- VULNERABILITY: Direct string concatenation of user input
SET @DynamicSQL = N'SELECT * FROM sys.objects WHERE name = ''' + @TargetTable + N'''';
-- Executes the concatenated command as the owner
EXEC(@DynamicSQL);
END;In the patched implementation, Microsoft removed string concatenation, replacing it with explicit parameter binding using sp_executesql. This ensures that user input is never evaluated as SQL syntax during the query compilation stage.
-- Patched stored procedure pattern
CREATE PROCEDURE sys.sp_vulnerable_metadata_helper
@TargetTable NVARCHAR(256)
WITH EXECUTE AS OWNER
AS
BEGIN
DECLARE @DynamicSQL NVARCHAR(MAX);
-- FIX: Use a parameterized query structure
SET @DynamicSQL = N'SELECT * FROM sys.objects WHERE name = @BoundTable';
-- FIX: Execute with rigid parameter definition preventing injection
EXEC sp_executesql
@DynamicSQL,
N'@BoundTable NVARCHAR(256)',
@BoundTable = @TargetTable;
END;This remediation completely closes the vulnerability vector because the query planner evaluates the parameter @BoundTable strictly as a string literal. Any attempt to supply special operators or command terminators inside the parameter results in a literal string search rather than administrative execution. The fix is considered structurally complete across the affected internal routines; however, custom database applications implementing similar dynamic patterns remain vulnerable if not manually remediated.
An attacker with minimal permissions (such as standard database-level public role access) can initiate the privilege escalation process. The attack does not require elevated server-level configuration or non-standard engine states.
The exploit payload is injected into the target stored procedure parameter. A typical exploit string terminates the primary query logic using a single quote character, inserts the malicious command, and comments out the remainder of the generated query string.
-- Example exploitation execution block
EXEC sys.sp_vulnerable_metadata_helper
@TargetTable = N"test_table'; ALTER SERVER ROLE sysadmin ADD MEMBER [low_priv_user]; --";When processed by the database engine, the resulting statement executes two distinct commands sequentially: the initial SELECT query, followed by the ALTER SERVER ROLE command. Because the entire execution occurs under the active context of OWNER, the secondary instruction succeeds, adding the attacker's database login to the highly privileged sysadmin server role.
Successful exploitation of CVE-2026-47296 results in a complete compromise of the affected database instance. The confidentiality, integrity, and availability of all data managed by the database server are impacted.
By gaining the sysadmin role, the attacker obtains the capability to read, alter, or delete any user or system database record. Furthermore, the attacker can modify instance configurations, establish persistence mechanisms, or execute arbitrary operating system commands by enabling advanced configuration options such as xp_cmdshell (if permitted by the underlying operating system service account privileges).
Although the CVSS score is 7.8 due to the local attack vector and prerequisite database authentication, the real-world risk is elevated in multi-tenant environments. In such architectures, multiple application frontends or customers share physical database instances, meaning a compromise of a single low-privileged account leads to total host exposure.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
SQL Server 2025 Microsoft | >= 17.0.1000.7 and < 17.0.1125.2 (GDR) | 17.0.1125.2 |
SQL Server 2022 Microsoft | >= 16.0.1000.6 and < 16.0.1190.2 (GDR) | 16.0.1190.2 |
SQL Server 2019 Microsoft | >= 15.0.2000.5 and < 15.0.2180.2 (GDR) | 15.0.2180.2 |
SQL Server 2017 Microsoft | >= 14.0.1000.169 and < 14.0.2120.1 (GDR) | 14.0.2120.1 |
SQL Server 2016 SP3 Microsoft | >= 13.0.6300.2 and < 13.0.6500.1 (GDR) | 13.0.6500.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-89 (SQL Injection) |
| Attack Vector | Local (Authenticated) |
| CVSS v3.1 Base Score | 7.8 |
| EPSS Score | 0.00232 |
| Impact Type | Privilege Escalation (up to sysadmin) |
| Exploit Status | none (no public PoC available) |
| CISA KEV Status | Not Listed |
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
A JNDI Injection and Deserialization Gadget vulnerability exists in mchange-commons-java prior to version 0.6.0. The com.mchange.v2.naming.JavaBeanObjectFactory component permits arbitrary class instantiation and setter invocation, allowing attackers to perform Server-Side Request Forgery (SSRF) and remote class loading.
SurrealDB versions supporting element-level SELECT permissions on arrays are vulnerable to a logical authorization bypass. Due to an index-shifting error during array filtration, restricted elements can skip permission checks and leak to unauthorized record users.
CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.
CVE-2026-73654 is a high-severity prototype pollution vulnerability in Trigger.dev. The flaw occurs during the handling of run-metadata updates through the PUT /api/v1/runs/:runId/metadata endpoint. Because user-supplied keys are parsed directly by the @jsonhero/path library without sanitization, an authenticated attacker with low privileges can pollute the global Object.prototype. This causes database queries via Prisma ORM to fail validation and induces unhandled exceptions in the Prometheus metrics client, resulting in a process-wide denial of service.
CVE-2026-73559 is an uncontrolled resource consumption vulnerability in the vLLM engine, specifically within the /v1/completions API endpoint, allowing authenticated attackers to cause application-level denial of service via unbounded prompt arrays.
A critical security bypass vulnerability in Argo Workflows allows authenticated attackers with workflow submission privileges to bypass 'Strict' or 'Secure' template referencing restrictions. By injecting unvalidated fields into the nested ArtifactGC configuration, attackers can execute arbitrary pod patches, leading to host namespace escape and cluster-wide privilege escalation.