Closed
Bug 813994
Opened 12 years ago
Closed 12 years ago
Alarm API - Need additional security checks for the "alarms" permission
Categories
(Core :: DOM: Device Interfaces, defect)
Core
DOM: Device Interfaces
Tracking
()
People
(Reporter: bent.mozilla, Assigned: airpingu)
References
Details
Attachments
(1 file, 1 obsolete file)
2.75 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
Currently it looks like we only check the "alarms" permission in the child process for DOM access. A hacked child can send commands to the parent to cancel or add alarms.
Also, it looks like one process can modify or cancel another's alarms since appId is not stored along with alarmId. I'm happy to file another bug on that if needed.
Updated•12 years ago
|
Assignee: nobody → clian
blocking-basecamp: ? → +
Assignee | ||
Comment 1•12 years ago
|
||
(In reply to ben turner [:bent] from comment #0)
> Currently it looks like we only check the "alarms" permission in the child
> process for DOM access. A hacked child can send commands to the parent to
> cancel or add alarms.
Thanks Ben for pointing this out! I'll try to refine that.
>
> Also, it looks like one process can modify or cancel another's alarms since
> appId is not stored along with alarmId. I'm happy to file another bug on
> that if needed.
Actually, I've already examined it in the parent process to ensure .getAll() and .remove() can only interact with alarms scheduled by the same app (Bug 777224).
Reporter | ||
Comment 2•12 years ago
|
||
(In reply to Gene Lian [:gene] from comment #1)
> Actually, I've already examined it in the parent process to ensure .getAll()
> and .remove() can only interact with alarms scheduled by the same app (Bug
> 777224).
Awesome! Sorry about that, I went on vacation and didn't look to see if anything had changed after I got back :-/
Assignee | ||
Updated•12 years ago
|
Blocks: alarm-api
Summary: Need additional security checks for the "alarms" permission → Alarm API - Need additional security checks for the "alarms" permission
Assignee | ||
Comment 3•12 years ago
|
||
Hi Bent,
Changes are trivial: just adding an |assertPermission()| check in the parent. The remaining changes are minor codes clean-ups for the ugly codes designed when I was still newbie, including:
1. // [Upper-case-letter]...[.]
2. Rephrase some comments.
3. Remove trailing spaces.
4. Wrap long line into 80-char ruler.\
5. Adding braces for one line if-block.
6. Alignment.
Thanks for your review! Please let me know if you have any other suggestions.
Attachment #685569 -
Flags: review?(bent.mozilla)
Reporter | ||
Comment 4•12 years ago
|
||
Comment on attachment 685569 [details] [diff] [review]
Patch
Thanks, this is probably right, but it's generally not a good idea to mix lots of code cleanup into bug fixes (it makes chasing blame much harder and can sometimes introduce additional bugs). Can you please separate the changes and file a followup for the cleanup?
Attachment #685569 -
Flags: review?(bent.mozilla) → review-
Assignee | ||
Comment 5•12 years ago
|
||
Hi Bent,
You're right I shouldn't be too aggressive. Let's simply deal with this issue in this patch. :)
Btw, I clean up |secMan| and |this.hasPrivileges| since they're no longer used in the current codes, which are also permission-related. Please feel free to let me know if you don't like them present in this patch.
Thanks for the review!
Attachment #685569 -
Attachment is obsolete: true
Attachment #686046 -
Flags: review?(bent.mozilla)
Reporter | ||
Comment 6•12 years ago
|
||
Comment on attachment 686046 [details] [diff] [review]
Patch V2
Review of attachment 686046 [details] [diff] [review]:
-----------------------------------------------------------------
Looks great! Thanks!
Attachment #686046 -
Flags: review?(bent.mozilla) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 7•12 years ago
|
||
Keywords: checkin-needed
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment 9•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•