| NSFOCUS Security Advisory(SA2003-05)
Topic: Microsoft IIS ssinc.dll Over-long Filename Buffer Overflow Vulnerability
Release Date: 2003-05-30
CVE CAN ID : CAN-2003-0224
Affected system: ===========
- Microsoft IIS 5.0
Unaffected system: =========== - Microsoft IIS 4.0 - Microsoft IIS 5.1
Impact: =====
NSFOCUS Security Team has found a buffer overflow vulnerability in the way a dynamic linking library (ssinc.dll)that is shipped with Microsoft IIS 4.0/5.0 handles the files it contains. Exploiting the vulnerability local attackers could gain local system privilege.
Description: ========
Microsoft IIS supports SSI(Server Side Include) functionality. ssinc.dll is a SSI interpreter. By default extended name .stm,.shtm and .shtml will be mapped to interpreter(ssinc.dll).
SSI supports "#include" command. Typically it is used as the following:
<!--#include file="filename"-->
When handling "#include" command ssinc.dll will first attempt to gain the physical path of the shtml file, so it will copy the URI request to a buffer the size of which is fixed. For example, when requesting the following shtml file: http://iishost/abc/test.shtml
It will copy "/abc/test.shtml" to a buffer the size of which is fixed. Because the length of the shtml filename has not been checked during the copying, it causes a stack buffer overflow.
NSFocus Security Team has found a similar problem. See http://www.nsfocus.net/index.php?act=advisory&do=view&adv_id=17 The corresponding Microsoft Security Bulletin is: http://www.microsoft.com/technet/security/bulletin/ms01-044.asp
This vulnerability occurred before that one.
IIS has checked the over-long shtml filename to avoid buffer overflow, while its method is to shorten the filename to legal length, then attempt to open it. After that ssinc.dll will still use the original URI to finish the copy. Therefore, by creating a WEB file with special length local attackers could bypass the check, then request a shtml file with an over-long filename to cause a buffer overflow, which would cause IIS cease to respond. By carefully crafting the overflow data attackers could run arbitrary code with Local System privilege.
Two conditions are required to carry out the attack:
1. Attackers need to have the privilege to create files on web directory. 2. Attackers need to be able to access the created files via web service.
Workaround: ======== 1. Disable untrusted users' writing privilege to web directory. 2. If SSI functionality is not required, remove .shtml, .shtm, .stm mapping. 3. Install IIS Lockdown tools provided by Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=dde9efc0-bb30-47eb-9a61-fd755d23cdec&displaylang=en
Vendor Status: ==========
2002.11.05 Inform vendor about the issue 2003.05.28 Microsoft has issued a Security Bulletin(MS03-018) and the related patch.
Detailed Microsoft Security Bulletin is available at:
http://www.microsoft.com/technet/security/bulletin/ms03-018.asp
Patches are available at:
http://microsoft.com/downloads/details.aspx?FamilyId=2F5D9852-4ADD-44F8-8715-AC3D7D7D94BF.
Additional Information: ===============
The Common Vulnerabilities and Exposures (CVE) project has assigned the name CAN-2003-0224 to this issue. This is a candidate for inclusion in the CVE list (http://cve.mitre.org), which standardizes names for security problems. Candidates may change significantly before they become official CVE entries.
Credit: =======
This vulnerability was discovered by Ren Guang Yuan of NSFOCUS Security Team. |