Closed
Bug 1485177
Opened 7 years ago
Closed 7 years ago
Expose the |site| on nsIPrincipal
Categories
(Core :: Security: CAPS, enhancement, P2)
Core
Security: CAPS
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
Details
(Whiteboard: [domsecurity-active])
Attachments
(1 file, 2 obsolete files)
This will make it easier in the future to encode certain behaviours which depend on a principal's |site|. The basic restriction of a site is that two documents with different sites may never be Same-Origin-Domain (a.k.a. they will never be considered |subsumesConsideringDomain|).
Assignee | ||
Comment 1•7 years ago
|
||
Updated•7 years ago
|
Component: DOM: Security → Security: CAPS
Priority: -- → P2
Whiteboard: [domsecurity-active]
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
Depends on D4702
Updated•7 years ago
|
Attachment #9005268 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #9005269 -
Attachment is obsolete: true
Comment 4•7 years ago
|
||
Comment on attachment 9003582 [details]
Bug 1485177 - Add |siteOrigin| information to nsIPrincipal
:Ehsan Akhgari has approved the revision.
Attachment #9003582 -
Flags: review+
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/33c7b0ea5caa
Add |siteOrigin| information to nsIPrincipal, r=Ehsan
Comment 6•7 years ago
|
||
Backed out changeset 33c7b0ea5caa (bug 1485177) for assertion failure at builds/worker/workspace/build/src/caps/ContentPrincipal.cpp
Push with the backout:
https://hg.mozilla.org/integration/autoland/rev/30c890dba6ea44e4dbea9ef8bf82a67eac67eee2
Push with the failure:
https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=33c7b0ea5caaa654c72cce43124db1ebc052dead
Failure log file:
https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=3050ceae2cbb384fb0535e3c7c2425805a9dc085&selectedJob=196995953
Flags: needinfo?(nika)
Comment 7•7 years ago
|
||
Would be good to coordinate this with the work in bug 1487032.
Comment 8•7 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #7)
> Would be good to coordinate this with the work in bug 1487032.
I think I could use this for bug 1487032, but ContentPrincipal::GetSiteOrigin will be too slow to call on each wrap operation.
How do people feel about caching that string in BasePrincipal? I suppose I could also call GetSiteOrigin when creating the CompartmentPrivate and then cache it there...
Comment 9•7 years ago
|
||
Actually for bug 1487032 I think we have to do a subsumes check to support
Wrap(Compartment-With-ExpandedPrincipal, Compartment-With-ContentPrincipal)
Because here we want to return a transparent wrapper if the expanded principal subsumes the other principal (and an opaque wrapper otherwise)?
bholley suggested returning a new principal representing the site, but I think I can build that on top of GetSiteOrigin added here.
Nika, for your use case we don't have to worry about comparing an expanded principal to a content principal?
Assignee | ||
Comment 10•7 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #8)
> (In reply to Bobby Holley (:bholley) from comment #7)
> > Would be good to coordinate this with the work in bug 1487032.
>
> I think I could use this for bug 1487032, but
> ContentPrincipal::GetSiteOrigin will be too slow to call on each wrap
> operation.
Definitely - We can make it fast if we need though.
> How do people feel about caching that string in BasePrincipal? I suppose I
> could also call GetSiteOrigin when creating the CompartmentPrivate and then
> cache it there...
I'd be fine with caching the value for ContentPrincipal objects, for non-ContentPrincipal objects, we already cache it (as it's just the origin).
I just didn't use it for this case, because I didn't see performance as relevant for the use case I had in mind.
(In reply to Jan de Mooij [:jandem] from comment #9)
> Actually for bug 1487032 I think we have to do a subsumes check to support
>
> Wrap(Compartment-With-ExpandedPrincipal, Compartment-With-ContentPrincipal)
>
> Because here we want to return a transparent wrapper if the expanded
> principal subsumes the other principal (and an opaque wrapper otherwise)?
>
> bholley suggested returning a new principal representing the site, but I
> think I can build that on top of GetSiteOrigin added here.
Yeah, I think that makes sense as an approach to take.
> Nika, for your use case we don't have to worry about comparing an expanded
> principal to a content principal?
I don't think we'd have to worry about that in my case, as expanded principals don't often show up in the environment which I'd be wanting to use these.
I think we could make ExpandedPrincipal call a method which performs the comparison with it's inner principals, which could have the desired effect? Not sure.
Comment 11•7 years ago
|
||
Makes sense. After your patch lands I can just make my changes on top of it I think, it definitely helps :)
Updated•7 years ago
|
Attachment #9003582 -
Attachment description: Bug 1485177 - Add |siteOrigin| information to nsIPrincipal, r=ehsan → Bug 1485177 - Add |siteOrigin| information to nsIPrincipal
Comment 12•7 years ago
|
||
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/434d6bf22d1d
Add |siteOrigin| information to nsIPrincipal r=Ehsan
![]() |
||
Comment 13•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(nika)
You need to log in
before you can comment on or make changes to this bug.
Description
•