Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   Application (Web Browser)  >   Mozilla Firefox Vendors:
Mozilla Firefox onUnload Event and document.write() Race Condition May Let Remote Users Execute Arbitrary Code
SecurityTracker Alert ID:  1017701
SecurityTracker URL:
CVE Reference:   CVE-2007-1092   (Links to External Site)
Updated:  May 18 2008
Original Entry Date:  Feb 26 2007
Impact:   Execution of arbitrary code via network, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  Exploit Included:  Yes  
Version(s): and only
Description:   A vulnerability was reported in Mozilla Firefox. A remote user may be able to cause arbitrary code to be executed on the target user's system.

A remote user can create specially crafted HTML that, when loaded by the target user, will trigger a memory corruption error and potentially execute arbitrary code on the target system. The code will run with the privileges of the target user.

A race condition between the onUnload event handler and self-modifying document.write() calls can trigger the vulnerability.

The vulnerability was introduced in Firefox and Earlier versions are not affected.

A demonstration exploit is available at:

Michal Zalewski reported this vulnerability.

The Mozilla bug report is available at:

Impact:   A remote user can create HTML that, when loaded by the target user, will execute arbitrary code on the target user's system.
Solution:   The vendor has issued a fix (,

The Mozilla advisory is available at:

Vendor URL: (Links to External Site)
Cause:   Boundary error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.

 Source Message Contents

Subject:  [Full-disclosure] Firefox onUnload + document.write() memory

While researching my previous report on MSIE7 browser entrapment, I
noticed that Firefox is susceptible to a pretty nasty, and apparently
easily exploitable memory corruption vulnerability. When a location
transition occurs and the structure of a document is modified from within
onUnload event handler, freed memory structures are left in inconsistent
state, possibly leading to a remote compromise.

A quick test case that crashes while trying to follow partly
user-dependent corrupted pointers near valid memory regions (can be forced
to write, too):

This also crashes MSIE7 with a seemingly harmless NULL pointer bug (didn't
research it - do your homework).

Firefox problem is being tracked here:


Full-Disclosure - We believe in it.
Hosted and sponsored by Secunia -


Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, LLC