Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Same-origin check in nsXMLHttpRequest::OnChannelRedirect() can be circumvented

VERIFIED FIXED

Status

()

Core
Security
VERIFIED FIXED
9 years ago
9 years ago

People

(Reporter: moz_bug_r_a4, Assigned: jst)

Tracking

({testcase, verified1.8.1.15, verified1.8.1.16})

1.8 Branch
x86
Windows XP
testcase, verified1.8.1.15, verified1.8.1.16
Points:
---
Bug Flags:
blocking1.8.1.15 +
blocking1.8.1.16 +
wanted1.8.1.x +
blocking1.8.0.next +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sg:high xss])

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
This is fx2-only.  (On trunk, the same-origin check in question compares an old
URI to a new URI.)

The same-origin check in nsXMLHttpRequest::OnChannelRedirect() uses a principal
of an associated JS context.  It can be circumvented by loading a cross-origin
page in that context before nsXMLHttpRequest::OnChannelRedirect() is called.

By using this trick, an attacker can read contents and http headers of a target
site.

Upcoming testcase consists of an html and a cgi script, thus it does not work
on bugzilla.mozilla.org.  Please set up it in a suitable place.
Flags: blocking1.8.1.16?
Whiteboard: [sg:high xss]
(Assignee)

Comment 3

9 years ago
Jonas, any reason not to just make fx2 do what trunk does here? I.e. just compare the URIs and not bother using the unreliable context pointer here?
Yup, that's what we should do
Assignee: nobody → jonas

Comment 5

9 years ago
Jonas can you work up the patch?
(Assignee)

Comment 6

9 years ago
Created attachment 325799 [details] [diff] [review]
Fix per above comments.

This fixes this bug, verified with local install of the testcase.
Assignee: jonas → jst
Status: NEW → ASSIGNED
Attachment #325799 - Flags: superreview?(jonas)
Attachment #325799 - Flags: review?(jonas)
Attachment #325799 - Flags: superreview?(jonas)
Attachment #325799 - Flags: superreview+
Attachment #325799 - Flags: review?(jonas)
Attachment #325799 - Flags: review+
(Assignee)

Comment 7

9 years ago
Comment on attachment 325799 [details] [diff] [review]
Fix per above comments.

Not sure if we've decided to take more changes for 1.8.1.15, but if we did this would be a good candidate.
Attachment #325799 - Flags: approval1.8.1.15?
Flags: blocking1.8.1.15+
Flags: wanted1.8.1.x+
Flags: blocking1.8.1.16?
Flags: blocking1.8.1.16+
Keywords: testcase
Comment on attachment 325799 [details] [diff] [review]
Fix per above comments.

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 #325799 - Flags: approval1.8.1.16+
Attachment #325799 - Flags: approval1.8.1.15?
Attachment #325799 - Flags: approval1.8.1.15+
(Assignee)

Comment 9

9 years ago
Fix landed on both branches.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Keywords: fixed1.8.1.15, fixed1.8.1.16
Resolution: --- → FIXED
Verified the bug with Firefox 2.0.0.14 and the fix with the final 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).
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.15 → verified1.8.1.15
Keywords: fixed1.8.1.17 → fixed1.8.1.16
Group: security
I've verified this, again, with : Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.16) Gecko/2008070205 Firefox/2.0.0.16. With 2.0.0.14, I get the data from mozilla.com in great detail. This does not happen in 2.0.0.16.
Keywords: fixed1.8.1.16 → verified1.8.1.16

Updated

9 years ago
Flags: blocking1.8.0.15+
Flags: blocking1.8.1.17+ → blocking1.8.1.16+
Comment on attachment 325799 [details] [diff] [review]
Fix per above comments.

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