Closed
Bug 315166
Opened 19 years ago
Closed 19 years ago
<label class="text-link"> should be more careful with javascript:, data:, and chrome: URLs
Categories
(Toolkit Graveyard :: Security, enhancement)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8.1
People
(Reporter: jruderman, Assigned: Gavin)
References
()
Details
(Keywords: fixed1.8.1, Whiteboard: [sg:want P3])
Attachments
(2 files, 9 obsolete files)
766 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
4.56 KB,
patch
|
mconnor
:
approval-branch-1.8.1+
|
Details | Diff | Splinter Review |
<label class="text-link"> should not allow links to chrome: URLs, and it should either disallow or be careful with javascript: and data: URLs. If necessary, there can be "allowchrome" and "allowscript" attributes on links where the chrome code gets the URL from a trusted source.
See bug 315004 for an example of a security hole this would avoid.
See also bug 293363 for an even more general solution to this kind of problem.
Assignee | ||
Comment 1•19 years ago
|
||
I decided to use a whitelist instead of a blacklist, since there are possibilities of abuse by using combinations of jar: and view-source: etc that I didn't want to get into. I don't know whether this is the right way to go, and I need to test it more, but comments are welcome.
Assignee: dveditz → gavin.sharp
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•19 years ago
|
||
Comment on attachment 202849 [details] [diff] [review]
tentative patch
Asaf pointed out that since this is only a safe-guard, trying to actively prevent people from shooting themselves in the foot is kinda silly.
Attachment #202849 -
Attachment is obsolete: true
Assignee | ||
Comment 3•19 years ago
|
||
This is probably better. I figured there should be some kind of indication for why the click failed, suggestions for improvements on that wording are welcome. This lets remote xul actually work, too.
Assignee | ||
Comment 4•19 years ago
|
||
Attachment #203679 -
Attachment is obsolete: true
Assignee | ||
Comment 5•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
OS: MacOS X → All
Hardware: Macintosh → All
Assignee | ||
Comment 6•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Attachment #203681 -
Attachment is obsolete: true
Assignee | ||
Comment 7•19 years ago
|
||
After discussion with Jesse and Asaf, I think we all agreed that being able to open chrome, script, or data links using the text-link binding didn't really have a compelling use-case, and was possible by other means (onclick) for code that really did want to do it. This patch therefore disallows it entirely. This also uses checkLoadURI against "about:blank" instead of scheme comparisons, so it is more robust (handles nested protocols, for example).
Attachment #203748 -
Attachment is obsolete: true
Assignee | ||
Comment 8•19 years ago
|
||
Assignee | ||
Comment 9•19 years ago
|
||
Attachment #203682 -
Attachment is obsolete: true
Assignee | ||
Comment 10•19 years ago
|
||
Attachment #203754 -
Attachment is obsolete: true
Attachment #203755 -
Attachment is obsolete: true
Attachment #207358 -
Flags: second-review?(bugs.mano)
Attachment #207358 -
Flags: first-review?(mconnor)
Assignee | ||
Comment 11•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch-r?]
Reporter | ||
Updated•19 years ago
|
Whiteboard: [patch-r?] → [sg:want P3] [patch-r?]
Comment 12•19 years ago
|
||
Comment on attachment 207358 [details] [diff] [review]
better patch v2
r=me with a comment explaining when and why its safe to use win.open(href)
Attachment #207358 -
Flags: second-review?(bugs.mano)
Attachment #207358 -
Flags: first-review?(mconnor)
Attachment #207358 -
Flags: first-review+
Assignee | ||
Comment 13•19 years ago
|
||
Assignee | ||
Updated•19 years ago
|
Attachment #207358 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Attachment #207359 -
Attachment is obsolete: true
Assignee | ||
Comment 14•19 years ago
|
||
(In reply to comment #12)
> (From update of attachment 207358 [details] [diff] [review] [edit])
> r=me with a comment explaining when and why its safe to use win.open(href)
If newURI(href) fails (which is the only case where we'd reach the else block, other than for non-chrome), then window.open(href) shouldn't be an issue.
Whiteboard: [sg:want P3] [patch-r?] → [sg:want P3]
Assignee | ||
Comment 15•19 years ago
|
||
mozilla/toolkit/content/widgets/autocomplete.xml; new revision: 1.53;
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•19 years ago
|
Attachment #210665 -
Flags: branch-1.8.1?(mconnor)
Updated•19 years ago
|
Attachment #210665 -
Flags: approval-branch-1.8.1?(mconnor) → approval-branch-1.8.1+
Assignee | ||
Comment 16•19 years ago
|
||
mozilla/toolkit/content/widgets/text.xml; new revision: 1.18.2.4;
Keywords: fixed1.8.1
Target Milestone: --- → mozilla1.8.1
Comment 17•19 years ago
|
||
hey Gavin, this patch broke text boxes in thunderbird. It looks like http urls are no longer getting sent to the desktop but instead are trying to get opened from a window.open call which has no meaning in thunderbird (there is no navigator.xul to open).
See:
http://forums.mozillazine.org/viewtopic.php?t=387499
for more details.
Assignee | ||
Comment 18•19 years ago
|
||
(In reply to comment #17)
> hey Gavin, this patch broke text boxes in thunderbird.
Is there a bug filed on that issue? If there is, please assign it to me.
Comment 19•19 years ago
|
||
I filed Bug 328890.
Comment 20•19 years ago
|
||
Does this fix need to land on the 1.8.0 branch? chrome links seem to be blocked and data and javascript run with the correct privileges so I don't think it's necessary. Please nominate it if I'm misunderstanding something.
Updated•18 years ago
|
Flags: blocking1.8.0.8-
Assignee | ||
Comment 21•18 years ago
|
||
(In reply to comment #20)
> Does this fix need to land on the 1.8.0 branch?
No, this bug was more of a precautionary measure rather than addressing any specific problems, so I don't think it should land on the branch. I also think it should be removed from the security group. It's been fixed for a while, and it doesn't contain any security-sensitive information (certainly no more than bug 315004, which is already open).
Updated•18 years ago
|
Group: security
Updated•9 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•