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)

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jruderman, Assigned: security-bugs)

References

()

Details

Attachments

(3 files)

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.
Attached file testcase —
QA Contact: czhang → junruh
Something similar happened when I was testcasing bug 59208... see comments in the source of http://bugzilla.mozilla.org/showattachment.cgi?attach_id=18769.
Mass changing QA to ckritzer.
QA Contact: junruh → ckritzer
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
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
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.
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?
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.
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.
r=jband on mitch's fix. But mine fixes the problem actually reported in this bug. Looking for r= and sr=
Whoops, my bad. Posted the wrong fix. r=mstoltz on jband's fix.
sr=hyatt, although I hate the fact that we copy strings just to indicate an access level. :)
Yeah, that doesn't seem so great to me either. My fix is in. mstoltz can close this bug when he lands his patch
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
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.
Checked in my half, marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
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 → ---
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
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.

Attachment

General

Creator:
Created:
Updated:
Size: