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-47295

CVE-2026-47295: SQL Injection and Privilege Escalation in Microsoft SQL Server

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 20, 2026·6 min read·11 visits

Executive Summary (TL;DR)

An authenticated, low-privileged network attacker can execute SQL injection attacks against internal system stored procedures in Microsoft SQL Server, leading to full privilege escalation up to sysadmin administrative control.

CVE-2026-47295 is a high-severity elevation of privilege vulnerability in Microsoft SQL Server (2016 through 2025). An authenticated, low-privileged attacker can execute remote SQL injection commands within system stored procedures to elevate permissions to sysadmin.

Vulnerability Overview

Microsoft SQL Server depends on various built-in system stored procedures, system catalog views, and administrative scripts to coordinate engine metadata, facilitate internal operations, and expose schema instrumentation. These procedures often execute under highly privileged security contexts, such as the system administrator (sa) account, using EXECUTE AS clauses to perform privileged server-level changes on behalf of unprivileged callers.

The attack surface exists in the Tabular Data Stream (TDS) endpoint, which represents the primary communication channel for SQL queries. An authenticated network user with basic session access (such as members of the public server role) can interact with specific, exposed system procedures. If these procedures do not safely handle input parameter boundaries, they allow arbitrary command sequences to be evaluated.

This vulnerability is classified as a severe SQL Injection vulnerability (CWE-89) within internal database routines. Unlike application-level SQL injection that aims to extract business database tables, this flaw operates within the internal database engine itself, allowing callers to bypass internal permission-checking gates.

Root Cause Analysis

The root cause of CVE-2026-47295 is the improper neutralization of special elements within internal system stored procedures that utilize dynamic T-SQL compilation. When these procedures construct commands dynamically by concatenating user-supplied arguments (such as schema identifiers, physical table names, or index values), they create a execution flow where SQL statements are parsed twice: once during the procedure invocation and once during dynamic execution.

The database engine processes these parameters without applying safe escaping or parameterized interfaces. Because the system procedure runs with elevated security definitions (such as EXECUTE AS OWNER or EXECUTE AS 'sa'), any commands appended to the parameter inherit the highly privileged context. This execution inheritance enables the payload to bypass standard Role-Based Access Control (RBAC) mechanisms enforced on standard database tables.

The dynamic parsing engine fails to differentiate between the structural code of the system procedure and the data supplied by the caller. Consequently, the SQL parser interprets injected operators, such as single-quote literal boundaries, semicolons, and comment marks, as instruction boundaries. The diagram below illustrates this privilege escalation process:

Code-Level Analysis

Due to the closed-source architecture of Microsoft SQL Server, researchers reconstruct the code-level flaw using T-SQL equivalents of the vulnerable internal routines. The vulnerable implementation concatenates the user input directly into a dynamic string before submitting it to the EXEC or sp_executesql engine:

-- Vulnerable Dynamic SQL Pattern in System Procedure
CREATE PROCEDURE sys.sp_vulnerable_internal
    @input_table_name NVARCHAR(256)
