J-Security Center

Title: Microsoft Windows DLL Search Path Weakness

Severity: HIGH

Description:

When a program executes under Microsoft Windows, it may require additional code stored in DLL library files. These files are dynamically located at run time, and loaded if necessary. A weakness exists in the algorithm used to locate these files.

When a DLL is loaded, a number of locations are checked in the following order:

1. The directory where the executable module for the current process is located.
2. The current directory.
3. The Windows system directory.
4. The Windows directory.
5. The directories listed in the PATH environment variable.

As a result of this, a DLL located in the current working directory may take precedence over a system DLL with the same name. Under some conditions this is a desirable feature, for example legacy programs may require older copies of DLLs in order to function properly.

However, an attacker may be able to exploit this algorithm. First, a trojaned DLL must be placed onto the target system. A local user must then be enticed into executing a program which requires this DLL, from the same directory the trojan resides in. In this case the trojaned DLL will be loaded instead of the expected system DLL, and malicious code may execute.

It has been demonstrated that this may be accomplished when a DLL and a Microsoft Office document reside in the same directory. In the case of word documents, both the 'riched20.dll' and 'msi.dll' files are loaded. If the word document is accessed through the 'Run' command or through Windows Explorer, DLLs located in the same directory as the document may be loaded in preference to those stored in Windows system directories. Excel and WordPad have also been reported as susceptible to this issue.

By default, Windows Explorer hides DLL files from the end user. This may aid in social engineering attacks against this vulnerability.

This is a well known method of inserting trojaned binaries onto a system. It is common security practice to exclude the current working directory from executable search paths for similar reasons.

This behavior has also been reported for files loaded from UNC shares, or directly from FTP servers.

Affected Products:

  • Avaya DefinityOne Media Servers
  • Avaya IP600 Media Servers
  • Avaya S3400 Message Application Server
  • Avaya S8100 Media Servers
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Advanced Server SP1
  • Microsoft Windows 2000 Advanced Server SP2
  • Microsoft Windows 2000 Datacenter Server
  • Microsoft Windows 2000 Datacenter Server SP1
  • Microsoft Windows 2000 Datacenter Server SP2
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Professional SP1
  • Microsoft Windows 2000 Professional SP2
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Server SP1
  • Microsoft Windows 2000 Server SP2
  • Microsoft Windows 95
  • Microsoft Windows 95 0.0.0SP1
  • Microsoft Windows 95 0.0.0SR2
  • Microsoft Windows 98
  • Microsoft Windows 98 SP1
  • Microsoft Windows 98SE
  • Microsoft Windows ME
  • Microsoft Windows NT Enterprise Server 4.0
  • Microsoft Windows NT Enterprise Server 4.0 SP1
  • Microsoft Windows NT Enterprise Server 4.0 SP2
  • Microsoft Windows NT Enterprise Server 4.0 SP3
  • Microsoft Windows NT Enterprise Server 4.0 SP4
  • Microsoft Windows NT Enterprise Server 4.0 SP5
  • Microsoft Windows NT Enterprise Server 4.0 SP6
  • Microsoft Windows NT Enterprise Server 4.0 SP6a
  • Microsoft Windows NT Server 4.0
  • Microsoft Windows NT Server 4.0 SP1
  • Microsoft Windows NT Server 4.0 SP2
  • Microsoft Windows NT Server 4.0 SP3
  • Microsoft Windows NT Server 4.0 SP4
  • Microsoft Windows NT Server 4.0 SP5
  • Microsoft Windows NT Server 4.0 SP6
  • Microsoft Windows NT Server 4.0 SP6a
  • Microsoft Windows NT Terminal Server 4.0
  • Microsoft Windows NT Terminal Server 4.0 SP1
  • Microsoft Windows NT Terminal Server 4.0 SP2
  • Microsoft Windows NT Terminal Server 4.0 SP3
  • Microsoft Windows NT Terminal Server 4.0 SP4
  • Microsoft Windows NT Terminal Server 4.0 SP5
  • Microsoft Windows NT Terminal Server 4.0 SP6
  • Microsoft Windows NT Workstation 4.0
  • Microsoft Windows NT Workstation 4.0 SP1
  • Microsoft Windows NT Workstation 4.0 SP2
  • Microsoft Windows NT Workstation 4.0 SP3
  • Microsoft Windows NT Workstation 4.0 SP4
  • Microsoft Windows NT Workstation 4.0 SP5
  • Microsoft Windows NT Workstation 4.0 SP6
  • Microsoft Windows NT Workstation 4.0 SP6a
  • Microsoft Windows XP 64-bit Edition
  • Microsoft Windows XP Home
  • Microsoft Windows XP Professional

References:

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.