Closed
Bug 813758
Opened 12 years ago
Closed 12 years ago
Need additional security checks for the "geolocation" permission
Categories
(Core :: DOM: Geolocation, defect, P1)
Core
DOM: Geolocation
Tracking
()
People
(Reporter: bent.mozilla, Assigned: dougt)
References
Details
Attachments
(1 file, 4 obsolete files)
5.53 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
geolocation:
prompt in parent (nsIContentPermissionPrompt), can be bypassed
thereafter no security checks at all
Need some additional checks to ensure that geolocation data is not delivered to processes without the geolocation permission.
Reporter | ||
Updated•12 years ago
|
Summary: Need additional security checks for the "" permission → Need additional security checks for the "geolocation" permission
Updated•12 years ago
|
Assignee: nobody → doug.turner
blocking-basecamp: ? → +
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #685308 -
Flags: review?(bent.mozilla)
Reporter | ||
Comment 2•12 years ago
|
||
Comment on attachment 685308 [details] [diff] [review]
patch v.1
Review of attachment 685308 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/ipc/ContentParent.cpp
@@ +1822,5 @@
>
> bool
> ContentParent::RecvAddGeolocationListener()
> {
> + AssertAppProcessPermission(this, "geolocation");
This (and the others below) should be:
if (!AssertAppProcessPermission(...)) {
return false;
}
Attachment #685308 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Backed out for Windows mochitest-other crashes due to:
{
3717 INFO TEST-START | chrome://mochitests/content/chrome/dom/ipc/tests/test_process_error.xul
Security problem: Content process does not have `geolocation' permission. It will be killed.
}
(and a few other variations on the theme)
See:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&jobname=mochitest-other&tochange=051d3e0fa048&fromchange=a6b604916694
Backout:
https://hg.mozilla.org/integration/mozilla-inbound/rev/051d3e0fa048
Assignee | ||
Comment 5•12 years ago
|
||
so, we call RecvRemoveGeolocationListener() from ContentParent::ActorDestroy. :(
Assignee | ||
Comment 6•12 years ago
|
||
so, our IPC chrome tests basically do not have any permission bits set on them at all. This is expected.
This patch protects RecvRemoveGeolocationListener from asserting if mGeolocationWatchID was never set.
Attachment #687149 -
Flags: review?(bent.mozilla)
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #685308 -
Attachment is obsolete: true
Attachment #687149 -
Attachment is obsolete: true
Attachment #687149 -
Flags: review?(bent.mozilla)
Attachment #687152 -
Flags: review?(bent.mozilla)
Comment 8•12 years ago
|
||
Setting priority based on triage discussions. Feel free to decrease priority if you disagree.
Priority: -- → P1
Reporter | ||
Updated•12 years ago
|
Attachment #687152 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 9•12 years ago
|
||
Keywords: checkin-needed
Assignee | ||
Comment 10•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/c25efb1b7480
https://hg.mozilla.org/releases/mozilla-beta/rev/019f1b94cdd9
status-firefox18:
--- → fixed
status-firefox19:
--- → fixed
Comment 11•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment 12•12 years ago
|
||
Comment 13•12 years ago
|
||
(Comment 12 was a backout due to bug 817758)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 14•12 years ago
|
||
Backed out on Aurora/Beta.
https://hg.mozilla.org/releases/mozilla-aurora/rev/f34cc14adb9a
https://hg.mozilla.org/releases/mozilla-beta/rev/e26ed80208c8
status-firefox20:
--- → affected
Target Milestone: mozilla20 → ---
Comment 15•12 years ago
|
||
Mass Modify: All un-milestoned, unresolved blocking-basecamp+ bugs are being moved into the C3 milestone. Note that the target milestone does not mean that these bugs can't be resolved prior to 12/10, rather C2 bugs should be prioritized ahead of C3 bugs.
Target Milestone: --- → B2G C3 (12dec-1jan)
Comment 16•12 years ago
|
||
What's the situation here? Stuck on the branches, but not on m-c?
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: + → ?
Assignee | ||
Updated•12 years ago
|
blocking-basecamp: ? → +
Assignee | ||
Comment 17•12 years ago
|
||
Attachment #687152 -
Attachment is obsolete: true
Attachment #694191 -
Flags: review?(jonas)
Comment on attachment 694191 [details] [diff] [review]
patch v.3
Review of attachment 694191 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with that fixed.
::: dom/ipc/ContentParent.cpp
@@ +1873,5 @@
> {
> +#ifdef MOZ_PERMISSIONS
> + // We need to ensure that this permission has been set.
> + // If it hasn't, just noop
> + nsCOMPtr<nsIPermissionManager> pm = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
You need to verify that the received principal isn't a complete lie too. To do this you can use code similar to [1].
So call ManagedPBrowserParent to get a list of PBrowserParent. Then on each of them call GetOwnOrContainingApp on it to get an nsIApplication. Then call GetLocalId on each nsIApplication (localid is just a different name for appid :( ). The appid of the principal needs to match the localId of one of the apps, otherwise the principal is a lie!
[1] http://mxr.mozilla.org/mozilla-central/source/dom/ipc/AppProcessPermissions.cpp#53
Attachment #694191 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 19•12 years ago
|
||
sicking/bent - maybe we should do this as part of the principal serialization?
Yes, I think we should!
Originally I had thought of doing something similar, but more complicated, but I think doing these checks on the principal deserializer would work great!
Assignee | ||
Comment 21•12 years ago
|
||
Attachment #694191 -
Attachment is obsolete: true
Attachment #696121 -
Flags: review?(jonas)
Comment on attachment 696121 [details] [diff] [review]
patch v.4
Review of attachment 696121 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with that fixed.
::: dom/ipc/ContentParent.cpp
@@ +1934,5 @@
> + }
> + }
> +
> + if (!found) {
> + return true;
Call KillHard() here before returning.
Attachment #696121 -
Flags: review?(jonas) → review+
Comment 23•12 years ago
|
||
Try run for 39536974b3dd is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=39536974b3dd
Results (out of 315 total builds):
success: 287
warnings: 25
failure: 3
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dougt@mozilla.com-39536974b3dd
Assignee | ||
Comment 24•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8c3bd23a1567
https://hg.mozilla.org/releases/mozilla-aurora/rev/31d464929f7c
https://hg.mozilla.org/releases/mozilla-b2g18/rev/f73abd268bad
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
status-b2g18:
--- → fixed
Resolution: --- → FIXED
Assignee | ||
Comment 25•12 years ago
|
||
Backed out due to X Orange. Good news -- the patches work. Bad news, some of the X tests need to be updated.
https://hg.mozilla.org/mozilla-central/rev/33064e13c3fd
https://hg.mozilla.org/releases/mozilla-aurora/rev/5652a8a40668
https://hg.mozilla.org/releases/mozilla-b2g18/rev/42aac34da660
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 26•12 years ago
|
||
Try run for 39536974b3dd is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=39536974b3dd
Results (out of 316 total builds):
success: 287
warnings: 26
failure: 3
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dougt@mozilla.com-39536974b3dd
Updated•12 years ago
|
Target Milestone: B2G C3 (12dec-1jan) → B2G C4 (2jan on)
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 27•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/13c24710fbac
https://hg.mozilla.org/releases/mozilla-b2g18/rev/a7088ed31774
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Keywords: checkin-needed
Comment 28•12 years ago
|
||
Try run for cc21ed6ca7e4 is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=cc21ed6ca7e4
Results (out of 308 total builds):
exception: 2
success: 287
warnings: 17
failure: 2
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/dougt@mozilla.com-cc21ed6ca7e4
Updated•12 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•