Closed Bug 366568 Opened 19 years ago Closed 13 years ago

potential problem with favicons and useDefaultIcon

Categories

(Firefox :: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: guninski, Assigned: Gavin)

References

()

Details

Attachments

(1 file)

no exploit for this yet, filing seperate bug per bz's suggestion. http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/content/widgets/tabbrowser.xml&rev=1.216&mark=496-517#496 in tabbrowser.xml |shouldLoadFavIcon| tries to prevent active content in favicons. this does not work for |data:image/png;,VALIDPNG| (in this case the uri is loaded as favicon because of the special ImageDocument check) - so at least data: uris are loaded as favicons. in case |javascript:| uris may return |instanceof ImageDocument| this may lead to problems with favicons (according to bz this is possible). probably other abuse may be possible in this case. having in mind the problems with active favicons in the past, regardless whether comment #86 is exploitable or not, the check for sane favicon better be applied for the |image| case.
example javascript uri will be appreciated - manage to get just 'text/html' or 'text/plain' from javascript.
dveditz, believe that can fix this tomorrow my time by moving |shouldload...| in the innermost place that doesn't break world no matter if the bug is real or imaginary. feel free to assign to me if you feel like it.
Oh, hmm... So actually, javascript: seems to always return text/html for now: 494 // If the resultant script evaluation actually does return a value, we 495 // treat it as html. 496 rv = NS_NewInputStreamChannel(getter_AddRefs(channel), aURI, mIOThunk, 497 NS_LITERAL_CSTRING("text/html")); 498 if (NS_FAILED(rv)) return rv; While this works for loading images with <img> because that ignores the type, that won't work for image documents... unless we start to content-sniff more or something. I still think we should check here. Just a checkLoadURI for DISALLOW_SCRIPT should do the trick. No need to filter out data:.
Flags: blocking1.8.1.2?
Flags: blocking1.8.0.10?
Flags: blocking-firefox3?
(In reply to comment #0) > having in mind the problems with active favicons in the past, regardless > whether comment #86 is exploitable or not, comment 86 in what other bug?
(In reply to comment #4) > > comment 86 in what other bug? > in the meta. this was just mistyping, the full description is in the report.
We need an owner and patch quickly if this is going to make the next release... otherwise this is at-risk for being pushed out.
Flags: blocking1.8.1.2?
Flags: blocking1.8.1.2+
Flags: blocking1.8.0.10?
Flags: blocking1.8.0.10+
Assignee: nobody → dveditz
Flags: wanted1.8.1.x+
Flags: wanted1.8.0.x+
Flags: blocking1.8.1.2-
Flags: blocking1.8.1.2+
Flags: blocking1.8.0.10-
Flags: blocking1.8.0.10+
Gavin, Boris's comment 3 should get you started
Assignee: dveditz → gavin.sharp
Flags: blocking-firefox3? → blocking-firefox3+
Target Milestone: --- → Firefox 3 alpha6
Summary: potential problem with faviocons and useDefaultIcon → potential problem with favicons and useDefaultIcon
mustfix for b1
Target Milestone: Firefox 3 alpha6 → Firefox 3 beta1
Target Milestone: Firefox 3 M7 → Firefox 3 M8
Target Milestone: Firefox 3 M8 → Firefox 3 M9
Target Milestone: Firefox 3 M9 → Firefox 3 M10
Priority: -- → P3
Target Milestone: Firefox 3 M10 → Firefox 3 M11
i doubt this is exploitable => [sg:nse]
Whiteboard: [sg:nse]
Priority: P3 → P4
Not blocking on this bug for final ship. Would take a safe enough patch if one comes through.
Flags: wanted-firefox3+
Flags: blocking-firefox3-
Flags: blocking-firefox3+
Attached patch patchSplinter Review
I can't really make any sense out of why we have both browser.chrome.site_icons and browser.chrome.favicons. Rather than explicitly checking for javascript:, I decided to refactor the code and just re-use shouldLoadFavicon (which restricts to http[s]).
Attachment #603960 - Flags: review?(dao)
Comment on attachment 603960 [details] [diff] [review] patch > re-use shouldLoadFavicon (which restricts to http[s]). This restriction makes sense for appending /favicon.ico, but I don't think it makes sense for image documents. E.g. we still want favicons for file:// URI images.
Attachment #603960 - Flags: review?(dao) → review-
I think we can resolve this as invalid as per comment 3...
Still seems prudent to check for javascript:, I think.
Group: core-security
OS: Linux → All
Priority: P4 → --
Hardware: x86 → All
Whiteboard: [sg:nse]
Target Milestone: Firefox 3 beta3 → ---
Version: 2.0 Branch → Trunk
I changed my mind!
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: