Closed Bug 510868 Opened 16 years ago Closed 16 years ago

Unexpected JavaScript parsing possible to XSS attack

Categories

(Core :: DOM: HTML Parser, defect, P1)

x86
Windows XP
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: vladimir.vorontsov, Unassigned)

References

Details

(Keywords: js1.7, Whiteboard: [sg:low?] probably INVALID)

Attachments

(1 file)

User-Agent: Opera/9.64 (Windows NT 5.1; U; ru) Presto/2.1.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729) Unexpected JavaScript parsing possible to XSS attack Reproducible: Always Steps to Reproduce: 1.Create new html file 2.Put into that file following line: <script language="JavaScript">var test="</script><script>alert('ONsec.ru secrity team');</script>";</script> 3. Save file and open in Mozilla Actual Results: Alert showing! Expected Results: Nothing Vladimir Voronstov, Russian security research team onsec.ru
Keywords: js1.7
Priority: -- → P1
Attached file open this example
Why do you believe that is the expected results? The HTML parser is responsible for determining when the <script> tag closes and doesn't use JS parsing rules to determine that. I believe this bug is INVALID... in any case moving to HTML parser and cc'ing HTML parsing experts.
Component: Security → HTML: Parser
Product: Firefox → Core
QA Contact: firefox → parser
Whiteboard: [sg:low spoof?] probably INVALID
Whiteboard: [sg:low spoof?] probably INVALID → [sg:low?] probably INVALID
If it's not INVALID, it can probably be unhidden, since this is pretty well-known behavior.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is well-known behavior, and Safari does the same thing. You might be interested in HTML5-related work that could make it easier to avoid this issue in some cases: http://wiki.whatwg.org/wiki/CDATA_Escapes (from bug 503632).
Blocks: 301375
Group: core-security
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: