IE scripting Vulnerabilities

From: zosimov (zosimov@NETMCR.COM)
Date: 07/11/02


Date:         Thu, 11 Jul 2002 12:40:30 -0400
From: zosimov <zosimov@NETMCR.COM>
To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM

From http://www.pivx.com

Thor Larholm, PivX security advisory TL#003
Topic: IE allows universal Cross Domain Scripting.

Discovery date: 25 June 2002.

Affected applications:

Any application that hosts the WebBrowser control. Some of these are:

  a.. Microsoft Internet Explorer
  b.. Microsoft Outlook
  c.. Microsoft Outlook Express
Severity: High

Impact:
Elevating privileges, arbitrary command execution, local file reading, stealing arbitrary cookies, etc.

Authors:
Patrick Zumstein and Thor Larholm.

Introduction:
One of the many elements in HTML 4 is the OBJECT element which is used to embed external objects inside a page. Such objects can be the WebBrowser control and other ActiveX controls, images, applets and more.
The object property of embedded WebBrowser controls is not subject to the Cross Domain security checks that embedded HTML documents ordinarily go through, and as such it is possible to escape any sandboxing and security zone restrictions.

Discussion:
Any document can extend the properties exposed by the OBJECT element, and any namespace conflicts are handled by querying the object property which is a duplicate reference to the embedded document.
When embedding a document from the same site (same protocol, port and host) it is possible to make a reference to the object property without circumventing any Cross Domain security checks. After having established a reference we will then change the location of the document being embedded.
The location changes but the reference stays, and we now have complete access to the DOM of the foreign document.
The default object being referenced by the object property in the case of text/html is the document object. The simple proof-of-concept exploit below will read the cookie from passport.com.
The OBJECT element is not restricted to embedding HTML documents, but can embed objects of any type. As such, this vulnerability could be extended even further.

Exploit:

<object id="data" data="empty.html" type="text/html"></object>
<script>
var ref=document.getElementById("data").object;
ref.location.href = "http://www.passport.com";
setTimeout("alert(ref.cookie)",5000);
</script>

Solution: (for users)
Disable ActiveX by Setting "Script ActiveX controls marked safe for scripting" to Prompt or Disable.
or Install proactive content security solution such as SurfinGate or other Finjan Software .

Tested on:
IE6 Win2000, all patches and servicepacks.
IE5.5 Win98, all patches and servicepacks.
IE5.5 WinNT 4, all patches and servicepacks.
IE6 WinXP, all patches and servicepacks.

Demonstration:
I have put together some proof-of-concept examples:

  a.. Read foreign cookies
  b.. Read local (or foreign) file
  c.. Execute arbitrary commands
Vendor status:
Microsoft was notified 25 June 2002.

Mitigating factors:
Outlook and OE are not directly affected if they run in the Restricted zone.

Postscript:
On June 25, Patrick Zumstein notified Thor Larholm, Georgi Guninski and PacketStormSecurity about a possible vulnerability. In working together, Patrick and Thor quickly outlined the culprit and prepared this advisory, after which Microsoft were notified immediately.
Since this is possibly very publicly known by now I have decided to release this advisory after only 2 weeks times, so that system administrators and end users may possibly apply the provided workaround to temporarily secure themselves until a proper patch has been made.

Feedback:

Please mail any questions or comments to Thor Larholm - thor@pivx.com

contact (at) jscript (dot) dk

References:

Microsoft: About Cross-Frame Scripting and Security
- http://msdn.microsoft.com/workshop/author/om/xframe_scripting_security.asp
OBJECT element
- http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/object.asp
object property
- http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/object.asp
Unpatched Internet Explorer Vulnerabilities
- http://pivx.com/larholm/unpatched/



Relevant Pages

  • [Full-Disclosure] MS web designers -- "What Security Initiative?"
    ... I commented on the uselessness of the "new, improved" MS Security ... like me whose security sensibilities require surfing with scripting ... the reason for today's swing at MS' web designers -- spam. ... window.parent.location.replace to redirect the page. ...
    (NT-Bugtraq)
  • MS web designers -- "What Security Initiative?"
    ... I commented on the uselessness of the "new, improved" MS Security ... like me whose security sensibilities require surfing with scripting ... the reason for today's swing at MS' web designers -- spam. ... window.parent.location.replace to redirect the page. ...
    (Bugtraq)
  • [Full-Disclosure] MS web designers -- "What Security Initiative?"
    ... I commented on the uselessness of the "new, improved" MS Security ... like me whose security sensibilities require surfing with scripting ... the reason for today's swing at MS' web designers -- spam. ... window.parent.location.replace to redirect the page. ...
    (Full-Disclosure)
  • MS web designers -- "What Security Initiative?"
    ... I commented on the uselessness of the "new, improved" MS Security ... like me whose security sensibilities require surfing with scripting ... the reason for today's swing at MS' web designers -- spam. ... window.parent.location.replace to redirect the page. ...
    (Full-Disclosure)
  • [NT] IE Allows Universal Cross Domain Scripting
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The object property of embedded WebBrowser controls is not subject to the ... The OBJECT element is not restricted to embedding HTML documents, ...
    (Securiteam)