Closed
Bug 58538
Opened 26 years ago
Closed 25 years ago
xpconnect "access denied" when i try to access an error messge caught from window.sidebar.addPanel()
Categories
(Core :: Security, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: security-bugs)
References
()
Details
Attachments
(3 files)
|
741 bytes,
text/html
|
Details | |
|
1.46 KB,
patch
|
Details | Diff | Splinter Review | |
|
10.80 KB,
patch
|
Details | Diff | Splinter Review |
sidebar.addPanel(), sidebar.setWindow(), and sidebar.addSearchEngine() give
this error message:
line 0: uncaught exception: [Exception... "Not enough arguments [nsISidebar.add
Panel]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS fr
ame :: file:///C:/WINDOWS/Desktop/fa.html :: zero :: line 8" data: no]
But if I try...catch this error, and then convert the error to a string, I get:
line 0: uncaught exception: Access to XPConnect service denied.
| Reporter | ||
Comment 1•26 years ago
|
||
Updated•26 years ago
|
QA Contact: czhang → junruh
| Reporter | ||
Comment 2•26 years ago
|
||
Something similar happened when I was testcasing bug 59208... see comments in
the source of http://bugzilla.mozilla.org/showattachment.cgi?attach_id=18769.
| Assignee | ||
Comment 4•25 years ago
|
||
| Assignee | ||
Comment 5•25 years ago
|
||
Happened upon this fix. Yet another consequence of defaulting all properties to
sameOrigin - cross-origin access to exceptions was being denied. There is
probably no reason to deny access to exceptions...can anyone think of a reason
why this might be insecure? If not, I'll relax the rules with the above patch.
Status: NEW → ASSIGNED
Comment 6•25 years ago
|
||
Looks good to me -- who should r=? Maybe jband.
Nit: why lose the newline before the comment here:
pref("capability.policy.default.windowinternal.location.write", "allAccess");
-
// window.openDialog is insecure and must be made inaccessible from web scripts
- see bug 56009
pref("capability.policy.default.windowinternal.opendialog", "noAccess");
Seems better for readability to have an empty line before that comment.
/be
Comment 7•25 years ago
|
||
The patch did not fix the problem for me (my tree is a few days old). Did it
work for you? I'm not clear on why it would. This is not a domexpception. It is
an nsIXPCException. I would expect you'd need to change code in
nsScriptSecurityManager where it implements nsIXPCSecurityManager methods. OR,
we could have the nsXPCException implement nsISecurityCheckedComponent to
declare its safe scriptablity.
| Assignee | ||
Comment 8•25 years ago
|
||
John,
You're right. I fixed a related problem (DOM exceptions) but not the one in
this bug. Regardless, access to DOM exceptions is a good thing and I'd like to
check it in. As for XPCExceptions, did this ever work? Is this a regression, or
could scripts ever inspect the contents of an XPCException?
Comment 9•25 years ago
|
||
At one point I thought Norris had code in nsScriptSecurityManager to support
looking at nsIXPCExceptions. Nevertheless, Yes, I do think this is important. At
minimum toString should be allowed. I'd vote for exposing the first 3 attributes
only. Exposing 'location' allows for peeking up the stack (exposing text only,
not frame objects - but still iffy). The 'data' member is of unknown danger or
utility and thus ought to not be exposed.
Do you think nsISecurityCheckedComponent is appropriate? I could easily do that.
| Assignee | ||
Comment 10•25 years ago
|
||
I'm trying to discourage the use of nsISecurityCheckedComponent, as I think we
agree it's not the best solution. It decentralizes policy decisions, which is
probably OK for Vidur's XML extensions but not for the XPConnected DOM when that
comes around. If you want to use it as a temporary fix, that's fine, but I want
to replace all uses of that interface with a more DOM-like policy when it's ready.
Comment 11•25 years ago
|
||
Comment 12•25 years ago
|
||
r=jband on mitch's fix. But mine fixes the problem actually reported in this bug.
Looking for r= and sr=
| Assignee | ||
Comment 13•25 years ago
|
||
Whoops, my bad. Posted the wrong fix. r=mstoltz on jband's fix.
Comment 14•25 years ago
|
||
sr=hyatt, although I hate the fact that we copy strings just to indicate an
access level. :)
Comment 15•25 years ago
|
||
Yeah, that doesn't seem so great to me either.
My fix is in. mstoltz can close this bug when he lands his patch
Comment 16•25 years ago
|
||
Use an enum instead of a set of well-known (but copied through out params, per
rules of XPCOM) strings?
sr=brendan@mozilla.org on mitch's pref-patch.
/be
| Assignee | ||
Comment 17•25 years ago
|
||
Like I said, nsISecurityCheckedComponent was not well thought out, including the
part about copying strings. It will be replaced by a better security model. Soon.
| Assignee | ||
Comment 18•25 years ago
|
||
Checked in my half, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 19•25 years ago
|
||
Reopening (sorry Mitch) for LinuxRH62:
When verifying the testcase attachment on the LinuxRH62 2001-01-09-08-T
Commercial build, the second and third buttons gives the following javascript
alert(s):
Second Button, in JavaScript Console:
Error uncaught exception: Access to XPConnect service denied.
Third Button, in JavaScript alert dialog:
[$] Access to XPConnect service denied.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 20•25 years ago
|
||
Worksforme on Windows and Linux dailies, marking fixed. Chris dude, could you
please re-verify this?
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Comment 21•25 years ago
|
||
I'm not seeing this anymore.
Marking VERIFIED FIXED on:
-MacOS91 2001-05-23-08-trunk
-Win98SE 2001-05-23-09-trunk
-LinRH62 2001-05-23-08-trunk
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•