Closed
Bug 338037
Opened 19 years ago
Closed 19 years ago
chrome://global/content/jar: can load remote chrome
Categories
(Toolkit :: Startup and Profile System, defect)
Toolkit
Startup and Profile System
Tracking
()
RESOLVED
FIXED
People
(Reporter: dveditz, Assigned: benjamin)
References
()
Details
(Keywords: fixed1.8.1, verified1.8.0.5, Whiteboard: [sg:moderate])
Attachments
(2 files, 2 obsolete files)
347 bytes,
application/octet-stream
|
Details | |
1.27 KB,
patch
|
darin.moz
:
first-review+
darin.moz
:
approval-branch-1.8.1+
dveditz
:
approval1.8.0.5+
|
Details | Diff | Splinter Review |
Spun off from bug 337744 comment 6, chrome URLs can syntactically wrap arbitrary protocols and confer chrome privs! some don't work, but wrapping them in jar: does.
Luckily we block web content from directly loading chrome URLs as content, but it would be pretty easy to get a fair number of people to copy or drag a "broken" link to the address bar to get at content they really wanted (download the latest movie or music, free pr0n, etc).
> chrome://global/content/http://www.google.com/ does *not* work, because
> of the channel-unwinding checks at
>http://lxr.mozilla.org/mozilla/source/chrome/src/nsChromeProtocolHandler.cpp#563
>
> But if remote content were loaded from a JAR file it would work, e.g.:
> chrome://global/content/jar:http://www.example.com/myjar.zip!/somefile
Reporter | ||
Comment 1•19 years ago
|
||
Updated•19 years ago
|
Flags: blocking1.9a1?
Flags: blocking1.8.1?
Flags: blocking1.8.0.5?
Reporter | ||
Comment 2•19 years ago
|
||
Load the testcase unprivileged as
jar:https://bugzilla.mozilla.org/attachment.cgi?id=222076!/alert.html
Load the testcase with chrome privileges as
chrome://global/content/jar:https://bugzilla.mozilla.org/attachment.cgi?id=222076!/alert.html
Assigning "moderate" severity because of the required user-interaction, but if someone discovered a way to bypass checkLoadURI and find a way for web content to load chrome this would be "critical".
Anyone know a better bugzilla component for the chrome registry code? The description for XP Miscellany says "COMPONENT RETIRED. Please do not file bugs here." But this isn't a XUL bug, nor does this code live in Networking although it is related to URL processing. The "Core" product does not support any other general category.
Flags: blocking1.8.0.4?
Flags: blocking1.7.14?
Flags: blocking-aviary1.0.9?
Summary: chrome:/jar:http: urls can wrap other protocols → chrome://global/content/jar: can load remote chrome
Whiteboard: [sg:moderate]
Assignee | ||
Comment 3•19 years ago
|
||
Mozilla 1.7 may not have this bug or it may be manifested differently (even ff 1.0.x may have different manifestations), because of the different revisions and forks of chrome registry code involved.
Component: XP Miscellany → XRE Startup
Flags: blocking1.8.1?
Flags: blocking1.7.14?
Product: Core → Toolkit
QA Contact: brendan → xre.startup
Assignee | ||
Comment 4•19 years ago
|
||
This should be pretty safe and simple. Darin, if you can review ASAP, we're thinking about respinning 1.8.0.4 for this.
Assignee: nobody → benjamin
Status: NEW → ASSIGNED
Attachment #222099 -
Flags: first-review?(darin)
Attachment #222099 -
Flags: approval1.8.0.4?
Attachment #222099 -
Flags: approval-branch-1.8.1?(darin)
Comment 5•19 years ago
|
||
Yeah, but FF2 definitely has this issue.
I can't seem to reproduce with that testcase in trunk Seamonkey, but I'm not sure whether that's just a matter of needing URI syntax tweaks or a genuine chrome registry difference.
Flags: blocking-thunderbird2?
Flags: blocking-firefox2?
Comment 6•19 years ago
|
||
Wouldn't that prevent the use of ':' in filenames too? Would it make more sense to error out if NS_NewURI on some substring succeeds, since that's the case we really care about as far as I can tell?
Assignee | ||
Comment 7•19 years ago
|
||
I believe colons aren't legal characters in windows filenames anyway, and I'm worried about performance and reentrancy issue having to call NS_NewURI all the time.
Comment 8•19 years ago
|
||
But don't chrome URLs support query and reference fragments? If we are going to restrict ':' then that should only apply to the file path. Isn't it possible that chrome apps are using "chrome://foo/bar.xul?x=y:z" for stuff?
Comment 9•19 years ago
|
||
> Isn't it possible that chrome apps are using "chrome://foo/bar.xul?x=y:z" for stuff?
Example:
chrome://foo/content/bar.xul?url=http://www.foo.com/
Also, what about escaped colons. Do we need to worry about those too?
Assignee | ||
Comment 10•19 years ago
|
||
This uses NS_NewURI to check for absolute URIs. I still prefer the first version, but I understand the concern with query strings.
I'll also look at colon-checkin just the path (not sure which would be more efficient).
Attachment #222149 -
Flags: first-review?(darin)
Assignee | ||
Comment 11•19 years ago
|
||
I think that this is probably the most-correct. BTW, the documentation of .filePath, .directory in nsIURL.idl is incorrect.
Attachment #222099 -
Attachment is obsolete: true
Attachment #222149 -
Attachment is obsolete: true
Attachment #222154 -
Flags: first-review?(darin)
Attachment #222149 -
Flags: first-review?(darin)
Attachment #222099 -
Flags: first-review?(darin)
Attachment #222099 -
Flags: approval1.8.0.4?
Attachment #222099 -
Flags: approval-branch-1.8.1?(darin)
Comment 12•19 years ago
|
||
Comment on attachment 222154 [details] [diff] [review]
Use GetFilePath
I think you should add some comments explaining why these checks
are necessary. In what way is nsIURL's documentation incorrect?
r=darin
Updated•19 years ago
|
Attachment #222154 -
Flags: first-review?(darin) → first-review+
Assignee | ||
Comment 13•19 years ago
|
||
Fixed on trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Flags: blocking1.9a1?
Flags: blocking1.9a1+
Flags: blocking1.8.0.5?
Flags: blocking1.8.0.5+
Flags: blocking-thunderbird2?
Flags: blocking-thunderbird2+
Flags: blocking-firefox2?
Flags: blocking-firefox2+
Assignee | ||
Updated•19 years ago
|
Attachment #222154 -
Flags: approval1.8.0.5?
Attachment #222154 -
Flags: approval1.8.0.4?
Attachment #222154 -
Flags: approval-branch-1.8.1?(darin)
Updated•19 years ago
|
Attachment #222154 -
Flags: approval-branch-1.8.1?(darin) → approval-branch-1.8.1+
Assignee | ||
Comment 15•19 years ago
|
||
This does not appear to be a problem in Firefox 1.0.x or the Mozilla 1.7 series. I caused this in bug 278534, where I changed nsChromeRegistry::ConvertChromeURL from using string manipulation to resolving against the baseuri.
Comment 16•19 years ago
|
||
perhaps we should verify that the URL resulting from URL resolution is still a chrome: URL?
Reporter | ||
Updated•19 years ago
|
Flags: blocking-aviary1.0.9? → blocking-aviary1.0.9-
Assignee | ||
Comment 17•19 years ago
|
||
Except it's not, it's typically a jar:file:/// url.
Reporter | ||
Updated•18 years ago
|
Flags: blocking1.8.0.4?
Reporter | ||
Comment 18•18 years ago
|
||
Comment on attachment 222154 [details] [diff] [review]
Use GetFilePath
unfortunately missed the 1.8.0.4 train by a couple weeks, and we didn't do a respin we could slip this into.
Attachment #222154 -
Flags: approval1.8.0.4?
Comment 19•18 years ago
|
||
Comment on attachment 222154 [details] [diff] [review]
Use GetFilePath
We need to get this into 1.8.0.5
Reporter | ||
Comment 20•18 years ago
|
||
Comment on attachment 222154 [details] [diff] [review]
Use GetFilePath
approved for 1.8.0 branch, a=dveditz for drivers
Attachment #222154 -
Flags: approval1.8.0.5? → approval1.8.0.5+
Comment 22•18 years ago
|
||
v.fixed on 1.8.0 branch with Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US;
rv:1.8.0.5) Gecko/20060626 Firefox/1.5.0.5, permission denied for alert testcase.
Keywords: fixed1.8.0.5 → verified1.8.0.5
Reporter | ||
Updated•17 years ago
|
Group: security
Updated•17 years ago
|
Flags: in-testsuite?
Component: XRE Startup → Startup and Profile System
QA Contact: xre.startup → startup
You need to log in
before you can comment on or make changes to this bug.
Description
•