Closed
Bug 1230341
Opened 9 years ago
Closed 9 years ago
potential UAF in service worker use of NS_NewRunnableMethodWithArg
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
FIXED
mozilla45
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
(Keywords: csectype-uaf, sec-high, Whiteboard: [post-critsmash-triage])
Attachments
(1 file)
(deleted),
patch
|
ehsan.akhgari
:
review+
abillings
:
approval-mozilla-aurora+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
Consider this code from ServiceWorkerManager.cpp:
// Step 8 "Queue a task..." for updatefound.
nsCOMPtr<nsIRunnable> upr =
NS_NewRunnableMethodWithArg<ServiceWorkerRegistrationInfo*>(
swm,
&ServiceWorkerManager::FireUpdateFoundOnServiceWorkerRegistrations,
mRegistration);
NS_DispatchToMainThread(upr);
This dispatches a runnable without holding a strong ref to the mRegistration argument.
Updated•9 years ago
|
Group: core-security → dom-core-security
Assignee | ||
Comment 1•9 years ago
|
||
Marking sec-high, because I don't think this is easily exploitable.
Keywords: sec-high
Assignee | ||
Comment 2•9 years ago
|
||
Fixed another case I found as well.
Attachment #8696031 -
Flags: review?(ehsan)
Assignee | ||
Updated•9 years ago
|
status-firefox43:
--- → wontfix
status-firefox44:
--- → affected
Assignee | ||
Comment 3•9 years ago
|
||
Passes tests locally.
Updated•9 years ago
|
Attachment #8696031 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8696031 [details] [diff] [review]
Hold a strong ref in service worker NS_NewRunnableMethodWithArg uses. r=ehsan
[Security approval request comment]
How easily could an exploit be constructed based on the patch?
I think difficult. Its hard to directly control the life cycle of these objects from script. Even if this was possible, it would then need to force the race to fail.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
Well, its obviously a potential UAF, but again I don't think its obviously exploitable.
Which older supported branches are affected by this flaw?
I believe we should fix this in 44. Its probably been in the service worker code the entire time, but its disabled behind a pref on earlier branches.
If not all supported branches, which bug introduced the flaw?
Probably there from the first service worker manager impl. Again, disabled on earlier branches.
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
This patch should uplift cleanly to aurora 44.
How likely is this patch to cause regressions; how much testing does it need?
No risk. Its simply holding a strong ref where the code expects the object to stay alive. Tested locally using existing mochitests and wpt tests.
Attachment #8696031 -
Flags: sec-approval?
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8696031 [details] [diff] [review]
Hold a strong ref in service worker NS_NewRunnableMethodWithArg uses. r=ehsan
Approval Request Comment
[Feature/regressing bug #]: Service workers
[User impact if declined]: Probably minimal, since this seems hard to exploit. It would be nice to close the UAF race, though, since we are shipping SW on 44.
[Describe test coverage new/current, TreeHerder]: Existing mochitests and wpt tests.
[Risks and why]: Minimal. Service workers only.
[String/UUID change made/needed]: None.
Attachment #8696031 -
Flags: approval-mozilla-aurora?
Updated•9 years ago
|
Comment 6•9 years ago
|
||
Comment on attachment 8696031 [details] [diff] [review]
Hold a strong ref in service worker NS_NewRunnableMethodWithArg uses. r=ehsan
Approvals given.
Attachment #8696031 -
Flags: sec-approval?
Attachment #8696031 -
Flags: sec-approval+
Attachment #8696031 -
Flags: approval-mozilla-aurora?
Attachment #8696031 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 7•9 years ago
|
||
Comment 8•9 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Updated•9 years ago
|
Group: dom-core-security → core-security-release
Updated•9 years ago
|
Whiteboard: [post-critsmash-triage]
Updated•9 years ago
|
Group: core-security-release
Updated•7 years ago
|
Keywords: csectype-uaf
You need to log in
before you can comment on or make changes to this bug.
Description
•