Skip to the content
The Update Bureau
SQL Server 2022 GDR SQL Server 2022 GDR Security update
Patch Tuesday

KB5058712

KB5058712: Security update for SQL Server 2022, GDR branch, July 2025. SQL query flaws and Setup restarts fixed

In short

Fixes a query issue that could make SQL Server unavailable under specific conditions, along with rare memory-handling and Setup problems.

Does it affect you? Applies to: Devices running SQL Server 2022 or a SQL Server 2022 GDR release through this update. The update package is for x64.

Build
16.0.1140.6
Servicing branch
GDR
Security
3 fixed
Restart
Required

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 4 changes

Programmability

2 items
  • A query that could make the server unavailable under specific conditions no longer causes that problem.1
    Bug 4238979: fixes an issue where an attacker can execute a query against the server to cause unavailability.
  • In rare cases, limited-length parameters used with REPLACE no longer cause uninitialized memory to be returned.2
    Bug 4166652.

Query Execution

  • In rare cases, variable-length parameters no longer allow uninitialized memory to be read.3
    Bug 4053231.

Patching

  • Setup can continue after restarts caused by a previous Windows update.4
    Bug 4241786: when applying SQL Server updates, the fix deletes the value of the PendingFileRenameOperations registry key.

Technical details

Data sheet · Security · Downloads · Components Click to collapse or expand

Data sheet

Released
2025-07-08
Classification
Security Updates
Type
Cumulative update
Servicing branch
GDR
Restart
Required
Replaces
KB5046861, KB5046057, KB5042211, KB5040936
+2 earlier KB5035432, KB5032968
Replaced by
KB5063756
VersionBuildChannel
2022 16.0.1140.6 General availability

Security

3 vulnerabilities fixed
3 important
VulnerabilitySeverityCVSS
Microsoft SQL Server Remote Code Execution Vulnerability
Important 8.5
Microsoft SQL Server Information Disclosure Vulnerability
Important 7.5
Microsoft SQL Server Information Disclosure Vulnerability
Important 7.5

Downloads (Microsoft Update Catalog)

Sources

Updated
Cited passages from Microsoft's official notes (4)
  1. 1. Fixes an issue where under specific conditions an attacker can execute a query against the server to cause unavailability. support.microsoft.com
  2. 2. Fixes an issue in which uninitialized memory is returned in some rare cases when using limited length parameters with REPLACE function. support.microsoft.com
  3. 3. Fixes an issue in which uninitialized memory can be read in some rare cases when using variable length parameters. support.microsoft.com
  4. 4. Fixes an issue that was introduced in a previous Windows update that causes restarts and prevents Setup from continuing. After you apply this fix, the value of the PendingFileRenameOperations registry key is deleted when you apply updates to SQL Server. support.microsoft.com
Checked automatically: 8 of 8 checks passed, 4 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