The vulnerability, first reported by Danish vulnerability tracker Secunia and confirmed by the United States Computer Emergency Readiness Team (US-CERT), was disclosed by Polish researcher Krystian Kloskowski on Friday. The bug is caused by an error in the handling of the browser's parent windows.

"This can be exploited to execute arbitrary code when a user visits a specially-crafted Web page and closes opened pop-up windows," said Secunia's alert.

The vulnerability can also be exploited by attackers who dupe users into opening rigged HTML-based e-mail within Safari, added US-CERT in its advisory. That scenario likely would involve tricking users into opening malicious messages in a Web mail service, such as Gmail or Windows Live Hotmail.

Both Secunia and US-CERT confirmed today that the proof-of-concept attack code published by Kloskowski successfully compromises the Windows version of Safari 4.0.5, the most up-to-date edition. Secunia rated the vulnerability as "highly critical," the second-most-dangerous ranking in its five-step threat scoring system.

It's not known whether the vulnerability also exists in the much more widely used Mac OS X version of Apple's software. "Other versions may also be affected," cautioned US-CERT.

Charlie Miller, the noted vulnerability researcher who won $10,000 by hacking a Mac in March at the Pwn2Own contest, was out of his office and not able to verify that the bug also exists in Safari on Mac OS X.

US-CERT urged users of the Windows version of Safari to disable JavaScript as a temporary defense.