KB5065221: Security update for SQL Server 2022, GDR branch, September 2025. Sensitive statement text exposure and SQL code execution fixed
Fixes two Important SQL Server vulnerabilities, including issues that could expose statement text or let attackers with elevated privileges run SQL code.
Does it affect you? Applies to: SQL Server 2022 GDR installations on Linux or Windows. The update package is for x64 systems.
For servers on the GDR branch: they get security fixes only. Servers that install cumulative updates (CU branch) get a separate update. Which branch am I on?
What changes
Fixes 2 changes
Programmability
-
Sensitive text from statements running in other sessions is no longer exposed when database monitoring views are used to inspect them.1
SQL Server Engine: fixes an issue where dynamic management views (DMVs) used in specific scenarios could expose the text of statements running in other sessions.
Temporal
-
Attackers with elevated privileges can no longer exploit a flaw in historical-record cleanup to run SQL code.2
SQL Server Engine: fixes improper input validation during internal temporal history table cleanup.
Technical details
Data sheet · Security · Downloads · Components Click to collapse or expand
Data sheet
- Released
- 2025-09-09
- Classification
- Security Updates
- Type
- Cumulative update
- Servicing branch
- GDR
- Restart
- Required
- Replaces
- KB5063756, KB5058712, KB5046861, KB5046057
- Replaced by
- KB5068407
| Version | Build | Channel |
|---|---|---|
| 2022 | 16.0.1150.1 | General availability |
Security
| Vulnerability | Severity | CVSS |
|---|---|---|
|
Microsoft SQL Server Elevation of Privilege Vulnerability
|
Important | 8.8 |
|
Microsoft SQL Server Information Disclosure Vulnerability
|
Important | 6.5 |
Downloads (Microsoft Update Catalog)
Updated components
145 files changed since the previous update for the same versions.
| Top changed components | Files |
|---|---|
| SQL Server Engine | 116 |
| SQL Server PolyBase | 3 |
Verified in package: changed files confirm Programmability, Temporal.
Sources
Cited passages from Microsoft's official notes (2)
-
1.
Fixes an issue in which DMVs are used in specific scenarios to inspect the text of statements that are running in other sessions and might contain sensitive data.
support.microsoft.com -
2.
Fixes improper input validation that occurs during internal temporal history table cleanup and that enables attackers to run SQL code by having elevated privileges.
support.microsoft.com
Checked automatically: 8 of 8 checks passed, 2 quoted passages · compared with Microsoft's page on Oct 20, 2026
- Quotes found in the official pages: passed
- Numbers found in the sources: passed
- Vulnerabilities from the dossier only: passed
- Links to allowed domains only: passed
- Every official change covered: passed
- Readable plain text: passed
- Changes confirmed by the file list: passed
- Sources agree: passed
A second AI read the text against the sources: correctness 5/5, clarity 4/5, completeness 5/5. How we work
Published by The Update Bureau. Written with AI from Microsoft's own documents, checked by rules and a second AI. How we work · Report a mistake