Closed
Bug 336903
Opened 19 years ago
Closed 18 years ago
New feed view run under chrome context
Categories
(Firefox Graveyard :: RSS Discovery and Preview, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 2 beta1
People
(Reporter: martijn.martijn, Assigned: bugs)
References
()
Details
(Keywords: fixed1.8.1, Whiteboard: [sg:critical][swag:2d] 181b1+ post ff1.5)
Attachments
(13 files, 4 obsolete files)
422 bytes,
application/rdf+xml
|
Details | |
667 bytes,
application/rss+xml
|
Details | |
637 bytes,
application/rss+xml
|
Details | |
7.39 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
61.08 KB,
patch
|
mark
:
review+
|
Details | Diff | Splinter Review |
3.20 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
1.96 KB,
patch
|
dveditz
:
review+
|
Details | Diff | Splinter Review |
3.24 KB,
patch
|
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
63.35 KB,
patch
|
Details | Diff | Splinter Review | |
3.33 KB,
patch
|
Details | Diff | Splinter Review | |
54.17 KB,
patch
|
darin.moz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
1.95 KB,
patch
|
darin.moz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
2.80 KB,
patch
|
darin.moz
:
review+
darin.moz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
New feed view run under chrome context. This is very dangerous, as you can see with the url testcase.
When clicking on the link, it opens a new tab with google.com inside. That should not be possible.
Comment 1•19 years ago
|
||
Updated•19 years ago
|
OS: Windows XP → All
Hardware: PC → All
Version: unspecified → 2.0 Branch
Updated•19 years ago
|
Flags: blocking1.9a1?
Flags: blocking-firefox2?
Updated•19 years ago
|
Assignee: nobody → beng
Flags: blocking1.9a1?
Flags: blocking1.9a1+
Flags: blocking-firefox2?
Flags: blocking-firefox2+
Whiteboard: [sg:critical]
Comment 2•19 years ago
|
||
This should block 2.0a2
Updated•19 years ago
|
Assignee: beng → bugs
Comment 3•19 years ago
|
||
The main problem is that the feed viewer page has chrome privilege rather than using the feed URL as the origin (though that's the page's document.location, so it's partly correct). It is probably easier and safer to make sure the entire page has the correct privilege than to deny javascript: on each link.
Not sure what kind of rich-content support the feed-viewer has, but relying on perfect sanitization to protect against <script></script> in content worries me. Fixing the page's privilege would provide back-stop protection against that kind of failure too.
Comment 4•19 years ago
|
||
So does adding:
chromeChannel.owner = null;
at http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/components/feeds/src/FeedConverter.js&rev=1.5#210 fix this? It ought to...
Ideally, we'd set this to the owner of the original channel; Ben might know how we can get that here.
Updated•19 years ago
|
Target Milestone: --- → Firefox 2 alpha2
Comment 5•19 years ago
|
||
The problem with that is that the page is really subscribe.xhtml and needs chrome privs to do its thing. I don't think a trivially easy fix like that will work, the subscription controls must be segregated from the massaged feed content.
Comment 6•19 years ago
|
||
yup, adding channel.owner=null fubars the page.
It does fix the security hole however ;-)
Comment 7•19 years ago
|
||
OK. So let's try this the other way. Right now what we do is http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/browser/components/feeds/content/subscribe.js&rev=1.6&mark=176-178#170
Perhaps instead of that we should use something more like:
var a = document.createElementNS(HTML_NS, "a");
a.appendChild(document.createTextNode(entry.title));
a.setAttribute("href", "javascript:doLoad(" + entry.link.spec + ");");
and have:
function doLoad(uri) {
checkLoadURIStr(document.documentURI, uri, DISALLOW_SCRIPT_OR_DATA);
// Then do the load by setting document.location or whatever
}
Would that work?
Reporter | ||
Comment 8•19 years ago
|
||
I guess that could work.
But wasn't there concern that unprivileged code could open windows with privileged code (like about:config, etc). That has been fixed, not? But with this feed view thing, it would be possible again, just do window.open on any feed url.
Assignee | ||
Comment 10•19 years ago
|
||
uses the title image link
Assignee | ||
Comment 11•19 years ago
|
||
uses the image src for the title image
Comment 12•19 years ago
|
||
Comment on attachment 221259 [details]
image src test (crashes 1.8 branch builds on load)
This crashes branch builds on load because bug 328697 wasn't landed there yet.
Attachment #221259 -
Attachment description: image src test → image src test (crashes 1.8 branch builds on load)
Assignee | ||
Comment 13•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Attachment #221261 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 221261 [details] [diff] [review]
patch, check every uri attribute set.
ignore the microsummaries aprt, it was so my tree would build
Comment 15•19 years ago
|
||
Comment on attachment 221261 [details] [diff] [review]
patch, check every uri attribute set.
r=bzbarsky, except the makefile change. Do run this whole thing by Jesse, though...
Attachment #221261 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 16•19 years ago
|
||
OK, I have landed this fix on the trunk and the 1.8 branch... I'm going to ask Jesse to take a look at this and see if he can see anything else that might be problematic.
Comment 17•19 years ago
|
||
Martijn is correct in comment 8 -- leaving this page privileged means any same-origin violation XSS bug is trivially elevated to an arbitrary code execution bug. It also means the feed sanitization has to be perfect.
Assignee | ||
Updated•19 years ago
|
Priority: -- → P1
Assignee | ||
Updated•19 years ago
|
Whiteboard: [sg:critical] → [sg:critical][swag:10d]
Assignee | ||
Comment 19•18 years ago
|
||
moves content generation and utilities into a service, and makes this an about safe page without chrome privs. (this was dveditz' suggestion). The MOZ_PHOENIX in netwerk/caps is highly unfortunate. We should make AboutRedirector and the about:safe stuff parameterizable.
Assignee | ||
Updated•18 years ago
|
Whiteboard: [sg:critical][swag:10d] → [sg:critical][swag:5d]
Assignee | ||
Comment 20•18 years ago
|
||
don't add MOZ_PHOENIX to netwerk if we don't have to
Attachment #225326 -
Attachment is obsolete: true
Comment 21•18 years ago
|
||
> We should make AboutRedirector and the about:safe stuff parameterizable.
I've had a patch that does that waiting on dveditz's review for about a month in bug 337746... Not that his helps you on branch, of course.
I'm not sure what the purpose of the docshell GetInterface change is. Why is that needed? Pretty much any use of GetInterface is an undiscoverable hack, imo... Is the problem that nsIDocument is not scriptable?
Assignee | ||
Comment 22•18 years ago
|
||
Yeah, I need to get at the channel so I can do a rudimentary check on the "actual" URI of the page so as to prevent this from being called from pages other than the preview page.
Is there a better way to do this branch and trunk? I think access to the channel could be useful - I can't remember the exact case but I remember wishing for this in the past.
Comment 23•18 years ago
|
||
On trunk, we could use the same setup as we'll probably end up using for nsIURI and nsIPrincipal, I guess, but that doesn't really work for branch.
The problem I have is that it doesn't really make sense to get the channel off the docshell and get the channel of the last-loaded document (as opposed to, say, the currently-loading channel). It's prone to nasty side effects, and impossible to remove once we add it, since we have no way to tell who's depending on it.
Darin, biesi, any idea how we could expose the channel here in a sane way?
I also wonder what you mean by "actual" URI. Does this differ from the nsIWebNavigation's current URI somehow?
Assignee | ||
Comment 24•18 years ago
|
||
Yes, the "actual" URI is a jar: URI of the preview page. At some point, code in docshell and friends begin using the channel's originalURI for updating UI, etc, and originalURI is the web feed URI.
Comment 25•18 years ago
|
||
I see. Perhaps we just need to expose that URI somehow, then.
Comment 26•18 years ago
|
||
> Darin, biesi, any idea how we could expose the channel here in a sane way?
Put it on nsIDocShell (or the Mozilla 1.8 branch version that we can edit). You could have getters for the previous channel as well as the one that is currently loading. It might be useful to have the full channel instead of just a URI.
Assignee | ||
Comment 27•18 years ago
|
||
Boris, what do you think of this? If you like the idea I'll revise my patch.
Comment 28•18 years ago
|
||
I'm happier adding an nsIChannel prop on nsIDocShell, yes. At least that way we can find the consumers if we find a better way to expose it (e.g. on the document, on trunk). Ben, if you would do that, that would be great.
Assignee | ||
Comment 29•18 years ago
|
||
Attachment #225337 -
Attachment is obsolete: true
Attachment #226398 -
Flags: review?(sspitzer)
Assignee | ||
Comment 30•18 years ago
|
||
Adds currentDocumentChannel attribute to nsIDocShell
Once this patch is reviewed I will create a branch patch that adds this to the nsIDocShell_MOZILLA_1_8_BRANCH interface.
Attachment #226399 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 31•18 years ago
|
||
adds about:feeds to SSM to show about safe feed preview page
Attachment #226400 -
Flags: review?(dveditz)
Comment 32•18 years ago
|
||
Comment on attachment 226399 [details] [diff] [review]
docshell portion (trunk only)
>Index: docshell/base/nsDocShell.cpp
>+nsDocShell::GetCurrentDocumentChannel(nsIChannel** aResult)
>+ nsresult rv = EnsureContentViewer();
Why not just return null if there's no viewer? That would make a lot more sense to me.
You seem to never set *aResult when there's no document; that's wrong.
>Index: docshell/base/nsIDocShell.idl
>+ * Gets the channel for the currently loaded document.
Add ", if any" at the end.
r=bzbarsky with those nits picked.
Attachment #226399 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 33•18 years ago
|
||
Attachment #226419 -
Flags: superreview?(darin)
Assignee | ||
Comment 34•18 years ago
|
||
Attachment #226419 -
Attachment is obsolete: true
Attachment #226423 -
Flags: superreview?(darin)
Attachment #226419 -
Flags: superreview?(darin)
Comment 35•18 years ago
|
||
Comment on attachment 226423 [details] [diff] [review]
revised trunk docshell patch
It might be good to add some comments about when currentDocumentChannel changes.
Attachment #226423 -
Flags: superreview?(darin) → superreview+
Comment 36•18 years ago
|
||
Er... that's still calling EnsureContentViewer(). Just take that line out. ;)
Assignee | ||
Comment 37•18 years ago
|
||
OK!
Assignee | ||
Updated•18 years ago
|
Whiteboard: [sg:critical][swag:5d] → [sg:critical][swag:2d] - needs reviews
Comment 38•18 years ago
|
||
Comment on attachment 226400 [details] [diff] [review]
caps portion
r=dveditz
Attachment #226400 -
Flags: review?(dveditz) → review+
Comment 39•18 years ago
|
||
Comment on attachment 226400 [details] [diff] [review]
caps portion
Do you really want "about:feeedsaroo" to execute scripts?
Assignee | ||
Comment 40•18 years ago
|
||
good call, revised patch coming.
Updated•18 years ago
|
Attachment #226398 -
Flags: review?(sspitzer) → review?(mark)
Comment 41•18 years ago
|
||
Comment on attachment 226398 [details] [diff] [review]
patch for browser code
Some of your functions begin with FH_ and others with SH_ - consolidate.
nsAboutFeeds on the trunk needs a new GetURIFlags method which should set its result to 0, following bug 337746.
Attachment #226398 -
Flags: review?(mark) → review+
Assignee | ||
Comment 42•18 years ago
|
||
Will have the final trunk patches in place tomorrow morning. Will land then get branch patches ready.
Assignee | ||
Updated•18 years ago
|
Whiteboard: [sg:critical][swag:2d] - needs reviews → [sg:critical][swag:2d]
Comment 43•18 years ago
|
||
Actually, GetURIFlags should return ALLOW_SCRIPT, I'd guess.
Assignee | ||
Comment 44•18 years ago
|
||
yeah, URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT
rebuilding final trunk patch now...
Assignee | ||
Comment 45•18 years ago
|
||
Assignee | ||
Comment 46•18 years ago
|
||
Assignee | ||
Comment 47•18 years ago
|
||
Landed on the trunk. Will now make a branch patch.
Comment 48•18 years ago
|
||
So does untrusted content really need acess to the about:feeds pages? That is, why was the GetBaseURIScheme change needed in the original patch?
Updated•18 years ago
|
Whiteboard: [sg:critical][swag:2d] → [sg:critical][swag:2d] 181b1+
Assignee | ||
Comment 49•18 years ago
|
||
Assignee | ||
Comment 50•18 years ago
|
||
Assignee | ||
Comment 51•18 years ago
|
||
Same as the other patch, but the attribute is on nsIDocShell_MOZILLA_1_8_BRANCH instead. Requesting quick re-review for this minor change for the branch.
Attachment #227456 -
Flags: review?(darin)
Assignee | ||
Comment 52•18 years ago
|
||
fix merge error
Attachment #227456 -
Attachment is obsolete: true
Attachment #227460 -
Flags: review?
Attachment #227456 -
Flags: review?(darin)
Assignee | ||
Updated•18 years ago
|
Attachment #227460 -
Flags: review? → review?(darin)
Comment 53•18 years ago
|
||
Comment on attachment 227460 [details] [diff] [review]
ook. the right docshell patch
Might be good to bump UUID of nsIDocShell_MOZILLA_1_8_BRANCH since we've shipped the old version of the interface in an alpha. If someone needed to use it, they would get hosed by an alpha.
r=darin
Attachment #227460 -
Flags: review?(darin) → review+
Assignee | ||
Updated•18 years ago
|
Attachment #227460 -
Flags: approval1.8.1?
Assignee | ||
Updated•18 years ago
|
Attachment #227453 -
Flags: approval1.8.1?
Assignee | ||
Updated•18 years ago
|
Attachment #227454 -
Flags: approval1.8.1?
Updated•18 years ago
|
Attachment #227460 -
Flags: approval1.8.1? → approval1.8.1+
Comment 54•18 years ago
|
||
Comment on attachment 227453 [details] [diff] [review]
branch browser patch
micro-nit: destructor in nsAboutFeeds can be private and non-virtual.
Attachment #227453 -
Flags: approval1.8.1? → approval1.8.1+
Updated•18 years ago
|
Attachment #227454 -
Flags: approval1.8.1? → approval1.8.1+
Assignee | ||
Comment 55•18 years ago
|
||
fixed-1.8-branch, fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Keywords: fixed1.8.1
Updated•18 years ago
|
Flags: blocking1.8.0.8-
Whiteboard: [sg:critical][swag:2d] 181b1+ → [sg:critical][swag:2d] 181b1+ post ff1.5
Updated•18 years ago
|
Group: security
Updated•6 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•