Closed
Bug 1227451
Opened 10 years ago
Closed 10 years ago
chrome.alarms API doesn't check 'alarms' permission
Categories
(WebExtensions :: Untriaged, defect)
WebExtensions
Untriaged
Tracking
(firefox46 verified, firefox48 verified)
People
(Reporter: sdna.muneaki.nishimura, Assigned: rpl)
References
Details
(Whiteboard: [alarms])
Attachments
(2 files)
|
913 bytes,
application/zip
|
Details | |
|
2.81 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36
Steps to reproduce:
The 'chrome.alarms' API for WebExtensions ignores 'alarms' permission so any extensions can set alarms without user's consent.
Attached is a sample extension that can reproduce the issue.
Actual results:
When you click the button of this extension and wait for few seconds an alert dialog is opened from the chrome.alarms.onAlarm handler. However, manifest.json of this extension doesn't declare any permissions.
Expected results:
The chrome.alarms property should be invisible if an extension doesn't declare 'alarms' permission in their manifest.json.
MDN says 'alarms' permission is "currently available" but it's not implemented appropriately.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/permissions
Updated•10 years ago
|
Component: General → WebExtensions
Flags: needinfo?(amckay)
Product: Core → Toolkit
Comment 1•10 years ago
|
||
Permissions haven't been implemented yet. Does this need to be a security bug?
Flags: needinfo?(amckay)
Comment 2•10 years ago
|
||
Maybe the MDN documentation could mention that? Is there a bug filed on that work?
Updated•10 years ago
|
Flags: needinfo?(amckay)
Updated•10 years ago
|
Comment 3•10 years ago
|
||
The one I found 1197420 implements the permissions API which is related to the permissions in the manifest. This does raise a more interesting question of should all this structure be in place before more APIs are written. Otherwise we'll be generating security bugs all over the place.
Flags: needinfo?(amckay)
Comment 4•10 years ago
|
||
So it turns out some have been implemented, not others.
Whiteboard: [alarms]
Updated•10 years ago
|
Flags: blocking-webextensions?
This should be a one-line change. I didn't know about the alarms permission.
Updated•10 years ago
|
Assignee: nobody → luca.greco
Flags: blocking-webextensions? → blocking-webextensions+
| Assignee | ||
Comment 6•10 years ago
|
||
This patch turns the "registeredAPI" alarms API into a "registeredPrivilegedAPI" and add a new test case into "test_ext_alarms.html" to check that the alarm API object is not enabled if the permission is not declared by the addon in the manifest.
Attachment #8703725 -
Flags: review?(wmccloskey)
Attachment #8703725 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Keywords: checkin-needed
Keywords: checkin-needed
Comment 8•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/77417c5e122e5850aadfb362aa1ff8e118814199
Bug 1227451: Follow-up: Fix ESLint errors. r=trivial
Comment 9•10 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/695b6cd72017
https://hg.mozilla.org/mozilla-central/rev/77417c5e122e
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
| Assignee | ||
Updated•10 years ago
|
Iteration: --- → 46.2 - Jan 11
Comment 10•10 years ago
|
||
I was able to reproduce the initial issue on Firefox 44.0a1 (2015-10-21) under Windows 10 64-bit.
The alert dialog is no longer displayed on Firefox 46.0b6 (20160328182534) and Firefox 48.0a1 (2016-03-27/28) under Windows 10 64-bit, Mac OS X 10.11.2 and Ubuntu 12.04 32-bit.
Updated•8 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•