Description: A weakness and a vulnerability have been discovered in Safari, which can be exploited by malicious people to potentially conduct cross-site scripting attacks or to disclose sensitive information.
1) An error exists in the parsing of comments within certain tags of an HTML document. Arbitrary HTML and script code in a comment tag is executed in a user's browser session when preceded by the corresponding closing tag (e.g. the title tag).
Successful exploitation is possible on web sites that allow users to insert unsanitised HTML and script code within a comment into such a tag.
2) Errors exist in the handling of new browser windows. This can be exploited via a malicious web page to access and disclose the location or the path and query parameters of an opened browser window via Javascript when a user follows a specially crafted link.
The weakness and vulnerability are confirmed in Safari 2.0.4. Other versions may also be affected.
Provided and/or discovered by: 1) Jose Avila III
2) Independently discovered by Secunia Research and Gareth Heyes.
Changelog: 2007-01-30: Added CVE reference.
2007-05-18: Added vulnerability #2. Updated "Criticality".
2007-06-01: Added CVE reference.
2007-07-06: Updated vulnerability #2 with information provided by Gareth Heyes.
2007-08-01: Added CVE reference. Updated "Solution" and credits section. Added link to "Original Advisory" section.
2007-09-26: Updated link in "Original Advisory" section.
If you have new information regarding this Secunia advisory or a product in our database, please send it to us using either our web form or email us at vuln@secunia.com.
Ideas, suggestions, and other feedback are most welcome.