Semicolon attack on Microsoft IIS

The_Unbeliever

Honorary Master
Joined
Apr 19, 2005
Messages
103,196
http://www.theregister.co.uk/2009/12/25/microsoft_iis_semicolon_bug/

The bug stems from the way IIS parses file names with colons or semicolons in them, according to researcher Soroush Dalili. Many web applications are configured to reject uploads that contain executable files, such as active server pages, which often carry the extension ".asp." By appending ";.jpg" or other benign file extensions to a malicious file, attackers can bypass such filters and potentially trick a server into running the malware.
 

bekdik

Honorary Master
Joined
Dec 5, 2004
Messages
12,860
can't access the article due to cap, but isn't this bug more to do with bad web site design than iis? The filename parse should handle this if correctly written
 

The_Unbeliever

Honorary Master
Joined
Apr 19, 2005
Messages
103,196
bekdik : the full article

yup, seems lazy software is to be blamed for that. Whenever there is user input, algorithms should be present to scrub and sanitize the input, but it's convenient to not use algorithms and hope nobody will take a shufty at that sort of input...

Updated A researcher has identified a vulnerability in the most recent version of Microsoft's Internet Information Services that allows attackers to execute malicious code on machines running the popular webserver.

The bug stems from the way IIS parses file names with colons or semicolons in them, according to researcher Soroush Dalili. Many web applications are configured to reject uploads that contain executable files, such as active server pages, which often carry the extension ".asp." By appending ";.jpg" or other benign file extensions to a malicious file, attackers can bypass such filters and potentially trick a server into running the malware.

There appears to be some disagreement over the severity of the bug, which Dalili said affects all versions of IIS. While he rated it "highly critical," vulnerability tracker Secunia classified it as "less critical," which is only the second notch on its five-tier severity rating scale.

"Impact of this vulnerability is absolutely high as an attacker can bypass file extension protections by using a semicolon after an executable extension such as '.asp,' '.cer,' '.asa' and so on," Dalili wrote. "Many web applications are vulnerable against file uploading attacks because of this weakness of IIS."

In an email to El Reg, Dalili offered the following attack scenario:

"Assume a website which only accepts JPG files as the users’ avatars. And the users can upload their avatars on the server. Now an attacker tries to upload "Avatar.asp;.jpg" on the server. Web application considers this file as a JPG file. So, this file has the permission to be uploaded on the server. But when the attacker opens the uploaded file, IIS considers this file as an ASP file and tries to execute it by 'asp.dll.'

"So, the attacker can upload a web-shell on the server by using this method. Most of the uploaders only control the last part of the files as their extensions, and by using this method, their protection will be bypassed."

Secunia didn't explain how it arrived at its assessment, but it did confirm the bug on a machine running a fully patched version of Windows Server 2003 R2 SP2 with Microsoft IIS version 6.

A Microsoft spokeswoman said company researchers are investigating the report. They are not aware of attacks targeting the reported vulnerability, she said.

In the absence of any official guidance, webmasters who want to workaround the potential problem should make sure that upload directories don't have execute permissions. And web developers should ensure their applications never accept the user's input as a file name.

More from Dalili and Secunia are here (PDF) and here. ®
 

bekdik

Honorary Master
Joined
Dec 5, 2004
Messages
12,860
Ta.

That makes it even more confusing! This 'bug' would apply to any bit of badly written code!

It's a bit like saying a Mercedes is vulnerable to smashing into walls!
 
Top