Closed Bug 1197901 (CVE-2016-2813) Opened 9 years ago Closed 9 years ago

Risks in the current implementation of Firefox on Android in accessing to the mobile orientation and motion sensors via JavaScript codes

Categories

(Core :: DOM: Device Interfaces, defect)

Unspecified
Android
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox41 --- wontfix
firefox42 + wontfix
firefox43 + wontfix
firefox44 - wontfix
firefox45 - wontfix
firefox46 - fixed
firefox47 --- fixed
firefox-esr38 --- wontfix
firefox-esr45 --- wontfix

People

(Reporter: maryam.mehrnejad, Assigned: smaug)

References

Details

(Keywords: sec-high, Whiteboard: [post-critsmash-triage][adv-main46+])

Attachments

(5 files, 3 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0 Build ID: 20150630154324 Steps to reproduce: Dear Sir/ Madam, I am writing to you on behalf of a team of researchers in mobile security from Newcastle University, UK. Based on our recent work, we have identified vulnerabilities in the current implementation of Firefox for Android in regards to accessing to the mobile orientation and motion sensors via JavaScript codes. The results of our work show that it is possible to infer user’s touch actions such as click, scroll, and zoom, as well as his PINs based on the sensor streams accessible through different mobile browsers including yours. This feature seems to be implemented in Firefox according to the W3C device orientation event specification (http://www.w3.org/TR/orientation-event/) which needs to be revised too. A preliminary version of our work is already published here (http://dl.acm.org/citation.cfm?id=2714650). The detailed version of the paper including attacks on user’s PINs will be published soon. We would be very happy to provide you with more information in regards to this problem. Regards, Maryam Mehrnezhad Actual results: User privacy and security leak
Severity: normal → major
Component: Untriaged → Web Apps
OS: Unspecified → Android
Product: Firefox → Firefox for Android
Version: unspecified → Firefox 40
We don't have access to your paper, please attach a copy to this bug or mail us at security@mozilla.org
Group: firefox-core-security → core-security
Status: UNCONFIRMED → NEW
Component: Web Apps → DOM: Device Interfaces
Ever confirmed: true
Flags: needinfo?(maryam.mehrnejad)
Product: Firefox for Android → Core
Version: Firefox 40 → unspecified
Attached file TouchSignatures.pdf
Short version of the paper
Flags: needinfo?(maryam.mehrnejad)
(In reply to Daniel Veditz [:dveditz] from comment #1) > We don't have access to your paper, please attach a copy to this bug or mail > us at security@mozilla.org Short version of the paper is attached to the bug now. You can find the detailed version of the paper from: http://homepages.cs.ncl.ac.uk/m.mehrnezhad/
Olli, do you know who might be able to look into this issue?
Flags: needinfo?(bugs)
Hmm, didn't dougt work on orientation and motion sensors? Maryam, do you by any chance have some code showing the issue? Also, do you perhaps have links to bugs you have filed (I assume) on other browsers? I wonder if we should either make deviceorientation/devicemotion use some permission model (so that when an event listener is added, permission is asked), or limit those events to top level page, and nested browsing context from the same domain. I think I'd prefer the latter one. Anne, any comments?
Flags: needinfo?(maryam.mehrnejad)
Flags: needinfo?(bugs)
Flags: needinfo?(annevk)
There's some code at the very end of the paper here: http://homepages.cs.ncl.ac.uk/m.mehrnezhad/TouchSignatures.pdf
Your suggestion seems reasonable. I don't really know about the specific attacks, but I have heard about using orientation events to steal passwords a long time ago. What's new?
Flags: needinfo?(annevk)
It is completely new attack via only JavaScript codes. Before, it is been done by installing native apps on mobile devices.
I'd say this is a dup of bug 686401, so nothing new.
Making the attack practical in javascript may be new (and very cool research), but as seen in bug 686401 the Firefox defenses we'd need to protect against the attack were predicted based on nascent research.
Depends on: 686401
It is the same bug as 686401, however, our research proves it is indeed practical to perform such an attack.
Indeed, and it should be fixed consistently across all the browsers and also the spec needs to be fixed. Do you have links to bugs on other browser implementations? That might help with coordinating this work.
Flags: needinfo?(toreini)
Group: core-security → dom-core-security
We have reported the issue to all major browsers and also w3c. Some of them are discussing the bug inside private groups. None of them are public yet.
Flags: needinfo?(maryam.mehrnejad)
Maryam, could you still give the links to other browsers bugs. I know those are probably hidden by default, but I could then ask the developers of other browsers to give access to those bugs.
Flags: needinfo?(maryam.mehrnejad)
It's issue 523320 in Chromium. For the rest browsers we are in contact with them via email.
Flags: needinfo?(maryam.mehrnejad)
there is some relevant chromium discussion here: crbug.com/421691
Marking sec-high for now until further investigation can be made.
Keywords: sec-high
MS and Blink folks seem to be ok with the approach from bug 686401.
Assignee: nobody → bugs
Attached patch possible patch (obsolete) — Splinter Review
This would limit events to foreground tabs in focused windows.
Attached patch v3Splinter Review
Attachment #8669174 - Attachment is obsolete: true
Depends on: 1211258
I've been trying to follow the conversation, however I am not authorized to access bug 1211258. Is there any way for me to see this bug?
Comment on attachment 8669419 [details] [diff] [review] v3 For FFOS we need bug 1211258. DeviceSensorTestEvent is a bit silly, but we don't really have other ways to test this stuff.
Attachment #8669419 - Flags: review?(bzbarsky)
Comment on attachment 8669419 [details] [diff] [review] v3 >+ principal->Subsumes(topPrincipal, &subsumes); Could we just add a one-arg form of Subsumes() on nsIPrincipal (presumably inline)? It worries me that you're not considering rv.... you probably should. r=me modulo that.
Attachment #8669419 - Flags: review?(bzbarsky) → review+
well, if subsumes (which is initialized to false) is set to true yet the method returns failure, I'd say that is rather horrible bug in ::Subsumes implementation. But now I see we have the easier to use Subsumes() for C++.
Comment on attachment 8670428 [details] [diff] [review] simpler subsumes [Security approval request comment] How easily could an exploit be constructed based on the patch? It is obvious what the issue is about, but actually constructing an exploit... http://homepages.cs.ncl.ac.uk/m.mehrnezhad/TouchSignatures.pdf is public and bug 686401 has been open for years. Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? Commit message could be -u "Olli Pettay <Olli.Pettay@helsinki.fi>" -m "Bug 1197901, ensure sensor events dispatching follows the becoming spec change, r=bz" Which older supported branches are affected by this flaw? All If not all supported branches, which bug introduced the flaw? (This is old stuff, known at least since bug 686401) Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be? The patch seems to apply to older branches, expect the testing part of the patch How likely is this patch to cause regressions; how much testing does it need? this changes functionality a bit, so, not super safe.
Attachment #8670428 - Flags: sec-approval?
Comment on attachment 8670428 [details] [diff] [review] simpler subsumes Sec-approval+ for checkin to trunk. We should take this on Beta and Aurora too. Marking as won't fix for ESR38 since this is Fennec specific and we don't have an ESR for Fennec.
Attachment #8670428 - Flags: sec-approval? → sec-approval+
Looks like we have still some issue in FFOS (I thought bug 1211258 would have been enough). Investigating.
Olli, are you planning to request the uplift to 42 & 43? Thanks
Flags: needinfo?(bugs)
No. Need to sort out the FFOS issues first. I should have asked sec approval a bit later.
Flags: needinfo?(bugs)
OK. I am going to mark it wontfix for 42. Please let me know if the situation changes.
Any luck here Olli? We can still take a patch in beta. If you think it will still be wontfixed for 43, please let me know.
Flags: needinfo?(bugs)
Attached patch up-to-date (for trunk) (obsolete) — Splinter Review
Still debugging b2g issues.
Flags: needinfo?(bugs)
Attachment #8691062 - Attachment is obsolete: true
Attached patch up-to-date (for trunk) (obsolete) — Splinter Review
Smaug: Just poking this bug as it's a sec-high and tracked for FF44, do we know the issue better and potentially a fix ready for uplift to Beta44? Please let me know.
Flags: needinfo?(bugs)
Too late for 43, wontfixing. Marking affected and adding tracking for 45/46 since it looks like they're also affected
Untracking as we shipped several releases with it. Please resubmit when we have a fix ready to land.
smaug - Would you like to take another look at checking this fix in without considering the b2g issues? Seems like priorities may have shifted here so it would be worth finally fixing this sec-high bug.
Flags: needinfo?(bugs)
Attachment #8694857 - Attachment is obsolete: true
Comment on attachment 8720426 [details] [diff] [review] up-to-date (for trunk) Trying again now [Security approval request comment] See comment 26
Attachment #8720426 - Flags: sec-approval?
Hi all, A quick update on W3C new draft, Thought it might be interesting for you: https://github.com/w3c/deviceorientation/pull/25/files#diff-87104462239df473f9aa72c3bb6ad124R641
Attachment #8720426 - Flags: sec-approval? → sec-approval+
Comment on attachment 8720427 [details] [diff] [review] up-to-date (aurora & beta) Approval Request Comment [Feature/regressing bug #]: We've had the old behavior for ages. [User impact if declined]: See the comment 0 [Describe test coverage new/current, TreeHerder]: Added a test [Risks and why]: non-same-origin iframes in pages can't use the feature anymore, but it is a spec change (which doesn't mean the change is web compatible, unfortunately). [String/UUID change made/needed]: NA
Attachment #8720427 - Flags: approval-mozilla-beta?
Attachment #8720427 - Flags: approval-mozilla-aurora?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Comment on attachment 8720427 [details] [diff] [review] up-to-date (aurora & beta) This is too late in the 45 cycle. This is the last week of the beta cycle. Taking it in aurora.
Attachment #8720427 - Flags: approval-mozilla-beta?
Attachment #8720427 - Flags: approval-mozilla-beta-
Attachment #8720427 - Flags: approval-mozilla-aurora?
Attachment #8720427 - Flags: approval-mozilla-aurora+
Group: dom-core-security → core-security-release
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main46+]
Alias: CVE-2016-2813
Thanks everyone for taking action on our reported bug as announced here: https://www.mozilla.org/en-US/security/advisories/mfsa2016-43/ For a detailed version of our work, the journal version of the paper is freely accessible from: http://arxiv.org/abs/1602.04115 -Maryam
Group: core-security-release
Flags: needinfo?(toreini)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: