CVE-2025-47954 Overview
CVE-2025-47954 is a SQL injection vulnerability in Microsoft SQL Server 2022 that allows an authenticated attacker to elevate privileges over a network. The flaw is tracked under CWE-89, improper neutralization of special elements used in an SQL command. An attacker with low-privilege access can submit crafted SQL statements that the server fails to sanitize. Successful exploitation results in full compromise of confidentiality, integrity, and availability on the affected database instance. Microsoft published the advisory on August 12, 2025, and the issue is documented in the Microsoft Security Update CVE-2025-47954.
Critical Impact
An authenticated network attacker can inject SQL commands to escalate privileges and gain administrative control over the SQL Server 2022 instance.
Affected Products
- Microsoft SQL Server 2022 (x64)
- Database instances exposing SQL endpoints to authenticated users
- Applications relying on vulnerable SQL Server 2022 builds for backend storage
Discovery Timeline
- 2025-08-12 - Microsoft publishes advisory for CVE-2025-47954
- 2025-08-12 - CVE-2025-47954 published to NVD
- 2025-08-14 - Last updated in NVD database
Technical Details for CVE-2025-47954
Vulnerability Analysis
The vulnerability resides in SQL Server 2022's handling of user-supplied input within SQL commands. The server fails to properly neutralize special characters before incorporating them into query execution paths. An authenticated attacker with low privileges can craft input that breaks out of the intended query context. The injected statements execute under the privilege boundary of the SQL Server process or a higher-privileged database role.
Exploitation requires network access to the SQL Server endpoint and valid credentials. Once exploited, the attacker can read, modify, or destroy any data accessible to the server. The attacker can also execute administrative operations reserved for sysadmin or db_owner roles. The EPSS score of 1.543% places this issue in the 81st percentile for exploit likelihood.
Root Cause
The root cause is improper input neutralization in SQL command construction, classified as [CWE-89]. Special characters such as single quotes, semicolons, and comment markers are not consistently escaped before being passed to the query parser. This allows attacker-controlled input to alter the structure of executed SQL statements rather than being treated as literal data.
Attack Vector
The attack vector is network-based with low complexity and requires low privileges. An authenticated user submits malicious payloads through any interface that accepts SQL input, including stored procedures, parameterized queries that internally concatenate strings, or system functions that handle metadata. The injected SQL executes within the server context and bypasses access control checks. No user interaction is required to complete the exploit chain.
Detailed proof-of-concept code is not publicly available. Refer to the Microsoft Security Update CVE-2025-47954 advisory for vendor technical context.
Detection Methods for CVE-2025-47954
Indicators of Compromise
- Unexpected execution of xp_cmdshell, sp_configure, or other privileged stored procedures by low-privilege accounts
- Anomalous role membership changes adding users to sysadmin or db_owner groups
- SQL Server error log entries showing malformed queries with embedded comment delimiters or stacked statements
- Outbound network connections originating from the SQL Server service account
Detection Strategies
- Enable SQL Server Audit to capture SCHEMA_OBJECT_ACCESS_GROUP and DATABASE_ROLE_MEMBER_CHANGE_GROUP events
- Deploy database activity monitoring rules that flag SQL syntax patterns associated with injection, such as ' OR 1=1 or UNION SELECT from unexpected accounts
- Correlate authentication events with subsequent privilege-altering operations in the same session
- Ingest SQL Server logs into a centralized SIEM for behavioral baselining of query patterns per service account
Monitoring Recommendations
- Forward SQL Server audit logs and Windows Security events to a centralized log platform for retention and search
- Alert on logins that suddenly execute EXEC or sp_executesql calls outside their normal application profile
- Monitor for changes to logins, server roles, and linked server configurations
- Track query volume and error rates per principal to identify enumeration or fuzzing activity
How to Mitigate CVE-2025-47954
Immediate Actions Required
- Apply the Microsoft security update referenced in the MSRC advisory for CVE-2025-47954 to all SQL Server 2022 instances
- Inventory all SQL Server 2022 deployments, including embedded or third-party application backends
- Rotate credentials for any database accounts that may have been exposed to untrusted callers
- Review recent audit logs for evidence of unauthorized privilege changes prior to patching
Patch Information
Microsoft has released a security update addressing CVE-2025-47954. Administrators should install the August 2025 cumulative update for SQL Server 2022 through Microsoft Update, WSUS, or the Microsoft Update Catalog. Confirm the build number after installation matches the fixed version listed in the vendor advisory. Restart the SQL Server service to complete remediation.
Workarounds
- Restrict network access to SQL Server endpoints using firewall rules and segment database servers from general user networks
- Enforce least-privilege role assignments and remove unnecessary sysadmin memberships from application accounts
- Use parameterized queries and stored procedures with strict input typing in all upstream applications
- Enable Extended Protection for Authentication and require encrypted connections to limit credential exposure
# Verify SQL Server 2022 build after patching
sqlcmd -S localhost -Q "SELECT SERVERPROPERTY('ProductVersion'), SERVERPROPERTY('ProductLevel'), SERVERPROPERTY('ProductUpdateLevel')"
# Audit elevated role membership
sqlcmd -S localhost -Q "SELECT sp.name AS login, srm.role_principal_id FROM sys.server_role_members srm JOIN sys.server_principals sp ON srm.member_principal_id = sp.principal_id WHERE srm.role_principal_id = SUSER_ID('sysadmin')"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


