Description of the security update for SQL Server 2017 CU15: July 9, 2019

Applies to: SQL Server 2017 on WindowsSQL Server 2017 on Linux


A remote code execution vulnerability exists in Microsoft SQL Server when it incorrectly handles processing of internal functions. An attacker who successfully exploited this vulnerability could execute code in the context of the SQL Server Database Engine service account. To learn more about the vulnerability, go to CVE-2019-1068.

The SQL Server and Analysis services components are updated to the following builds in this security update:

Component Product version File version
SQL Server 14.0.3192.2 2017.140.3192.2
Analysis Services 2017.140.249.3



You must run this script if you use Query Store and you are updating from SQL Server 2017 Cumulative Update 2 (CU2) directly to SQL Server 2017 Cumulative Update 3 (CU3) or any later Cumulative Update. Executing this script is not needed if you have previously installed SQL Server 2017 Cumulative Update 3 (CU3) or any later SQL Server 2017 Cumulative Update.

SET NOCOUNT ON;DROP TABLE IF EXISTS #tmpUserDBs;SELECT [database_id], 0 AS [IsDone]INTO #tmpUserDBsFROM master.sys.databasesWHERE [database_id] > 4 AND [state] = 0 -- must be ONLINE AND is_read_only = 0 -- cannot be READ_ONLY AND [database_id] NOT IN (SELECT dr.database_id FROM sys.dm_hadr_database_replica_states dr -- Except all local Always On secondary replicas  INNER JOIN sys.dm_hadr_availability_replica_states rs ON dr.group_id = rs.group_id  INNER JOIN sys.databases d ON dr.database_id = d.database_id  WHERE rs.role = 2 -- Is Secondary   AND dr.is_local = 1   AND rs.is_local = 1)DECLARE @userDB sysname;WHILE (SELECT COUNT([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0) > 0BEGIN SELECT TOP 1 @userDB = DB_NAME([database_id]) FROM #tmpUserDBs WHERE [IsDone] = 0 -- PRINT 'Working on database ' + @userDB EXEC ('USE [' + @userDB + '];DECLARE @clearPlan bigint, @clearQry bigint;IF EXISTS (SELECT [actual_state] FROM sys.database_query_store_options WHERE [actual_state] IN (1,2))BEGIN IF EXISTS (SELECT plan_id FROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27'') BEGIN  DROP TABLE IF EXISTS #tmpclearPlans;  SELECT plan_id, query_id, 0 AS [IsDone]  INTO #tmpclearPlans  FROM sys.query_store_plan WHERE engine_version = ''14.0.3008.27''  WHILE (SELECT COUNT(plan_id) FROM #tmpclearPlans WHERE [IsDone] = 0) > 0  BEGIN   SELECT TOP 1 @clearPlan = plan_id, @clearQry = query_id FROM #tmpclearPlans WHERE [IsDone] = 0   EXECUTE sys.sp_query_store_unforce_plan @clearQry, @clearPlan;   EXECUTE sys.sp_query_store_remove_plan @clearPlan;   UPDATE #tmpclearPlans   SET [IsDone] = 1   WHERE plan_id = @clearPlan AND query_id = @clearQry  END;  PRINT ''- Cleared possibly affected plans in database [' + @userDB + ']'' END ELSE BEGIN  PRINT ''- No affected plans in database [' + @userDB + ']'' ENDENDELSEBEGIN PRINT ''- Query Store not enabled in database [' + @userDB + ']''END')  UPDATE #tmpUserDBs  SET [IsDone] = 1  WHERE [database_id] = DB_ID(@userDB)END

How to obtain and install the update

Method 1: Microsoft Update

This update is available through Windows Update. When you turn on automatic updating, this update will be downloaded and installed automatically. For more information about how to turn on automatic updating, see Windows Update: FAQ.

Method 2: Microsoft Update Catalog

To get the standalone package for this update, go to the Microsoft Update Catalog website.

Method 3: Microsoft Download Center

The following file is available for download from the Microsoft Download Center:

Download the package now
Release Date: July 9, 2019

For more information about how to download Microsoft support files, click the following article number to go to the article in the Microsoft Knowledge Base:

How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses by using the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to it.

Method 4: For SQL Server 2017 on Linux platforms and containers

For information on obtaining and installing this update on Linux Operating Systems or Docker Containers, see:

More information


To apply this update, you must have SQL Server 2017 or any SQL Server 2017 CU release through SQL Server 2017 CU15 installed.

Security update deployment information

For deployment information about this update, see security update deployment information: July 9, 2019.

File hash information

File name SHA1 hash SHA256 hash
SQLServer2017-KB4505225-x64.exe 19C9CC25E7F118598C50DD016577B2DBFD6DFE93 F42170725D58019F9A90B89A63C10AA9AE3612E61E5ED120849502DA12634A55

File information

The English (United States) version of this software update installs files that have the attributes that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). The dates and times for these files on your local computer are displayed in your local time together with your current daylight saving time (DST) bias. Additionally, the dates and times may change when you perform certain operations on the files.

How to get help and support for this security update

Help for installing updates: Protect yourself online

Help for protecting your Windows-based computer from viruses and malware: Microsoft Security

Local support according to your country: International Support