Closed
Bug 884109
Opened 11 years ago
Closed 11 years ago
Remove use of GetDocumentFromCaller in image and option code
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: bholley, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
Currently it calls into XPConnect, which uses the most recent XPCCallContext. But for consumers on new bindings, this answer is no longer correct.
In particular, I'm worried about NS_NewHTMLOptionElement and NS_NewHTMLImageElement, both of which are on new bindings (I believe) and use GetDocumentFromCaller to determine NodeInfo. I'm not sure what kind of nastiness can be done with an incorrect NodeInfo, but I'm CCing moz_bug_r_a4 in case it proves fruitful.
I'm rewriting this function in one of my patches in bug 883450.
Assignee | ||
Comment 1•11 years ago
|
||
NS_NewHTMLOptionElement and NS_NewHTMLImageElement got called with null aNodeInfo from CreateHTMLOptionElement and CreateHTMLImgElement. These can only be invoked when constructing them via contractid or classid.
So first of all, in that situation we will in fact be coming from XPConnect and have an XPCCallContext.
Second, this used to be done by the |new Option| and |new Image| stuff, but now those are WebIDL constructors. So I think we should just rip out the contract/classids for option and image, rip out the Create methods in nsLayoutModule.cpp, and rip out the special-casing in the NS_New methods: make them assume aNodeInfo is not null. This is all dead code as far as the web is concerned.
Comment 2•11 years ago
|
||
Fully support removing support for contractid/classid for Img and Option.
Assignee | ||
Comment 3•11 years ago
|
||
OK, let's morph this to cover that removal and this is not a security issue.
Group: core-security
Summary: GetDocumentFromCaller gives the wrong answer for new DOM bindings → Remove use of GetDocumentFromCaller in image and option code
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #764275 -
Flags: review?(bugs)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bzbarsky
Updated•11 years ago
|
Attachment #764275 -
Flags: review?(bugs) → review+
Comment 5•11 years ago
|
||
Could you still check if some addon uses those contractids
Assignee | ||
Comment 6•11 years ago
|
||
I did before writing the patch: no hits in the addons mxr. Can't speak to binary addons...
Assignee | ||
Comment 7•11 years ago
|
||
Flags: in-testsuite-
Target Milestone: --- → mozilla24
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•