Gaping Holes Found in IE, Firefox

JavaScript has once again reared its buggy head, as a security researcher finds major critical JS holes in both Internet Explorer and Firefox.

The researcher, Michal Zalewski, on June 4 reported a JavaScript flaw in fully patched IE 6 and 7 that can allow an attacker to fiddle with a documents Document Object Model—a model for representing HTML or XML and related formats.

The result can be cookie stealing or cookie resetting, browser crash, page hijacking, code injection or memory corruption.

The vulnerability occurs when JavaScript code instructs the IE application to navigate away from a page that meets same-domain origin policy, Zalewski said.

This makes it possible for an attacker to access and modify the command, directing the browser to an unrelated third-party site. During the redirect, the attacker has a window of time in which to execute JavaScript that has permissions pertaining to the first page visited, not the third-party page to which the browser has been redirected.

The previous permissions pertain to content for the newly loaded page, which can be malicious, such as:

  • Read or set victim.document.cookie
  • Arbitrarily alter document DOM, including changing form submission URLs, injecting code
  • Read or write DOM structures that were not fully initialized, prompting memory corruption and browser crash.
Zalewski has posted a demo here.

Zalewski found another bug, this one of medium impact, having to do with an IE 6 file prompt delay bypass that could lead to a forced download or execution of files—URL bar spoofing. IE 7 isnt affected, he said, due to high-level browser changes. Hes posted a demo here.

Microsoft is investigating the two possible vulnerabilities. A spokesperson said that at this point, the company isnt aware of any attacks that have tried to exploit the flaws.

The Firefox flaw Zalewski uncovered also boils down to a JavaScript error. This flaw allows an attacker to inject malicious code, including key-snooping event handlers, on pages that rely on IFrames (inline frames) to display contents or store state data—in other words, the unique configuration of information in a program or machine—or to communicate with a server.

An IFrame is an HTML element through which one HTML document can be embedded within a main document.

This problem, which Zalewski tags as being a major flaw, can lead to interception of keystrokes and content spoofing, among other things. Mozilla said that the flaw allows attackers to display "offensive, misleading or dangerous contents on trusted sites" or to spoof login prompts. An attacker can also track user behavior, such as timing when a victim arrived and departed at a site, because of the presence of IFrames.

/zimages/6/28571.gifJavaScript attacks keep getting slicker. Click here to read more.

Mozilla also said that this flaw is a duplicate of a previously reported flaw, Bug 381300.

Zalewski responded on Mozillas bug site by agreeing that the underlying bugs are "very much the same," but that the attack scenario differs from his findings in two ways.

"The initial report considered only a more benign opportunity (page element spoofing vs. snooping on user input), and did not account for the possibility that persistent about:blank frames that do not require a race condition to occur (which is important when considering a proper fix; but that point is moot if you plan to backport a more comprehensive fix from trunk)."

Zalewski has a demo of the Firefox bug here.

Check out eWEEK.coms Security Center for the latest security news, reviews and analysis. And for insights on security coverage around the Web, take a look at eWEEKs Security Watch blog.