KB5065865: Cumulative update for SQL Server 2022, CU branch, September 2025. SQL injection protections added; parallel SESSION_CONTEXT issue remains
Includes SQL injection and privilege-escalation protections, along with fixes for SQL Server Engine problems. Queries using SESSION_CONTEXT in parallel plans might still return incorrect results or trigger access violation dumps.
Does it affect you? Applies to: SQL Server 2022 instances. The update package is for x64, and the update applies to all supported languages.
Review notes Additional details from the official release notes (1) Read note
-
What changes
CU21 fixes a bug where
TRUNCATE TABLE WITH PARTITIONScould unexpectedly succeed on a table with nonaligned partitions and cause corruption.
The official sources are linked at the end of the page.
For servers on the CU branch: they install cumulative updates, which also bring fixes beyond security. Servers on the GDR branch (security fixes only) get a separate update. Which branch am I on?
What changes
Fixes 17 changes
DB Management
For: SQL Server 2022 instances
-
Truncating a table with nonaligned partitions no longer succeeds unexpectedly and causes corruption.1
Fixes the behavior of
TRUNCATE TABLE WITH PARTITIONSon a table with nonaligned partitions. -
DBCC CHECKDBno longer reports the described inconsistency after an index or table is dropped from a database originating from Azure SQL Managed Instance.17Fixes the known issue involvingDBCC CHECKDBafter dropping an index or a table that includes an index from a database that originated from Azure SQL Managed Instance.
High Availability and Disaster Recovery
-
The primary replica of an availability group no longer encounters this assertion dump issue.2
Fixes an assertion dump related to the expression shown in the description.
-
A SQL injection vulnerability in a system stored procedure is fixed.3
Fixes a SQL injection vulnerability in a system stored procedure.
Linux
For: SQL Server 2022 on Linux
-
SQL Server on Linux no longer terminates in the described encrypted TLS/SSL communication scenario.4
Fixes termination when sending encrypted TLS/SSL data to a peer after receiving an alert such as
bad_record_mac.
Metadata
For: SQL Server 2022 instances
-
A SQL injection vulnerability in a system stored procedure is fixed.5
Fixes a SQL injection vulnerability in a system stored procedure.
Programmability
For: SQL Server 2022 instances
-
Inspecting statements running in other sessions no longer exposes sensitive data in the described scenarios.6
Fixes scenarios in which DMVs are used to inspect text of statements running in other sessions that might contain sensitive data.
-
Queries that use TRIM no longer encounter the described access violation dump.7
Fixes
ACCESS_VIOLATION_c0000005_sqllang.dll!CScaOp_Intrinsic::FConvertToText_Intrinsicwhen queries use the TRIM intrinsic.
Query Optimizer
For: SQL Server 2022 instances
-
TRY_CONVERTno longer returns invalid results in the described query-plan scenario.8Fixes invalid results fromTRY_CONVERTwhen the plan uses the Clustered Index Seek operator.
Replication
-
Change tracking cleanup no longer blocks user-triggered column changes to a table.9
Fixes the change tracking auto cleanup process blocking user-triggered
ALTER TABLEcolumn-level DDL operations (ADD/DROP/ALTER COLUMN). -
Adding a merge agent works when a subscription uses a nondefault port.10
Fixes merge agent creation failing with Msg 2560 when the subscription uses a nondefault port.
Security Infrastructure
For: SQL Server 2022 instances
-
Logins with
ALTER ANY LOGINcan no longer reset passwords for logins with the listed permissions to elevate privileges.11Prevents password resets for logins withALTER ANY LOGINorIMPERSONATE ANY LOGINpermissions by logins that haveALTER ANY LOGINpermission. -
Running
sp_describe_first_result_seton the ledger digest locations view no longer causes the described access violation.12Fixes an access violation when runningsp_describe_first_result_setonsys.database_ledger_digest_locations.
SQL Agent
For: SQL Server 2022 instances using SQL Agent
-
Built-in SQL Agent jobs with reduced permissions no longer allow elevation of privilege through their job steps.13
Prevents elevation of privilege by running SQL Agent job steps for built-in jobs that have reduced permissions.
SQL Server Engine
For: SQL Server 2022 instances
-
A vulnerability that could let users run SQL injection and arbitrary code with elevated privileges is fixed.14
Fixes a vulnerability involving access to certain stored procedures and elevated privileges.
-
URLs in certain error messages are corrected.15
Fixes URLs in certain error messages, including errors 14130 and 14131.
Storage Management
For: SQL Server 2022 instances
-
Log files no longer shrink below the specified target size in the described scenarios.16
Fixes log files shrinking beyond the specified target size under certain operations when running
DBCC SHRINKFILE.
Known issues
-
Incorrect behavior of SESSION_CONTEXT in parallel plans
Queries that use
SESSION_CONTEXTmight return incorrect results or trigger access violation dumps when run in parallel query plans, particularly if the session is reset for reuse.18Workaround status No workaround yetMicrosoft has not published a manual workaround for this issue yet. Monitor release health until a resolving update is available.
Technical details
Data sheet · Security · Downloads · Components Click to collapse or expand
Data sheet
- Released
- 2025-09-11
- Classification
- Updates
- Type
- Cumulative update
- Servicing branch
- CU
- Restart
- Required
- Replaces
- KB5059390, KB5054531, KB5050771, KB5048038
- Replaced by
- KB5068406
| Version | Build | Channel |
|---|---|---|
| 2022 | 16.0.4215.2 | General availability |
Security
No vulnerabilities are listed for this update.
Downloads (Microsoft Update Catalog)
Sources
Cited passages from Microsoft's official notes (18)
-
1.
Fixes an issue in which running the
support.microsoft.comTRUNCATE TABLE WITH PARTITIONSstatement on a table that has nonaligned partitions succeeds unexpectedly and causes corruption. -
2.
Fixes an assertion dump issue on the primary replica of an availability group that's related to the expression
support.microsoft.com -
3.
Fixes a SQL injection vulnerability in a system stored procedure.
support.microsoft.com -
4.
Fixes a SQL Server on Linux termination issue that you might encounter when you try to send encrypted TLS/SSL data to a peer after receiving an alert such as
support.microsoft.combad_record_macfrom the peer. -
5.
Fixes a SQL injection vulnerability in a system stored procedure.
support.microsoft.com -
6.
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 -
7.
Fixes an access violation dump issue that you encounter in
support.microsoft.comACCESS_VIOLATION_c0000005_sqllang.dll!CScaOp_Intrinsic::FConvertToText_Intrinsicwhen you run queries that use the TRIM intrinsic. -
8.
Fixes an issue in which the
support.microsoft.comTRY_CONVERTfunction might cause invalid results when the plan uses the Clustered Index Seek operator. -
9.
Fixes an issue in which the change tracking auto cleanup process blocks the user triggered
support.microsoft.comALTER TABLEcolumn-level DDL (ADD/DROP/ALTER COLUMN) operations. -
10.
Fixes an issue in which adding a merge agent fails and generates the following error message if the subscription uses a nondefault port
support.microsoft.com -
11.
Prevents logons that have the
support.microsoft.comALTER ANY LOGINpermission from resetting the passwords of logons that haveALTER ANY LOGINorIMPERSONATE ANY LOGINpermissions to avoid elevation of privilege. -
12.
Fixes an access violation that you encounter when you run
support.microsoft.comsp_describe_first_result_setonsys.database_ledger_digest_locations. -
13.
Prevents elevation of privilege by running SQL Agent job steps for built-in jobs that have reduced permissions.
support.microsoft.com -
14.
Fixes a vulnerability that lets users who have access to certain stored procedures perform SQL injection and run arbitrary code by using elevated privileges.
support.microsoft.com -
15.
Fixes URLs in certain error messages (for example, error 14130 and error 14131).
support.microsoft.com -
16.
Fixes an issue in which the log files shrink beyond the specified target size under certain operations when you run the
support.microsoft.comDBCC SHRINKFILEcommand. -
17.
Fixes a known issue that causes the DBCC CHECKDB command to report an inconsistency after you drop an index or a table that includes an index from a database that originated from Azure SQL Managed Instance.
support.microsoft.com -
18.
Queries that use the built-in
support.microsoft.comSESSION_CONTEXTfunction might return incorrect results or trigger access violation (AV) dump files when run in parallel query plans.
Checked automatically: 8 of 8 checks passed, 18 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 4/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