__________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN Microsoft Cumulative Patch for SQL Server [Microsoft Security Bulletin MS02-043] August 16, 2002 19:00 GMT Number M-112 [REVISED 16 Jun 2005] ______________________________________________________________________________ PROBLEM: Weak permissions on some Microsoft-provided extended stored procedures, that have the ability to reconnect to the database using the SQL Server, could allow non-privileged users to execute them. PLATFORM: Microsoft SQL Server 7.0 Microsoft Desktop Engine (MSDE) 1.0 Microsoft SQL Server 2000 Microsoft Desktop Engine (MSDE) 2000 DAMAGE: An attacker could gain significant control over the database and possibly the server itself. In the worst case, an attacker could add, change, or delete data in the database, as well as potentially being able to reconfigure the operating system, install new software, or reformat the hard drive. SOLUTION: Apply available patches. ______________________________________________________________________________ VULNERABILITY The risk is MEDIUM. By default, SQL Server runs in a security ASSESSMENT: context of a domain user with very limited privileges on the server which would limit the potential actions that a successful attacker could take against the operating system. ______________________________________________________________________________ LINKS: CIAC BULLETIN: http://www.ciac.org/ciac/bulletins/m-112.shtml ORIGINAL BULLETIN: http://www.microsoft.com/technet/treeview/default.asp?url=/ technet/security/bulletin/MS02-043.asp PATCHES: Microsoft SQL Server 7.0 http://www.microsoft.com/Release.asp?ReleaseID=Q327068 - Microsoft SQL Server 2000 http://www.microsoft.com/Release.asp?ReleaseID=Q316333 ADDITIONAL LINK; Microsoft Security Bulletin MS02-035 http://www.microsoft.com/technet/security/Bulletin/MS02-035.mspx ______________________________________________________________________________ REVISION HISTORY: 06/16/2005 - revised to add a link to Microsoft Security Bulletin MS02-035. [***** Start Microsoft Security Bulletin MS02-043 *****] Cumulative Patch for SQL Server (Q316333) Originally posted: August 14, 2002 Summary Who should read this bulletin: System administrators using Microsoft® SQL Server™ 7.0 and 2000 and Microsoft Desktop Engine 1.0 and 2000. Impact of vulnerability: Elevation of privilege. Maximum Severity Rating: Moderate Recommendation: System administrators should apply the patch to affected systems. Affected Software: Microsoft SQL Server 7.0 Microsoft Desktop Engine (MSDE) 1.0 Microsoft SQL Server 2000 Microsoft Desktop Engine (MSDE) 2000 Technical details Technical description: This is a cumulative patch that includes the functionality of all previously released patches for SQL Server 7.0 and SQL Server 2000. In addition, it eliminates a newly discovered vulnerability. SQL Server 7.0 and SQL Server 2000 provide for extended stored procedures, which are external routines written in programming languages such as C or C#. These procedures appear as normal stored procedures to users and can be invoked and executed just like normal stored procedures. By default, SQL Server 7.0 and SQL Server 2000 ship with a number of extended stored procedures which are used for various helper functions. Some of the Microsoft-provided extended stored procedures that have the ability to reconnect to the database as the SQL Server service account have a flaw in common – namely, they have weak permissions that can allow non-privileged users to execute them. Because these extended stored procedures can be made to run with administrator privileges on the database, it is thus possible for a non-privileged user to run stored procedures on the database with administrator privileges. An attacker could exploit this vulnerability in one of two ways. The attacker could attempt to load and execute a database query that calls one of the affected extended store procedures. Alternately, if a web-site or other database front-end were configured to access and process arbitrary queries, it could be possible for the attacker to provide inputs that would cause the query to call one of the functions in question with the appropriate malformed parameters. Mitigating factors: The effect of exploiting the vulnerability would depend on the specific configuration of the SQL Server service. SQL Server can be configured to run in a security context chosen by the administrator. By default, this context is as a domain user. If the rule of least privilege has been followed, it would minimize the amount of damage an attacker could achieve. The vector for exploiting this vulnerability could be blocked by following best practices. Specifically, untrusted users should not be able to load and execute queries of their choice on a database server. In addition, publicly accessible database queries should filter all inputs prior to processing. Severity Rating: Internet Servers Intranet Servers Client Systems SQL Server 7.0 Moderate Moderate Moderate (Including MSDE 1.0) SQL Server 2000 Moderate Moderate Moderate (Including MSDE 2000) The above assessment is based on the types of systems affected by the vulnerability, their typical deployment patterns, and the effect that exploiting the vulnerability would have on them. While the vulnerability can be used to run stored procedures as administrator, following best practices and limiting the ability to submit queries greatly mitigates the exposure to this vulnerability. Vulnerability identifier: CAN-2002-0721 Tested Versions: Microsoft tested SQL Server 7.0 and SQL Server 2000 to assess whether they are affected by this vulnerability. Previous versions are no longer supported and may or may not be affected by this vulnerability. While the vulnerability could potentially enable an attacker While the vulnerability could potentially allow an attacker to run code on the server, best practices should limit the ability to exploit the vulnerability and the damage that could be achieved by a successful attack. Patch availability Download locations for this patch Microsoft SQL Server 7.0 http://www.microsoft.com/Release.asp?ReleaseID=Q327068 Microsoft SQL Server 2000 http://www.microsoft.com/Release.asp?ReleaseID=Q316333 Additional information about this patch Installation platforms: The SQL Server 7.0 patch can be installed on systems running SQL Server 7.0 Service Pack 4. The SQL Server 2000 patch can be installed on systems running SQL Server 2000 Service Pack 2. Inclusion in future service packs: The fix for this issue will be included in SQL Server 2000 Service Pack 3. Reboot needed: No. The SQL Server service only needs to be restarted after applying the patch. Patch can be uninstalled: Yes. The readme.txt describing the installation instructions also contains instructions on removing the patch. Superseded patches: SQL Server 7.0 and MSDE 1.0: This patch supersedes the one provided in Microsoft Security Bulletin MS02-020, which was itself a cumulative patch. SQL Server 2000 and MSDE 2000: This patch supersedes the one provided in Microsoft Security Bulletin MS02-038, which was itself a cumulative patch. Verifying patch installation: SQL Server 7.0: To ensure you have the fix installed properly, verify the individual files by consulting the date/time stamp of the files listed in the file manifest in Microsoft Knowledge Base article at http://support.microsoft.com/support/misc/kblookup.asp?id=Q327068 SQL Server 2000: To ensure you have the fix installed properly, verify the individual files by consulting the date/time stamp of the files listed in the file manifest in Microsoft Knowledge Base article at http://support.microsoft.com/support/misc/kblookup.asp?id=Q316333 Caveats: This patch does not include the functionality of the Killpwd tool provided in Microsoft Security Bulletin MS02-035. The patch does not supersede any previously released patches for MDAC or OLAP under SQL Server 2000. At this writing, these patches include the ones discussed in: Microsoft Security Bulletin MS00-092 Microsoft Security Bulletin MS01-041 Microsoft Security Bulletin MS02-030 The process for installing the patch varies somewhat depending on the specific configuration of the server. System administrators should ensure that they read the Readme.txt file in the patch package to ensure the patch is installed correctly. Localization: Localized versions of this patch are available at the locations discussed in “Patch Availability”. Obtaining other security patches: Patches for other security issues are available from the following locations: Security patches are available from the Microsoft Download Center, and can be most easily found by doing a keyword search for "security_patch". Patches for consumer platforms are available from the WindowsUpdate web site Other information: Acknowledgments Microsoft thanks Microsoft the following people for working with us to protect customers: David Litchfield of Next Generation Security Software Ltd. for reporting these issues. Chip Andrews of www.sqlsecurity.com and Timothy Mullen for reporting additional information on these issues. Support: Microsoft Knowledge Base article Q327068 and Q316333 discusses this issue and will be available approximately 24 hours after the release of this bulletin. Knowledge Base articles can be found on the Microsoft Online Support web site. Technical support is available from Microsoft Product Support Services. There is no charge for support calls associated with security patches. Security Resources: The Microsoft TechNet Security Web Site provides additional information about security in Microsoft products. Disclaimer: The information provided in the Microsoft Knowledge Base is provided "as is" without warranty of any kind. Microsoft disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Microsoft Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Microsoft Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply. Revisions: V1.0 (August 14, 2002): Bulletin Created. [***** End Microsoft Security Bulletin MS02-043 *****] _______________________________________________________________________________ CIAC wishes to acknowledge the contributions of Microsoft for the information contained in this bulletin. _______________________________________________________________________________ CIAC, the Computer Incident Advisory Capability, is the computer security incident response team for the U.S. Department of Energy (DOE) and the emergency backup response team for the National Institutes of Health (NIH). CIAC is located at the Lawrence Livermore National Laboratory in Livermore, California. CIAC is also a founding member of FIRST, the Forum of Incident Response and Security Teams, a global organization established to foster cooperation and coordination among computer security teams worldwide. CIAC services are available to DOE, DOE contractors, and the NIH. CIAC can be contacted at: Voice: +1 925-422-8193 (7x24) FAX: +1 925-423-8002 STU-III: +1 925-423-2604 E-mail: ciac@ciac.org Previous CIAC notices, anti-virus software, and other information are available from the CIAC Computer Security Archive. World Wide Web: http://www.ciac.org/ Anonymous FTP: ftp.ciac.org PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing communities receive CIAC bulletins. If you are not part of these communities, please contact your agency's response team to report incidents. Your agency's team will coordinate with CIAC. The Forum of Incident Response and Security Teams (FIRST) is a world-wide organization. A list of FIRST member organizations and their constituencies can be obtained via WWW at http://www.first.org/. This document was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC) M-102: MS SQL Server 2000 Resolution Service Buffer Overflow M-103: Multiple Vulnerabilities in OpenSSL M-104: Red Hat Linux Passwork Locking Race Vulnerability M-105: Unchecked Buffer in MDAC Function Vulnerability M-106: Cisco Concentrator RADIUS PAP Authentication Vulnerability M-107: Unchecked Buffer in Content Management Server M-108: Vulnerability in HP Apache Server PHP M-109: Common Desktop Environment (CDE) ToolTalk Buffer Overflow M-110: Buffer Overflow in Multiple Domain Name System (DNS) Libraries M-111: Integer Overflow in External Data Representation (XDR) Library