Microsoft Security Bulletin MS02-071 - Important
Flaw in Windows WM_TIMER Message Handling Could Enable Privilege Elevation (328310)
Published: December 11, 2002 | Updated: April 30, 2003
Originally posted: December 11, 2002
Updated: April 30th, 2003
Who should read this bulletin: Customers using Microsoft® Windows® NT 4.0, Windows 2000, and Windows XP.
Impact of vulnerability: Privilege elevation
Maximum Severity Rating: Important
Recommendation: Customers should install the patch at the earliest opportunity.
- Microsoft Windows NT 4.0
- Microsoft Windows NT 4.0, Terminal Server Edition
- Microsoft Windows 2000
- Microsoft Windows XP
End User Bulletin: An end user version of this bulletin is available at: https:.
Subsequent to the release of this bulletin it was determined that the patch for Microsoft Windows NT 4.0 machines introduced an error that could, under certain configurations, cause NT 4.0 to fail. Microsoft has investigated this issue and has released an updated patch for Windows NT 4.0. The bulletin has been updated to include the new download links for the NT 4.0 patch. The error did not affect NT 4.0 TSE, except for the Japanese Language. Customers running the Japanese version of NT 4.0 TSE should apply the updated fix.
It was also subsequently established that a second problem affected Windows NT 4.0 TSE multi processor systems which was causing them to fail. The patch should have been installable on both single and multi processor system and the installer should have copied the correct binaries onto the system depending on whether the system was single or multi processor. However an installer error meant that the correct binaries were not being copied onto multi processor systems, causing them to fail under certain scenarios. Microsoft has updated the patch for Windows NT 4.0 TSE to correct this error. It should be noted that this patch only corrects an installer problem with multi processor Windows NT 4.0 TSE systems - there is no requirement to re-install the patch on single processor systems as the installer functions correctly on those systems.
Customers who have installed the patch on Microsoft Windows 2000 and Windows XP are unaffected by this error.
Windows messages provide a way for interactive processes to react to user events (e.g., keystrokes or mouse movements) and communicate with other interactive processes. One such message, WM_TIMER, is sent at the expiration of a timer, and can be used to cause a process to execute a timer callback function. A security vulnerability results because it's possible for one process in the interactive desktop to use a WM_TIMER message to cause another process to execute a callback function at the address of its choice, even if the second process did not set a timer. If that second process had higher privileges than the first, this would provide the first process with a way of exercising them.
By default, several of the processes running in the interactive desktop do so with LocalSystem privileges. As a result, an attacker who had the ability to log onto a system interactively could potentially run a program that would levy a WM_TIMER request upon such a process, causing it to take any action the attacker specified. This would give the attacker complete control over the system.
In addition to addressing this vulnerability, the patch also makes changes to several processes that run on the interactive desktop with high privileges. Although none of these would, in the absence of the TM_TIMER vulnerability, enable an attacker to gain privileges on the system, we have included them in the patch to make the services more robust.
- An attacker would need valid logon credentials to exploit the vulnerability. It could not be exploited remotely.
- Properly secured servers would be at little risk from this vulnerability. Standard best practices recommend only allowing trusted administrators to log onto such systems interactively; without such privileges, an attacker could not exploit the vulnerability.
|Windows NT 4.0
|Windows NT 4.0, Terminal Server Edition
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.
Vulnerability identifier: CAN-2002-1230
Microsoft tested Windows NT 4.0, Windows NT 4.0, Terminal Server Edition, Windows 2000, and Windows XP to assess whether they are affected by these vulnerabilities. Previous versions are no longer supported, and may or may not be affected by these vulnerabilities.
Frequently asked questions
Microsoft has reissued the patch for NT4.0 and NT 4.0 TSE. Why?
Subsequent to the bulletin originally being posted, 2 separate problems were identified with the NT 4.0 and NT 4.0 TSE patches. Microsoft updated the bulletin to provide details of these problems, which are discussed further below, and to include download locations to the updated patches.
What was the problem with the Windows NT 4.0 patch?
The original Windows NT 4.0 patch had an error that caused certain Windows NT 4.0 systems to fail. Microsoft has reissued the Windows NT 4.0 patch to correct this problem.
What was the problem with the Windows NT 4.0 TSE patch?
A patch installer error meant that the correct files were not being installed on multi processor systems. This meant that under certain configurations, these systems were failing. The installer correctly patched single processor machines - there error was only evident on multi processor systems. Microsoft has re-issued the Windows NT 4.0 TSE patch to correct this problem.
What's the scope of the vulnerability?
This is a privilege elevation vulnerability. An attacker who successfully exploited this vulnerability could gain unwarranted privileges on a system. In this case, the attacker could gain full administrative privileges, thereby gaining the ability to take any desired action on the machine, such as adding, deleting, or modifying data on the system, creating or deleting user accounts, and adding accounts to the local administrators group. The vulnerability could only be exploited by an attacker who had credentials to log onto the computer interactively. Best practices suggest that unprivileged users not be allowed to interactively log onto business-critical servers; if this guidance has been followed, such servers would not be at risk from this vulnerability. Instead, the systems primarily at risk would be workstations and terminal servers.
What causes the vulnerability?
The vulnerability results because it is possible for an unprivileged user to cause code to be executed by a highly privileged process on the interactive desktop using the Windows WM_TIMER message.
What do you mean by a "desktop"?
Normally, when we refer to a "desktop", we mean the Windows desktop that you see on your screen during a Windows session. However, in the Windows security architecture, the term desktop actually has a different meaning. Desktops are used to encapsulate processes in Windows in order to ensure that a process is properly restricted to only authorized activities. It's easier to explain what a desktop is and how it works if we start with the layer of granularity above the desktop, the windows station.
What's a windows station?
A windows station is a secure container that contains a clipboard, some global information, and a set of one or more desktops. The interactive window station assigned to the logon session of the interactive user also contains the keyboard, mouse, and display device. The interactive window station is visible to the user and can receive input from the user. All other window stations are non-interactive, which means that they can't be made visible to the user and can't receive user input.
What's an interactive desktop?
A desktop is a secure container object that is contained within a window station. There may be many desktops contained within a windows station. A desktop has a logical display surface and contains windows, menus, and hooks. Only the desktops of the interactive window station can be visible and receive user input. On the interactive window station, only one desktop at a time is active. This active desktop, also referred to as the interactive desktop or input desktop, is the one that is currently visible to the user and that receives user input.
What are Windows messages?
Processes running on Windows interact with the system and other processes using messages. For instance, each time the user hits a key on the keyboard, moves the mouse, or clicks a control such as a scroll bar, Windows generates a message, the purpose of which is to alert the application that a user event has occurred, and deliver the data from that event to the application. Similarly, an application can generate messages as a way of allowing the various windows it controls to communicate with and task each other.
What's wrong with the way Windows messages are handled within the interactive desktop?
The flaw actually lies in the way one particular Windows message, known as WM_TIMER, operates. WM_TIMER is a Windows message associated with a timer function. By design, a process in the interactive desktop can set up a timer, at the expiration of which another function, known as a callback function, will be executed. A flaw in WM_TIMER results because it's possible for one process to send a WM_TIMER message to another process in the interactive desktop as if the message had been sent as a result of a timer function. The first process could set the address of the callback function, with the result being that the second process would execute the callback function specified by the first.
Why does this pose a security vulnerability?
Essentially, the flaw in WM_TIMER would provide a way for one process on the interactive desktop to cause another one to do its bidding. If the second process had higher privileges, this would provide a way for the first to exercise them.
What if the second process had only the same privileges as the first?
It wouldn't offer any opportunity to gain additional privileges. The flaw only poses a threat in the case where different processes running in the interactive desktop had differing levels of privilege.
I saw a posting Microsoft authored shortly after this issue was reported, in which you said the problem was that processes with differing levels of privilege were running on the interactive desktop. It sounds like you've changed your opinion. We have. When we initially examined the situation, we concluded that the problem here lay solely in the fact that highly-privileged and lower-privileged processes were both present in the interactive desktop. We pointed out that, by design, all processes on the interactive desktop are peers, and stated that we believed the real solution was to not mix processes of varying privileges. However, upon deeper investigation, we determined that the real answer is somewhat more complicated. It's possible for a highly privilege process to coexist safely with less privileged processes on the interactive desktop, provided that it's been properly designed to vet all requests before acting on them. However, the flaw in WM_TIMER would undermine these safeguards even if they were present. As a result, although we still recommend that developers use extreme care before writing a process that has high privileges and runs in the interactive desktop, we believe that in this case the real culprit is the flaw in WM_TIMER.
In your posting, you said that you'd found several Microsoft services that didn't follow your own guidance, and ran with high privileges in the interactive desktop but didn't adequately vet requests from other processes. Is this still true?
We did find several processes running with high privileges, and several places in which we could improve the vetting they perform. However, in the end we concluded that none of them could be subverted without the WM_TIMER flaw. Although this patch does deliver changes to some services, we believe that the only real security vulnerability lies in WM_TIMER.
What might an attacker use the vulnerability to do?
An attacker who successfully exploited the vulnerability could, if there was a highly privileged process running in the interactive desktop, create a process that would levy requests upon it. In default configurations of Windows, several such processes are available, running with LocalSystem privileges. Exploiting the vulnerability in such a case would enable the attacker to gain complete control over the system.
Who could exploit the vulnerability?
To exploit the vulnerability, the attacker would need the ability to log onto the system, load a program of his or her choice (one that sent the WM_TIMER message to a highly privileged process, and specified a callback function that would perform some desired task), and run it.
What systems are primarily at risk from the vulnerability?
In general, workstations and terminal servers would be chiefly at risk. Servers would only be at risk if unprivileged users had been given the ability to log onto them and run programs, but best practices strongly mitigate against allowing this for a number of reasons.
Could the vulnerability be exploited from the Internet?
No. The attacker would need the ability to log onto the specific system he or she wished to attack. There is no capability to load and run a program in the interactive desktop remotely.
Wasn't there a change to the handling of the WM_TIMER message in Windows XP Service Pack 1?
Yes. The WM_TIMER message handling in Windows XP Service Pack 1 was changed and also addresses this issue. We're delivering a patch for two reasons: to provide the same changes to WM_TIMER for other Windows versions, and to deliver additional changes that have the effect of making certain processes more robust when running in the interactive desktop. Because the patch contains these additional fixes, we recommend that even customers who have applied Windows XP Service Pack 1 also apply the patch.
Are all the changes for Windows 2000 and Windows XP also being made on Windows NT 4.0?
The Windows NT 4.0 patch fixes the vulnerability with WM_TIMER and eliminates the attacks that we're aware of. However, because of their more modern and robust system architectures, it was possible for us to make additional changes to Windows 2000 and Windows XP that provide added defense in depth that should help protect against related threats in the future.
What does the patch do?
The patch addresses the vulnerability by changing the handling of the WM_TIMER message so that an unregistered callback function can not be called. The patch also includes changes to message handling by some Microsoft provided processes that can run as interactive services.
Download locations for this patch
- Windows NT 4.0:
- Windows NT 4.0, Terminal Server Edition:
- Windows 2000:
- Windows XP:
Additional information about this patch
- The Windows NT 4.0 patch can be installed on systems running Service Pack 6a.
- The Windows NT 4.0, Terminal Server Edition patch can be installed on systems running Windows NT 4.0, Terminal Server Edition Service Pack 6.
- The Windows 2000 patch can be installed on systems running Windows 2000 Service Pack 2 or Service Pack 3.
- The patch for Windows XP can be installed on systems running Windows XP Gold or Service Pack 1.
Inclusion in future service packs:
The fix for this issue will be included in Windows 2000 Service Pack 4 and Windows XP Service Pack 2.
Reboot needed: Yes
Patch can be uninstalled: Yes
Superseded patches: None.
Verifying patch installation:
Windows NT 4.0:
To verify that the patch has been installed on the machine, confirm that all files listed in the file manifest in Knowledge Base article 328310 are present on the system.
Windows NT 4.0 Terminal Server Edition:
To verify that the patch has been installed on the machine, confirm that all files listed in the file manifest in Knowledge Base article 328310 are present on the system.
To verify that the patch has been installed on the machine, confirm that the following registry key has been created on the machine: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows 2000\SP4\Q328310.
To verify the individual files, use the date/time and version information provided in the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows 2000\SP4\Q328310\Filelist.
If installed on Windows XP Gold:
To verify that the patch has been installed, confirm that the following registry key has been created on the machine: HKLM\Software\Microsoft\Updates\Windows XP\SP1\Q328310.
To verify the individual files, use the date/time and version information provided in the following registry key: HKLM\Software\Microsoft\Updates\Windows XP\SP1\Q328310\Filelist.
If installed on Windows XP Service Pack 1:
To verify that the patch has been installed, confirm that the following registry key has been created on the machine: HKLM\Software\Microsoft\Updates\Windows XP\SP2\Q328310.
To verify the individual files, use the date/time and version information provided in the following registry key: HKLM\Software\Microsoft\Updates\Windows XP\SP2\Q328310\Filelist.
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
- Microsoft Knowledge Base article 328310 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.
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.
- V1.0 (December 11, 2002): Bulletin Created.
- V1.1 (December 17, 2002): Updated information in Additional information section.
- V1.2 (February 03, 2003): Subsequent to the release of this bulletin it was determined that the patch for Microsoft Windows NT 4.0 machines introduced an error that may, under certain configurations, cause NT 4.0 to fail. The bulletin has been updated to remove the download links for the NT 4.0 patch and will be revised again once the updated package is available.
- V2.0 (February 07, 2003): Microsoft has investigated this issue and is releasing an updated patch for Windows NT 4.0. The bulletin has been modified to include the new download links for the revised NT 4.0 patch.
- V2.1 (February 28, 2003): Updating bulletin to clarify that the February 7th republishing did not affect NT 4.0 TSE, except for the Japanese Language. Customers running the Japanese version of NT 4.0 TSE should apply the updated fix.
- V3.0 (April 30, 2003): Updated bulletin to refer to updated patch for Windows NT 4.0 Terminal Server Edition.
Built at 2014-04-18T13:49:36Z-07:00 </https:>