Closed Bug 440308 Opened 16 years ago Closed 16 years ago

XSS by using XMLHttpRequest and onreadystatechange handler

Categories

(Core :: Security, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: moz_bug_r_a4, Assigned: smaug)

Details

(Keywords: testcase, verified1.8.1.15, verified1.8.1.16, Whiteboard: [sg:high])

Attachments

(1 file)

Please see bug 403168.

This is fx2-only.  On fx2, nsXMLHttpRequest::ChangeState() does not call
CheckInnerWindowCorrectness(), thus, it's possible to perform an XSS attack by
using onreadystatechange handler.

(On trunk, nsXMLHttpRequest::ChangeState() calls NotifyEventListeners(), which
calls CheckInnerWindowCorrectness().)
Flags: wanted1.8.1.x+
Flags: blocking1.8.1.16+
Whiteboard: [sg:high]
Assignee: nobody → Olli.Pettay
Attached patch proposed patchSplinter Review
Attachment #325759 - Flags: superreview?(jst)
Attachment #325759 - Flags: review?(jst)
Comment on attachment 325759 [details] [diff] [review]
proposed patch

-      onReadyStateChangeListener) {
+      onReadyStateChangeListener &&
+      NS_SUCCEEDED(CheckInnerWindowCorrectness())) {

Looks good. This'll be the fourth caller of CheckInnerWindowCorrectness(), and it's inline. Probably worth un-inlining it now while you're here.
Attachment #325759 - Flags: superreview?(jst)
Attachment #325759 - Flags: superreview+
Attachment #325759 - Flags: review?(jst)
Attachment #325759 - Flags: review+
Well, is it really worth for the branch.
Comment on attachment 325759 [details] [diff] [review]
proposed patch

I'm not sure if this should go in to .15 or .16, but .15 is the only one I can ask approval for.
Attachment #325759 - Flags: approval1.8.1.15?
Flags: blocking1.8.1.15+
Comment on attachment 325759 [details] [diff] [review]
proposed patch

Approved for 1.8.1.15 and 1.8.1.16, a=dveditz for release-drivers

Please land on both branches (MOZILLA_1_8_BRANCH for 1.8.1.16 and GECKO181_20080612_RELBRANCH for 1.8.1.15) and give the bug both fixed1.8.1.15 and fixed1.8.1.16 keywords
Attachment #325759 - Flags: approval1.8.1.16+
Attachment #325759 - Flags: approval1.8.1.15?
Attachment #325759 - Flags: approval1.8.1.15+
Fix checked into both 1.8 branch and _relbranch
Resolving this bug as FIXED since it's branch-only.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Verified this with the new 2.0.0.15 build (Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.15) Gecko/2008062305 Firefox/2.0.0.15) and reproduced the bug on the same machine with shipped 2.0.0.14.
Status: RESOLVED → VERIFIED
Group: security
Verified this with 2.0.0.16 Firefox as well (Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.16) Gecko/2008070205 Firefox/2.0.0.16).
Flags: blocking1.8.0.15+
Flags: blocking1.8.1.17+ → blocking1.8.1.16+
Comment on attachment 325759 [details] [diff] [review]
proposed patch

This patch had approval for 1.8.1.16, but apparently the flags got moved out. Clearing that flag to clear the queries.
Attachment #325759 - Flags: approval1.8.1.17+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: