Error: Permission denied to access property 'utils'

RESOLVED FIXED

Status

--
major
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: KWierso, Assigned: KWierso)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
error: addon-sdk: TEST FAILED: test-sandbox.test non-privileged (exception)
error: addon-sdk: An exception occurred.
Traceback (most recent call last):
  File "", line 1, in 
Error: Permission denied to access property 'utils'



This cropped up sometime over the weekend. Wasn't a change on our side.

https://tbpl.mozilla.org/php/getParsedLog.php?id=16756620&tree=Mozilla-Inbound&full=1
This log includes other test failures that have already been fixed, I just haven't updated mozilla-inbound/central to realize that.
(Assignee)

Comment 1

6 years ago
First shows up in https://tbpl.mozilla.org/php/getParsedLog.php?id=16712097&tree=Mozilla-Inbound&full=1
Which is bug 805807, but I can't access it to add the dependency...
(Assignee)

Comment 2

6 years ago
That traceback's pretty useless, but here's the test that's throwing it: https://github.com/mozilla/addon-sdk/blob/master/test/test-sandbox.js#L21-37
Yes, I changed the Components object to throw (instead of silently failing) when unprivileged callers touch things they're not supposed to. The test needs to be fixed.
(Assignee)

Comment 4

6 years ago
Created attachment 678648 [details] [diff] [review]
Change the conditional to not match Nightly (19)

I have no idea if what this patch does is the correct way to fix the test, but the test passes with this change on release, beta, aurora, and a recent nightly.
Assignee: nobody → kwierso
Status: NEW → ASSIGNED
Attachment #678648 - Flags: review?(rFobic)
Removing test coverage isn't great. A try/catch approach would be better.
(Assignee)

Comment 6

6 years ago
(In reply to Bobby Holley (:bholley) from comment #5)
> Removing test coverage isn't great. A try/catch approach would be better.

Changing that line makes the if() false, so it goes into the else block, which tests that it does throw. If I understand the test correctly, 14 and earlier throw when accessing Components, 15 through 18 silently fail (the * in Components.* are just undefined), and now 19 and newer throw again.
(In reply to Wes Kocher (:KWierso) from comment #6)
> (In reply to Bobby Holley (:bholley) from comment #5)
> > Removing test coverage isn't great. A try/catch approach would be better.
> 
> Changing that line makes the if() false, so it goes into the else block,
> which tests that it does throw. If I understand the test correctly, 14 and
> earlier throw when accessing Components, 15 through 18 silently fail (the *
> in Components.* are just undefined), and now 19 and newer throw again.

Correct.
Attachment #678648 - Flags: review?(rFobic) → review+

Comment 8

6 years ago
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/560bfbdb810aa0e48a92c22423382849fc062db8
Fix bug 808697 - Firefox 19 now throws when unprivileged code tries to use Components' properties. r=gozala

Updated

6 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Comment 9

6 years ago
Commit pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/e6f2cb14c7a051ada2ba272e6a3359fce9a3a7c5
Fix bug 808697 - Firefox 19 now throws when unprivileged code tries to use Components' properties. r=gozala
(cherry picked from commit 560bfbdb810aa0e48a92c22423382849fc062db8)
You need to log in before you can comment on or make changes to this bug.