Closed Bug 209701 Opened 21 years ago Closed 6 years ago

Permission denied to create wrapper for object when wrapping a "function" interface, such as TreeWalker.filter

Categories

(Core :: XPConnect, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: WeirdAl, Unassigned)

References

()

Details

(Keywords: dom2, testcase)

Attachments

(2 files, 1 obsolete file)

From JavaScript, it should be possible to reach the filter property of a
TreeWalker, per the DOM Level 2 Traversal/Range Recommendation from W3C. 
Currently, it is not, instead returning the above exception.

Testcase coming up.
Attached file Testcase (obsolete) —
Attached file Testcase (revised)
Oops.  A couple small glitches with the testcase.
Attachment #125857 - Attachment is obsolete: true
So, caps is complaining here because it is not getting a classinfo from
xpconnect.  The top of the stack looks like:

#0  nsScriptSecurityManager::CanCreateWrapper(JSContext*, nsID const&,
nsISupports*, nsIClassInfo*, void**) (this=0x8110a00, cx=0x847eac0,
aIID=@0x813c058, aObj=0x86fcbf0, 
    aClassInfo=0x0, aPolicy=0x0) at
/usr/local/src/mozilla/trunk/mozilla/caps/src/nsScriptSecurityManager.cpp:2396
#1  0x408a02e3 in XPCWrappedNative::InitTearOff(XPCCallContext&,
XPCWrappedNativeTearOff*, XPCNativeInterface*, int) (this=0x8799780,
ccx=@0xbfffd260, aTearOff=0x87997a0, 
    aInterface=0x87617c0, needJSObject=0) at
/usr/local/src/mozilla/trunk/mozilla/js/src/xpconnect/src/xpcwrappednative.cpp:1425


NodeFilter does not exist in nsDOMClassInfo at all, so I tried adding it there,
with default flags and the default SH, and came up empty.  I'm not quite sure
why that did not work...
An even more reduced testcase is in the URL
Summary: TreeWalker.filter: Permission denied to create wrapper for object → Permission denied to create wrapper for object when wrapping a "function" interface, such as TreeWalker.filter
One potential solution, still evaluating the security implications
*** Bug 300668 has been marked as a duplicate of this bug. ***
*** Bug 302705 has been marked as a duplicate of this bug. ***
*** Bug 310994 has been marked as a duplicate of this bug. ***
*** Bug 228767 has been marked as a duplicate of this bug. ***
*** Bug 307088 has been marked as a duplicate of this bug. ***
The patch included here is over two years old, but surprisingly enough, has not
bitrotted!

What can we do to fix this?

I'm adding the blocking of bug 312630 and the assertion keyword, because this
bug blocks the assertions I add in that bug.
Blocks: 312630
Keywords: assertion
I'm going to replace the assertion I would've added for bug 312630 with a
warning.  There's just too many instances to justify crashing the program.
Keywords: assertion
Well, the patch needs review, to see if it is any good, I guess.
It could have negative security implications, though, which is mentioned in
comment 5.
Comment on attachment 127228 [details] [diff] [review]
Adds nsISecurityCheckedComponent to nsXPCWrappedjS

Requesting review to get the patch back on radar.
Attachment #127228 - Flags: review?(dveditz)
Comment on attachment 127228 [details] [diff] [review]
Adds nsISecurityCheckedComponent to nsXPCWrappedjS

src/xpcprivate.h
class nsXPCWrappedJS
won't compile ifndef XPC_USE_SECURITY_CHECKED_COMPONENT
Attachment #127228 - Flags: review?(dveditz) → review-
Hello, Can someone more knowledgeable than me verify/determine if bug 326248 is a duplicate of this bug here. Thanks.
No longer blocks: XPathGenerator
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: