Computerworld

IE URI encoding behavior facilitates XSS attacks, researchers say

IE's failure to percent-encode double quotes in URLs can be exploited in XSS attacks

An inconsistency in how Microsoft's Internet Explorer (IE) encodes double quotes in URIs (uniform resource identifiers) can facilitate cross-site scripting (XSS) attacks, researchers from security firm Imperva claim.

"Internet Explorer (IE) doesn't encode double quote characters (") in the query part of the uniform resource identifier (URI)," Rob Rachwald, Imperva's director of security strategy, said in a blog post.

"This behavior, besides being non standard (as stated by RFC 3986 [the Internet Engineering Task Force memorandum describing the generic URI syntax] and implemented by other browsers including Chrome or Firefox) may expose IE users to reflected XSS attacks," he said.

According to RFC 3986, some characters can have a special meaning when used in the URI syntax and can change how the URI gets interpreted by applications.

However, when these URI characters don't serve a special purpose, they should be percent-encoded. The percent-encoded form of the double quote character is %22.

Imperva argues that because most browsers automatically encode special characters in URLs, some Web developers might be inclined to process request URLs in the source code of their websites without making sure that they are properly sanitized.

A hacker who identifies such a website can craft a link to it that contains a double quote followed by malicious JavaScript code. If an IE user clicks on that link, the rogue JavaScript code will be executed inside their browser. This is known as a reflected XSS attack.

Imperva claims to have notified Microsoft about the issue, but was told by the software company that this behavior is not considered a vulnerability and will not be fixed in a security update. The behavior might, however, get changed in a future IE version, Microsoft allegedly said.

Rachwald does not agree with Microsoft's assessment. "In fact, on XSSed.com (a site for public disclosure of XSS vulnerabilities), the vulnerability's presence is beginning to be felt," he said. "We have seen reported sites that are exposed to XSS attacks on IE only, due to its encoding bug."

We are still waiting for clarifications about this issue from Microsoft after contacting the company two days ago. Meanwhile, other security researchers believe that even if it does make XSS exploitation easier, this unusual IE URI encoding behavior doesn't qualify as a vulnerability.

Jeremiah Grossman, a well-known Web security expert and CTO at WhiteHat Security, said that websites affected by this behavioral difference are already vulnerable because they don't sanitize their data. "The vulnerability in the website itself must be fixed regardless or what the browser does or does not do," he said.

Grossman has seen countless proof-of-concept examples of XSS vulnerabilities that can only be exploited in Internet Explorer, but he hasn't seen any actual live malicious attacks that exploit this particular behavior.

"The only 'good' reason to change the behavior would be if there was some eminent security threat, which there doesn't seem to be, or to be more consistent with Web standards," Grossman said. According to him, changing the way IE automatically encodes URLs could impact usability and might actually end up breaking some websites.