Closed
Bug 634834
Opened 14 years ago
Closed 14 years ago
It's possible to call history.pushState/replaceState on a cross-origin page
Categories
(Core :: Security, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox5 | --- | unaffected |
firefox6 | --- | unaffected |
firefox7 | --- | unaffected |
firefox8 | --- | unaffected |
blocking2.0 | --- | final+ |
status1.9.2 | --- | unaffected |
status1.9.1 | --- | unaffected |
People
(Reporter: moz_bug_r_a4, Assigned: justin.lebar+bug)
References
Details
(Whiteboard: [sg:high][hardblocker])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
The fix for bug 619359 can be circumvented. After the security check passed,
when stringifying a state data argument, a new document can be loaded in the
associated window.
Reporter | ||
Comment 1•14 years ago
|
||
This tries to get cookies for html5demos.com.
This works on trunk.
Comment 3•14 years ago
|
||
sg:crit? if not, doesn't block
Security bug in a new feature, blocking.
Assigning to blake as wrappers should save us.
Assignee: nobody → mrbkap
blocking2.0: ? → final+
Updated•14 years ago
|
Whiteboard: [sg:high]
Assignee | ||
Comment 5•14 years ago
|
||
mrbkap and I don't think this is a wrappers problem.
I think I have a simple fix; I'll be able to test it out in a few days.
Assignee: mrbkap → justin.lebar+bug
Justin: Do you think the fix will be risky and need beta coverage? Or would putting it just in the RC be enough.
If it's just touching code run by pushState then I'd think the latter.
Assignee | ||
Comment 7•14 years ago
|
||
I think it's just a few lines in docshell, to make sure that mCurrentURI after the stringification is same-origin as the new URI.
Assignee | ||
Comment 8•14 years ago
|
||
You can't just test mCurrentURI, because AIUI that doesn't get updated until after the page gets to its destination. At least, it doesn't get updated early enough for my test.
Testing that the origins of both mCurrentURI and mLoadingURI don't change as a result of the stringify seems to work. Instead of a same-origin check, I could test that mCurrentURI and mLoadingURI are the same before and after the stringification.
Any thoughts on which might be better?
Assignee | ||
Comment 9•14 years ago
|
||
(In reply to comment #8)
> You can't just test mCurrentURI, because AIUI that doesn't get updated until
> after the page gets to its destination. At least, it doesn't get updated early
> enough for my test.
Oh, actually, I think my testcase is broken. mCurrentURI is good enough for the testcase in this bug.
Assignee | ||
Comment 10•14 years ago
|
||
Verified that the testcase in this bug fails with a security error.
Attachment #513402 -
Flags: review?(bzbarsky)
Comment 11•14 years ago
|
||
Comment on attachment 513402 [details] [diff] [review]
Patch v1
Sholdn't we be comparing principals instead?
Updated•14 years ago
|
Whiteboard: [sg:high] → [sg:high][hardblocker]
Assignee | ||
Updated•14 years ago
|
Attachment #513402 -
Attachment is obsolete: true
Attachment #513402 -
Flags: review?(bzbarsky)
Comment 13•14 years ago
|
||
Comment on attachment 513518 [details] [diff] [review]
Patch v2
If you have an nsIDocument, just GetPrincipal on it you don't need the global obj.
Other than that, looks fine.
Attachment #513518 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•14 years ago
|
||
(In reply to comment #13)
> If you have an nsIDocument, just GetPrincipal on it you don't need the global
> obj.
Really? Maybe I'm missing some special sauce, but
> nsCOMPtr<nsIDocument> origDocument = do_GetInterface(GetAsSupports(this));
> nsCOMPtr<nsIPrincipal> origPrincipal = origDocument->GetPrincipal();
does not compile.
Comment 15•14 years ago
|
||
Er, GetNodePrincipal() on the document.
Assignee | ||
Comment 16•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 17•13 years ago
|
||
Updated•13 years ago
|
Attachment #513047 -
Attachment is private: true
Updated•13 years ago
|
Group: core-security
status1.9.1:
--- → unaffected
status1.9.2:
--- → unaffected
status-firefox5:
--- → unaffected
status-firefox6:
--- → unaffected
status-firefox7:
--- → unaffected
status-firefox8:
--- → unaffected
You need to log in
before you can comment on or make changes to this bug.
Description
•