Closed
Bug 307040
Opened 20 years ago
Closed 20 years ago
window._content should be XPCNativeWrapper.
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: moz_bug_r_a4, Assigned: jst)
References
()
Details
(Keywords: fixed1.8, Whiteboard: [sg:fix])
Attachments
(1 file)
|
2.86 KB,
patch
|
mrbkap
:
review+
brendan
:
superreview+
asa
:
approval1.8b5+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.11) Gecko/20050728
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050904 Firefox/1.6a1
Accessing content by using window.content is secure. But, accessing content by
using window._content is not secure.
window.content is [object XPCNativeWrapper [object Window]].
window._content is [object Window].
Even though Deer Park no longer use window._content, the extensions have been
using window._content. Thus, this bug causes potential vulnerability in the
extensions.
Reproducible: Always
Steps to Reproduce:
1. Close JavaScript Console, if exists, to make sure opener is a browser
window.
2. Open JavaScript Console from menu bar; [Tools] > [JavaScript Console].
3. Evaluate the following code:
d = top.opener.document; b = d.createElement("button");
b.setAttribute("oncommand", "alert('content: ' + window.content +
'\\n_content: ' + window._content)"); b.setAttribute("label", "Click me");
d.getElementById("statusbar-display").appendChild(b); top.opener.focus();
4. Click on the button added in the statusbar of the browser window that
opened JavaScript Console. Then a popup that shows window.content and
window._content will appear.
Actual Results:
content: [object XPCNativeWrapper [object Window]]
_content: [object Window]
Expected Results:
content: [object XPCNativeWrapper [object Window]]
_content: [object XPCNativeWrapper [object Window]]
Comment 1•20 years ago
|
||
Can we remove window._content?
Assignee: nobody → general
Component: Security → DOM
Product: Firefox → Core
QA Contact: firefox → ian
Version: unspecified → Trunk
Updated•20 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking1.9a1+
Flags: blocking1.8b5+
OS: Windows XP → All
Hardware: PC → All
Updated•20 years ago
|
Assignee: general → jst
Updated•20 years ago
|
Whiteboard: [sg:fix]
| Assignee | ||
Comment 2•20 years ago
|
||
This makes the getter we have for window._content (which maps to
window.content) be a native function rather than a compiled JS function. This
way the getter doesn't carry any principals that make us think we're not called
from chrome when chrome accesses window._content.
Attachment #195981 -
Flags: superreview?(brendan)
Attachment #195981 -
Flags: review?(mrbkap)
Comment 3•20 years ago
|
||
Comment on attachment 195981 [details] [diff] [review]
Make the window._content getter native.
r=mrbkap
Attachment #195981 -
Flags: review?(mrbkap) → review+
Comment 4•20 years ago
|
||
Comment on attachment 195981 [details] [diff] [review]
Make the window._content getter native.
Only thought is JSPROP_READONLY, but that would make assignments have no
effect, rather than throw an exception. If we like throwing better, the patch
as-is is great.
/be
Attachment #195981 -
Flags: superreview?(brendan) → superreview+
| Assignee | ||
Comment 5•20 years ago
|
||
I don't know if we like one better over the other, but I don't want to change
the current behavour at this point. Ideally this property could be removed
someday, even, but not now (though we could consider that for 1.9, thoughts?).
Fixed on the trunk.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•20 years ago
|
Attachment #195981 -
Flags: approval1.8b5?
Updated•20 years ago
|
Attachment #195981 -
Flags: approval1.8b5? → approval1.8b5+
Updated•19 years ago
|
Flags: testcase+
Updated•19 years ago
|
Group: security
Updated•18 years ago
|
Flags: in-testsuite+ → in-testsuite?
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
•