Closed Bug 1182539 Opened 10 years ago Closed 10 years ago

Use channel->ascynOpen2 in dom/base/nsDocument.cpp

Categories

(Core :: DOM: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Assignee: nobody → mozilla
Blocks: 1182535
Jonas, isn't CheckLoadURIWithPrincipal() and CheckMayLoad() mutually exlusive? One would need the flag SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS and the other SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS.
Flags: needinfo?(jonas)
Comment on attachment 8640301 [details] [diff] [review] bug_1182539_asyncopen2_nsdocument.patch Review of attachment 8640301 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsDocument.cpp @@ +1292,1 @@ > nsCOMPtr<nsIInterfaceRequestor> req = nsContentUtils::SameOriginChecker(); You don't need the same-origin checker since AsyncOpen2 will enforce same-origin if you pass it the right flags.
CheckMayLoad is strictly more restrictive than CheckLoadURI. I wouldn't call them mutually exclusive, but rather that the CheckLoadURI check is redundant and unnecessary. What you want here though is a same-origin policy since the old code enforces same-origin.
Flags: needinfo?(jonas)
(In reply to Jonas Sicking (:sicking) from comment #3) > What you want here though is a same-origin policy since the old code > enforces same-origin. Alrighty, that should do it then!
Attachment #8640301 - Attachment is obsolete: true
Attachment #8640657 - Flags: review?(jonas)
Comment on attachment 8640657 [details] [diff] [review] bug_1182539_asyncopen2_nsdocument.patch Review of attachment 8640657 [details] [diff] [review]: ----------------------------------------------------------------- This looks good to me. Though IIRC there's enough special stuff involved with subresources that it might be good to get bz's review.
Attachment #8640657 - Flags: review?(jonas)
Attachment #8640657 - Flags: review?(bzbarsky)
Attachment #8640657 - Flags: review+
Boris, one difference with this code is that a load from data: will return a resource whose GetChannelResponsePrincipal will be the principal of the loading document. I.e. we'll inherit the principal. That seems desired, but it's not actually what the old code does. I'm not sure if it makes a difference though?
Comment on attachment 8640657 [details] [diff] [review] bug_1182539_asyncopen2_nsdocument.patch Yeah, the data: change there looks reasonable. r=me
Attachment #8640657 - Flags: review?(bzbarsky) → review+
url: https://hg.mozilla.org/integration/mozilla-inbound/rev/0fbb2ec4b4a84968764a678474fa2ce35a8b2085 changeset: 0fbb2ec4b4a84968764a678474fa2ce35a8b2085 user: Christoph Kerschbaumer <mozilla@christophkerschbaumer.com> date: Fri Jul 31 08:58:14 2015 -0700 description: Bug 1182539 - Use channel->ascynOpen2 in dom/base/nsDocument.cpp (r=sicking)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: