Closed
Bug 391043
(CVE-2007-5334)
Opened 18 years ago
Closed 18 years ago
Content can hide the window's titlebar
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Assigned: martijn.martijn)
References
Details
(Keywords: testcase, verified1.8.0.14, verified1.8.1.8, Whiteboard: [sg:low spoof])
Attachments
(4 files, 3 obsolete files)
149 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
2.15 KB,
application/zip
|
Details | |
1.36 KB,
patch
|
bzbarsky
:
superreview+
dbaron
:
approval1.9+
|
Details | Diff | Splinter Review |
3.50 KB,
patch
|
bzbarsky
:
review+
dveditz
:
approval1.8.1.8+
dveditz
:
approval1.8.0.14+
|
Details | Diff | Splinter Review |
Per the description: any arbitrary XUL document can hide the window's titlebar without any security checks.
Needless to say, this is very disorienting for a user, and therefore could trick the user into thinking the page is trusted.
The testcase is very simple; it just sets the hidechrome attribute onload. I assume it wasn't intentional that this is accessible to content...
Updated•18 years ago
|
Flags: blocking1.8.1.7?
Whiteboard: [sg:low spoof]
Updated•18 years ago
|
OS: Windows XP → All
Hardware: PC → All
Comment 1•18 years ago
|
||
And by "All", I'm sure Reed meant this bug applies to both trunk and branch on Windows and Linux but not on Mac.
(Tested 2.0.0.6 on all three platforms.)
Reporter | ||
Comment 2•18 years ago
|
||
Yeah; it doesn't apply to Mac because HideWindowChrome isn't implemented on Mac.
Assignee | ||
Comment 3•18 years ago
|
||
Attachment #276638 -
Flags: review?(sharparrow1)
Reporter | ||
Comment 4•18 years ago
|
||
I don't think we can trust the caller principal here; this isn't getting called by content directly. bz, any comments?
![]() |
||
Comment 5•18 years ago
|
||
In the testcase it's being called directly, actually.
But maybe it would be simpler to only do HideChrome handling if our NodePrincipal() has UniversalXPConnect or something?
Alternately, perhaps only the hidechrome attribute on the root document in the window should apply? That is, XUL documents loaded in the content area, even if they're system, should not affect the window chrome. That would make the most sense to me.
Assignee | ||
Updated•18 years ago
|
Attachment #276638 -
Flags: review?(sharparrow1)
Reporter | ||
Comment 6•18 years ago
|
||
(In reply to comment #5)
> In the testcase it's being called directly, actually.
Well, yes, but there are other ways to hit this code... it's not reliable.
I agree that it makes sense to check whether the document is the root document in the window.
Assignee | ||
Comment 7•18 years ago
|
||
So I think this is what is wanted, right?
As a sidenote, this kind of check is on initial load here:
http://lxr.mozilla.org/seamonkey/source/layout/generic/nsContainerFrame.cpp#436
Attachment #276638 -
Attachment is obsolete: true
Attachment #276977 -
Flags: review?(sharparrow1)
Assignee | ||
Comment 8•18 years ago
|
||
Here are some testcase I made. They need to be run from chrome.
Reporter | ||
Comment 9•18 years ago
|
||
Comment on attachment 276977 [details] [diff] [review]
patch?
This looks correct; I'm not sure if I should be r+ing patches in content, though.
Assignee | ||
Comment 10•18 years ago
|
||
Comment on attachment 276977 [details] [diff] [review]
patch?
Ok, thanks, I'll ask roc then.
Attachment #276977 -
Flags: review?(sharparrow1) → review?(roc)
Comment on attachment 276977 [details] [diff] [review]
patch?
I'm not a content peer, actually, either.
Attachment #276977 -
Flags: review?(roc) → review?(jst)
Comment 12•18 years ago
|
||
Comment on attachment 276977 [details] [diff] [review]
patch?
r=jst
Attachment #276977 -
Flags: review?(jst) → review+
Updated•18 years ago
|
Flags: blocking1.9?
Assignee | ||
Comment 13•18 years ago
|
||
Comment on attachment 276977 [details] [diff] [review]
patch?
I am trying to make some mochitests for this bug, but it's bit hard.
I don't think there is a direct way of knowing whether hidechrome succeeded or not, is there?
Otherwise, I guess I need to check with window.innerWidth/outerWidth comparing.
But I'm seeing some oddness (bug 392509) which might make it kind of difficult/unsatisfactory.
Attachment #276977 -
Flags: superreview?(bzbarsky)
![]() |
||
Comment 14•18 years ago
|
||
Comment on attachment 276977 [details] [diff] [review]
patch?
So out of curiousity.... how does this affect non-XUL-UI Gecko browsers (e.g. Camino)? There every non-frame document has no parent document... I have to admit to not being able to follow the widget code well enough to tell what happens there, and I would think we want to avoid doing the hiding in those cases. That is, it might be better to check for a chrome-type docshell in addition to checking that we're the root document. See nsPresContext::IsChrome().
Assignee | ||
Comment 15•18 years ago
|
||
Ok, like this, right?
Attachment #276977 -
Attachment is obsolete: true
Attachment #277405 -
Flags: superreview?(bzbarsky)
Attachment #276977 -
Flags: superreview?(bzbarsky)
![]() |
||
Updated•18 years ago
|
Attachment #277405 -
Attachment is patch: true
Attachment #277405 -
Attachment mime type: application/octet-stream → text/plain
![]() |
||
Comment 16•18 years ago
|
||
Comment on attachment 277405 [details] [diff] [review]
patchv2
Yeah, that looks great!
Attachment #277405 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Updated•18 years ago
|
Attachment #277405 -
Flags: approval1.9?
Comment on attachment 277405 [details] [diff] [review]
patchv2
a1.9=dbaron
Attachment #277405 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 18•18 years ago
|
||
Checking in nsXULElement.cpp;
/cvsroot/mozilla/content/xul/content/src/nsXULElement.cpp,v <-- nsXULElement.c
pp
new revision: 1.727; previous revision: 1.726
done
Checked in.
Assignee: nobody → martijn.martijn
Flags: blocking1.9?
Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 19•18 years ago
|
||
Attachment #277504 -
Flags: approval1.8.1.7?
Attachment #277504 -
Flags: approval1.8.0.14?
![]() |
||
Comment 20•18 years ago
|
||
I'm pretty sure nsPresContext::IsChrome is trunk-only...
![]() |
||
Comment 21•18 years ago
|
||
As in, you'd just need to copy that code on branch.
Assignee | ||
Comment 22•18 years ago
|
||
Comment on attachment 277504 [details] [diff] [review]
branch patch
Ah, yeah, I still needed to test the patch.
But I was in the middle of building something else.
Attachment #277504 -
Attachment is obsolete: true
Attachment #277504 -
Flags: approval1.8.1.7?
Attachment #277504 -
Flags: approval1.8.0.14?
Assignee | ||
Comment 23•18 years ago
|
||
Ok, this works, I tested it on a 1.8.1 tree.
I'm just asking review, to be completely sure.
Btw, fwiw, the non-dynamic testcase doesn't seem to work at all on branch, for some reason.
Attachment #277531 -
Flags: review?(bzbarsky)
Attachment #277531 -
Flags: approval1.8.1.7?
Attachment #277531 -
Flags: approval1.8.0.14?
![]() |
||
Comment 24•18 years ago
|
||
Comment on attachment 277531 [details] [diff] [review]
branch patch
Sure.
Attachment #277531 -
Flags: review?(bzbarsky) → review+
Updated•18 years ago
|
Flags: blocking1.8.1.7?
Flags: blocking1.8.1.7+
Flags: blocking1.8.0.14?
Comment 25•17 years ago
|
||
Comment on attachment 277531 [details] [diff] [review]
branch patch
approved for 1.8.1.7 and 1.8.0.14, a=dveditz for release-drivers
Attachment #277531 -
Flags: approval1.8.1.7?
Attachment #277531 -
Flags: approval1.8.1.7+
Attachment #277531 -
Flags: approval1.8.0.14?
Attachment #277531 -
Flags: approval1.8.0.14+
Assignee | ||
Comment 26•17 years ago
|
||
Checking in content/xul/content/src/nsXULElement.cpp;
/cvsroot/mozilla/content/xul/content/src/nsXULElement.cpp,v <-- nsXULElement.c
pp
new revision: 1.578.2.1.2.12; previous revision: 1.578.2.1.2.11
done
Checking in layout/base/nsPresContext.h;
/cvsroot/mozilla/layout/base/nsPresContext.h,v <-- nsPresContext.h
new revision: 3.150.4.2.4.1; previous revision: 3.150.4.2
done
Checking in layout/base/nsPresShell.cpp;
/cvsroot/mozilla/layout/base/nsPresShell.cpp,v <-- nsPresShell.cpp
new revision: 3.852.2.11.2.9; previous revision: 3.852.2.11.2.8
done
Fixed on 1.8.0.x branch.
Checking in content/xul/content/src/nsXULElement.cpp;
/cvsroot/mozilla/content/xul/content/src/nsXULElement.cpp,v <-- nsXULElement.c
pp
new revision: 1.578.2.25; previous revision: 1.578.2.24
done
Checking in layout/base/nsPresContext.h;
/cvsroot/mozilla/layout/base/nsPresContext.h,v <-- nsPresContext.h
new revision: 3.150.4.3; previous revision: 3.150.4.2
done
Checking in layout/base/nsPresShell.cpp;
/cvsroot/mozilla/layout/base/nsPresShell.cpp,v <-- nsPresShell.cpp
new revision: 3.852.2.20; previous revision: 3.852.2.19
done
Fixed on 1.8.1 branch.
Flags: blocking1.8.0.14?
Keywords: fixed1.8.0.14,
fixed1.8.1.7
Comment 27•17 years ago
|
||
verified fixed 1.8.1.7 using the testcase and:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.7pre) Gecko/2007090308 BonEcho/2.0.0.7pre
and: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7pre) Gecko/20070903 BonEcho/2.0.0.7pre ID:2007090304
Titlebar is not hidden in this 1.8.1 builds -> adding verified keyword
Updated•17 years ago
|
Alias: CVE-2007-5334
Updated•17 years ago
|
Group: security
Updated•17 years ago
|
Flags: in-litmus?
Comment 28•17 years ago
|
||
This looks like the likely cause of Bug 400744.
Assignee | ||
Comment 29•17 years ago
|
||
(In reply to comment #28)
> This looks like the likely cause of Bug 400744.
That seems unlikely to me. What makes you think that?
Comment 30•17 years ago
|
||
Let me retract the previous comment. I thought that the demo URL for 400744 uses XUL, which led me to believe that 391043 was the cause, but on second thought I need to do more investigation before pointing the finger at 391043.
Verified FIXED on 1.8.0.x, using:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.0.14pre) Gecko/20071210 Firefox/1.5.0.13pre
The testcase https://bugzilla.mozilla.org/attachment.cgi?id=275391 doesn't hide my titlebar at all using this build.
Replacing fixed1.8.0.14 keyword with verified1.8.0.14
Keywords: fixed1.8.0.14 → verified1.8.0.14
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•