WITH EXECUTE AS 'sa'
AS
BEGIN
    DECLARE @sql NVARCHAR(MAX);
    -- VULNERABILITY: Direct string concatenation of user-supplied parameter
    -- This allows an attacker to break out of the string boundary using a single quote
    SET @sql = N'SELECT * FROM sys.objects WHERE name = ''' + @input_table_name + N'''';
    
    EXEC sp_executesql @sql;
END;

The security patch remediates this flaw by redesigning the Dynamic SQL compilation. Rather than concatenating parameters into the query structure, the engine utilizes strict parameterization inside the sp_executesql arguments or wraps input parameters with safety helpers such as the QUOTENAME() function, preventing execution of nested operations:

-- Patched Dynamic SQL Pattern using Parameterization
CREATE PROCEDURE sys.sp_vulnerable_internal
    @input_table_name NVARCHAR(256)
WITH EXECUTE AS 'sa'
AS
BEGIN
    DECLARE @sql NVARCHAR(MAX);
    -- REMEDIATION: The variable is kept as a strict parameter operand (@name)
    -- This ensures the query parser treats the input purely as data, not code
    SET @sql = N'SELECT * FROM sys.objects WHERE name = @name';
    
    EXEC sp_executesql @sql, N'@name NVARCHAR(256)', @name = @input_table_name;
END;

The fix is complete and robust because it shifts the evaluation model from dynamic evaluation to parameterized execution, which systematically neutralizing structural input variations.

Exploitation Methodology

To successfully exploit this vulnerability, an attacker must first obtain a valid login on the target SQL Server instance. The attacker does not require high-level permissions; any low-privileged database user with execution privileges on the affected internal system stored procedure is sufficient. The attack is executed over a network via standard database connection tools or application proxy configurations.

The execution payload is structured to close the open string literal, inject a distinct secondary administrative transaction, and comment out the trailing characters of the original query. The objective is typically to add the attacker's login to the sysadmin server role, granting complete administrative control over the database engine:

-- Conceptual Exploitation Input Payload
SELECT name FROM sys.objects;
EXEC sp_addsrvrolemember 'attacker_login', 'sysadmin'; --

When the system procedure receives this input, the dynamic query is assembled into an execution block containing the administrative promotion instruction. Because the procedure utilizes EXECUTE AS 'sa', the database engine executes the role membership modification with full administrative authorization, succeeding without raising security permission checks.

Impact Assessment

Successful exploitation of CVE-2026-47295 leads to complete administrative compromise of the affected Microsoft SQL Server instance. An attacker who elevates their privileges to sysadmin gains full control over all databases hosted on the instance, including read, write, and delete permissions on any transactional table or system configuration value.

The confidentiality, integrity, and availability of database assets are completely compromised. Attackers can export sensitive business records, modify audit configurations, establish persistent administrative backdoors, or delete data structures, causing operational disruption.

While the scope remains within the database instance (S:U), achieving sysadmin level control frequently allows attackers to leverage advanced features such as xp_cmdshell or SQL Server Agent jobs to run command-line actions on the underlying host operating system. This represents a significant pathway for host network lateral movement.

Detection and Mitigation Guidance

The primary remediation strategy is the immediate application of official Microsoft security updates. These patches are available through General Distribution Releases (GDR) and Cumulative Updates (CU) for all supported SQL Server versions, from SQL Server 2016 SP3 up to SQL Server 2025.

In environments where patches cannot be instantly applied, security teams must deploy network-level and host-level detection controls. Security professionals should implement auditing rules to log modifications to server role memberships, specifically looking for additions to the sysadmin role:

-- Monitor for server role membership changes
CREATE SERVER AUDIT [Audit_Role_Escalations]
TO FILE (FILEPATH = 'C:\SQLAudit\');
CREATE SERVER AUDIT SPECIFICATION [Spec_Role_Escalations]
FOR SERVER AUDIT [Audit_Role_Escalations]
ADD (SERVER_ROLE_MEMBER_CHANGE_GROUP);
ALTER SERVER AUDIT [Audit_Role_Escalations] WITH (STATE = ON);

Additional defensive mitigations include applying the principle of least privilege by revoking public execution rights on unused system stored procedures and enforcing strict network controls to isolate SQL Server ports (TCP 1433 and UDP 1434) from untrusted segments.

Technical Appendix

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

Affected Systems

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

Affected Versions Detail

Product
Affected Versions
Fixed Version
SQL Server 2016 Service Pack 3
Microsoft
>= 13.0.0 < 13.0.6500.113.0.6500.1
SQL Server 2017
Microsoft
>= 14.0.0 < 14.0.2120.114.0.2120.1
SQL Server 2019
Microsoft
>= 15.0.0 < 15.0.2180.215.0.2180.2
SQL Server 2022
Microsoft
>= 16.0.0 < 16.0.1190.216.0.1190.2
SQL Server 2025
Microsoft
>= 17.0.0 < 17.0.1125.217.0.1125.2
AttributeDetail
CWE IDCWE-89 (SQL Injection)
Attack VectorNetwork (AV:N)
CVSS v3.1 Score8.8
EPSS Score0.00921 (0.92%)
ImpactComplete Privilege Escalation to sysadmin
Exploit StatusNone (Theoretical)
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The database engine constructs a dynamic command using external elements without sanitizing special SQL structures, altering the command flow.

Vulnerability Timeline

CVE-2026-47295 published by Microsoft Security Response Center (MSRC) as part of scheduled security updates.
2026-07-14
CVE record assigned and published in the CVE.org list.
2026-07-14
NVD publishes official CVSS v3.1 scoring, establishing the high-severity 8.8 rating.
2026-07-15
Vulnerability checked against CISA's KEV Catalog; confirmed not actively exploited.
2026-07-16

References & Sources

  • [1]Microsoft Security Response Center (MSRC) Advisory
  • [2]CVE.org Official Record
  • [3]Wiz Vulnerability Database Details

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.

More Reports

•37 minutes ago•GHSA-2G6R-C272-W58R
3.7

CVE-2026-26013: Server-Side Request Forgery in LangChain Image Token Counting

Prior to version 1.2.11, the LangChain LLM framework is affected by a Server-Side Request Forgery (SSRF) vulnerability inside its image token counting mechanism. Specifically, the ChatOpenAI.get_num_tokens_from_messages() method retrieves arbitrary image_url values from user prompts without validating the destination host or IP address. Attackers can exploit this issue to scan internal infrastructure, access local services, or harvest credentials from cloud metadata services.

Alon Barad
Alon Barad
0 views•6 min read
•39 minutes ago•GHSA-8MV7-9C27-98VC
5.1

GHSA-8mv7-9c27-98vc: Cross-Site Request Forgery (CSRF) Bypass in Astro/Hono Composable Pipeline

A security vulnerability was identified in the Astro web framework's composable integration pipeline with Hono. Due to the structural coupling of CSRF origin validation exclusively within the `middleware()` primitive, applications assembling their routing pipeline manually could execute state-mutating actions before or entirely without origin validation. This flaw allows attackers to execute blind, write-only Cross-Site Request Forgery (CSRF) attacks against state-mutating Astro Actions or endpoints on behalf of authenticated users.

Amit Schendel
Amit Schendel
1 views•7 min read
•about 1 hour ago•CVE-2008-4128
9.3

CVE-2008-4128: Multiple Cross-Site Request Forgery Vulnerabilities in Cisco IOS HTTP Administration

Multiple cross-site request forgery (CSRF) vulnerabilities in the HTTP Administration component in Cisco IOS 12.4 on the 871 Integrated Services Router allow remote attackers to execute arbitrary commands via crafted HTTP requests. This occurs because the web administrative server fails to validate request origins or use anti-CSRF tokens, allowing an attacker to abuse an active administrative session.

Alon Barad
Alon Barad
3 views•7 min read
•about 2 hours ago•GHSA-F283-GHQC-FG79
5.3

GHSA-f283-ghqc-fg79: Denial of Service via Unbounded Cookie Jar Resource Exhaustion in Guzzle

An unbounded resource allocation vulnerability exists in Guzzle's cookie parsing and storage engine. Prior to version 7.15.1, Guzzle did not restrict the number or size of cookies stored within the client-side CookieJar. This lack of boundary control allows a malicious server or an intermediary proxy to poison the cookie storage with oversized or excessive Set-Cookie headers. When the client subsequently targets sibling domains or legitimate services using the same cookie jar, it transmits exceptionally large Cookie headers, triggering upstream protocol violations and resulting in Denial of Service (HTTP 431 / HTTP 400 rejection).

Amit Schendel
Amit Schendel
3 views•6 min read
•about 3 hours ago•GHSA-WM3W-8RRP-J577
7.5

GHSA-WM3W-8RRP-J577: Host-Only Cookie Scope Exposure in Guzzle Cookie Jar

An information disclosure vulnerability in guzzlehttp/guzzle allows host-only cookies to be incorrectly matched and sent to subdomains. Because Guzzle failed to track whether cookies were defined without a Domain attribute, it evaluated host-only cookies using standard domain-suffix rules, widening their scope and exposing sensitive session tokens to untrusted subdomains.

Alon Barad
Alon Barad
5 views•6 min read
•about 4 hours ago•GHSA-H95V-H523-3MW8
5.9

GHSA-H95V-H523-3MW8: Sensitive URI Fragment Disclosure via Referer Headers in Guzzle HTTP Client

An issue in Guzzle's RedirectMiddleware allows client-side URI fragments to be leaked over the network in Referer headers during same-scheme HTTP redirects.

Amit Schendel
Amit Schendel
5 views•6 min read