Last Comment Bug 252198 - weak XUL security allows chrome UI spoofing ("phishing" attack)
: weak XUL security allows chrome UI spoofing ("phishing" attack)
Status: RESOLVED DUPLICATE of bug 22183
:
Product: Firefox
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: P1 critical with 9 votes (vote)
: ---
Assigned To: Blake Ross
:
Mentors:
http://www.nd.edu/~jsmith30/xul/test/...
: 253745 374129 (view as bug list)
Depends on: 252811
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-19 16:55 PDT by Jeff Smith
Modified: 2007-03-15 17:57 PDT (History)
51 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Jeff Smith 2004-07-19 16:55:50 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.8

Firefox's chrome UI is written entirely in XUL.  Because of this, a website can have embedded XUL that spoofs the UI.  For an example, see the demo at
http://www.nd.edu/~jsmith30/xul/test/spoof.html

I don't know a solution to this problem.  Perhaps we can put some more limitations on remote XUL (a la the popup blocker).  Or perhaps we can make the status bar always-on.  For a little more discussion, see:
http://forums.mozillazine.org/viewtopic.php?t=102334


Reproducible: Always
Steps to Reproduce:
1.  Go to any site with some deceptive XUL files
2.  Enter credit card number
3.  p0wnd!
Actual Results:  
The default installation of Firefox will display a spoofed login page so real that even seasoned Firefox users will have trouble seeing the evil.

Expected Results:  
Some sort of warning, or some behavior that prevents such a complete takeover.  Firefox should be safe out-of-the-box, because people who don't know how to detect a phishing scam are the same people who don't know how to turn on security options.

Note that this works in all 0.9 versions of Firefox up to today's nightly, on (probably) all platforms, with (probably) all themes.

Because other websites can make use of the chrome:// protocol, the bad guy's job is made much easier; very few files are actually downloaded from the bad webserver.  In addition, chrome:// allows the spoof to be "theme-aware".

The "allow javascript to hide the statusbar" option is also on by default.  It shouldn't be.
Comment 1 Pascal Chevrel:pascalc 2004-07-19 17:02:17 PDT
Confirmed, scary...
Comment 2 Oleg Sidletskiy 2004-07-19 17:28:22 PDT
->IMO it's at least critical
Comment 3 Martijn Kint 2004-07-20 00:48:47 PDT
How about a whitelist for known "good" sites (ex. mozilla.org, mozdev, paypal,
ebay, amazon, etc etc.), they would be able to use the chrome:// protocol, other
sites could be added by the user.

Or we could follow the same route as we did with the xpi install mechanism and
present the user with some sort of warning. (DNS cross reference?)
Comment 4 Big 2004-07-20 04:54:29 PDT
Asking the user isn't secure. How much people enables everything in IE just to be able to have access to all features? We can't count on asking users if they want a secure browser or a feature browser: they will always choose the feature browser and complain after that it isnt secure (just after beiing stoled its credit card info...)

Maybe a white list could do it... It should be well hidden though. Not many people needs this.
Comment 5 Michael Lefevre 2004-07-20 09:38:12 PDT
Just to keep the bug updated with the discussion in the thread...

Someone pointed out that XUL isn't necessary - the same thing can be achieved
with HTML (and produced a demo at
http://www.pikey.me.uk/mozilla/test/spooftest.html ).

That demo uses images from chrome://, but those could of course be copied and
served from the site (although you'd only be able to spoof the default theme)

I don't see a solution to this, aside from making some part of the UI unhideable
so spoof windows at least have a dual status bar or URL bar. I don't know if
there's a bug for that yet...
Comment 6 Big 2004-07-20 09:41:48 PDT
What about making a location of FF transparent?? It could be a bit like those
holograms on credit cards (visa).

Making the spinning icon transparent? If you can see thrue, than icons would be
originals...
Comment 7 Jeff Smith 2004-07-20 10:09:02 PDT
(In reply to comment #6)
> What about making a location of FF transparent??

There's a new CSS3 property called "opacity" that is supported by Moz 1.7+ and FFX 0.9+ ...

Here is what the problem boils down to.  The SSL architecture guarantees us that
we know when we're talking with "Paypal, Inc."  The problem is in Firefox
indicating this to the user.  Since html can also be used to do spoofing, just 
limiting XUL isn't enough.  Here are some options:

1) Force some UI to always be present, or put it where the bad guy can't get to it.
    For example, put the padlock in the title bar of the app.
2) Introduce some per-user UI randomness so that a spoofer doesn't know what to spoof
3) Do some type of warning for each new domain that the user tries to sumbit a html form to
    "Warning - you are about to submit information to www.paypal-spammerfish.com.  Make sure that
    you trust this domain.  Do you want to continue?"
   (Power users will know how to turn this off; it'll be our little secret.)
4) Change the FFX logo to a spinning 'e'...

Some non-solutions that would at least help the matter a lot:
1) Limit XUL some more.  Put up warnings, or whitelists, or something.
2) Limit chrome:// some more.  Put up warnings, or whitelists, ....
Comment 8 Jesse Ruderman 2004-07-20 10:53:07 PDT
IMO, it makes more sense to keep the address bar always on than to keep the
status bar always on.

Status bar always on:
* Web site can't spoof an encrypted connection.
* Web site can't spoof update notification in order to trick you into installing
malware.

Address bar always on:
* Web site can't make itself look like a native application.  It's clear that
the window is a web browser content window.
* Address is visible, so you know what site you're on.  This is much more
important than knowing whether the connection is encrypted and/or authenticated.
* Web site can't spoof an encrypted connection (Firefox only).

Anyway, this is a dup of bug 22183.
Comment 9 Michael Lefevre 2004-07-20 11:27:49 PDT
If it's a dupe, then unless bug 22183 has some details which don't appear in
this bug and/or the Mozillazine thread, it could be opened and this bug duped, no?

For the status bar/URL bar not being hideable - that should be a separate bug.
Is there one yet (I know it's been mentioned in other bugs)?
Comment 10 Jesse Ruderman 2004-07-20 12:35:01 PDT
Comments 76 through 84 in bug 22183 are a debate over whether to make it public :/

> For the status bar/URL bar not being hideable - that should be a separate bug.

What is this bug about, then?
Comment 11 Big 2004-07-20 12:48:42 PDT
(In reply to comment #10)
> Comments 76 through 84 in bug 22183 are a debate over whether to make it public :/
> 
> > For the status bar/URL bar not being hideable - that should be a separate bug.
> 
> What is this bug about, then?

This bug is about security issue of XUL UI. If it includes non-hidding of the
address bar, then I don't see why we should open another bug...
Comment 12 Heikki Toivonen (remove -bugzilla when emailing directly) 2004-07-21 21:29:51 PDT
I don't think I've seen this idea mentioned before, so here's another way to
limit the success rate for UI spoofing attacks: on installation (or first launch
in new profile), create some randomness to the UI (different colors, gradients,
fractal image variations of common icons etc.). That way everyone's program
would look slightly different, enabling smart users to realize when they are
viewing a scam. The variations should not be made available to remote chrome.

Of course I'd like all my Mozilla installations to look the same, so the
"randomness" could be asked from the user during installation and if you wanted
the same UI mods you would supply the same information on each install.
Comment 13 Gervase Markham [:gerv] 2004-07-22 00:11:32 PDT
Bug 245406 is relevant to this discussion.

Gerv
Comment 14 Brendan Eich [:brendan] 2004-07-23 09:04:00 PDT
Why do we allow content to window.open or otherwise use chrome: URLs?

Don't we forbid file: URLs from being loaded into windows or frames from
non-file:  non-chrome: documents?

/be
Comment 15 Luke H 2004-07-30 08:31:04 PDT
This is pretty serious.

Disallowing remote XUL by default and asking whether the user wants to enable it
"for this site" and doing the same for access to the chrome: URLs seems only
sensible. Also requiring the address bar and relevant chrome to be displayed
ALWAYS unless the user says otherwise.
Comment 16 bugzilla.mozilla.org 2004-07-30 08:40:44 PDT
like comment #5 said: this has nothing to do with XUL in itself

somebody could fake firefox , MSIE or whatever wit a little effort using plain HTML

use MSIE to try the simple example at http://ja-web.de/tmp/iefake/

the UI does not work but how many unexperienced people will notice before they
klick the login button?

Comment 17 Doron Rosenberg (IBM) 2004-07-30 08:47:04 PDT
We have a pref for not allowing js to hide the statusbar (something WinXP Sp2
will do for IE) - we could default it to true.

Also, we could make non-chrome documents not be able to resize/open windows
larger than the screen (to move the statusbar offscreen) - don't we have that
functionality already?
Comment 18 Doron Rosenberg (IBM) 2004-07-30 08:53:00 PDT
Brendan: if we didn't allow non-chrome XUL to reference chrome urls, people
could just hardcode the menuitems in their XUL and not use the chrome entities
as they did in that spoof url.
Comment 19 Michael Lefevre 2004-07-30 09:05:55 PDT
Defaulting the pref for disallowing removal of the status bar was filed as bug
252811 (which is currently marked as blocking this bug)
Comment 20 Robert Parenton 2004-07-30 11:22:49 PDT
*** Bug 253745 has been marked as a duplicate of this bug. ***
Comment 21 Boris Zbarsky [:bz] 2004-07-30 11:30:46 PDT
I think always showing the status bar is in fact the right thing to do (unless
the window is using the "chrome" flag, which requires expanded priveleges to use).
Comment 22 Daniel Veditz [:dveditz] 2004-07-30 14:15:40 PDT
Bug referenced in a Secunia Advisory: http://secunia.com/advisories/12188/
Comment 23 Dominique Dumont 2004-07-31 01:10:33 PDT
Another solution would be to manage a list of host where the user can send
POSTDATA to (just like the popup host list).

This would not prevent the spoofed window but it would prevent the harm from
being done: when the user click on send, a windows pops up informing him of the
*actual* destination of the information, all risk associated and ask him whether
to allow the POSTDATA request or not.

This could work for all form of phishing.

Hope this help
Comment 24 Jeff Smith 2004-07-31 02:08:34 PDT
(In reply to comment #16)
> like comment #5 said: this has nothing to do with XUL in itself
> 

The reason I see this as being more serious than spoofing the UI with a jpeg is
because the result is far more realistic.  Furthermore, if you know half a thing 
about XUL, it's actually -easy- to do this; most of the hard XUL work has
already been coded for you and can be copy/pasted from the chrome folder.  All
you have to do is modify a couple things.

(In reply to comment #23)
> Another solution would be to manage a list of host where the user can send
> POSTDATA to (just like the popup host list).

Unfortunately, this will not work, as you can bypass the <form> tag entirely, by
using some javascript to roll your own URL into a GET request.

(In reply to comment #17)
> Also, we could make non-chrome documents not be able to resize/open windows
> larger than the screen (to move the statusbar offscreen) - don't we have that
> functionality already?

Is that supposed to be guaranteed?  On Windows XP, I can't make a window appear
partially offscreen with window.open(), but on my GNOME Linux desktop, I can.
Comment 25 Roger Espel Llima 2004-07-31 04:46:27 PDT
IMO the right solution to this is to change the default so that JS popup
windows must have a Location bar AND a status bar.

Either of these is technically enough to make the spoof imperfect, but
the two together make it *really* clear that this is a browser window.

Let's be secure by default:

user_pref("dom.disable_window_open_feature.location", true);
user_pref("dom.disable_window_open_feature.status" , true); 
Comment 26 Frederik Himpe 2004-07-31 05:16:45 PDT
The settings of comment #25 make it indeed very clear that something is wrong,
however Joe User will not understand that it's in fact a malicious website
trying to trick you. He will rather think that it's a kind of bug of Firefox or
something like that.  So these prefs are a start, but they certainly are not
sufficient.
Comment 27 Tuomas Heino 2004-07-31 06:02:48 PDT
(In reply to comment #25)
> IMO the right solution to this is to change the default so that JS popup
> windows must have a Location bar AND a status bar.
> 
> Either of these is technically enough to make the spoof imperfect, but
> the two together make it *really* clear that this is a browser window.

In addition to that the URLs in location & status bar should be 
syntax-highlighted, possibly warning the user if it contains any of the classic
www.fake.com\cgi-bin\****@12345678/?id=123 -type URLs.
Comment 28 Michael Lefevre 2004-07-31 06:10:23 PDT
> In addition to that the URLs in location & status bar should be 
> syntax-highlighted, possibly warning the user if it contains any of the classic
> www.fake.com\cgi-bin\crap@12345678/?id=123 -type URLs.

The status bar only contains the hostname - none of the other stuff in the URL -
that's the point of having that text in the status bar. Also, there is now a
warning for URLs which have silly auth stuff.
Comment 29 tve 2004-07-31 06:35:59 PDT
Best, imo, would be to add a <groupbox> around remote XUL documents, with a
<caption label="Remote Web Application">, but don't know how easy this would be
to realize.

Or a bar, similar to the new popup notification bar. ("This is a remote web
application, blah blah...")

Both seem to be more elegant than preventing from hiding the location and/or
status bars.
Comment 30 James Kinney 2004-07-31 07:31:31 PDT
(In reply to comment #29)
> Best, imo, would be to add a <groupbox> around remote XUL documents, with a
> <caption label="Remote Web Application">, but don't know how easy this would be
> to realize.
> 
Yes. A process to diffrentiate between "local chrome" and "remote chrome" and
non-hideable indicators to announce "remote chrome" applications. A frame border
that is yellow and black striped like warning tape coupled with a notifier box
announcing the fact that the striped window is a remote application that may
"look like a web page".

Add to this the ability to locally store a signed copy of the remote
applications chrome file similar to the extension downloads. This way remote
applications can be pulled in once with proper credentials and subsequently use
the downloaded, trusted local copy.
Comment 31 Erich Hoover 2004-07-31 10:19:12 PDT
Note that AdBlock and GoogleBar go away on the demo pages (available at
http://www.nd.edu/~jsmith30/xul/test/spoof.html), so it looks like someone with
extensions loaded might catch on to the page being spoofed.

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7) Gecko/20040629 Firefox/0.9.1
Comment 32 Patrick Thompson 2004-07-31 10:52:03 PDT
A fwiw. The spoof doesn't work on the Sky Pilot Classic theme. The bogus
toolbars appear but not the bogus locks in the URLBar nor the statusbarpanel.
That theme uses a different security icon filename and statusbarpanel security
lock placement, which may be the reason for its, apparent, innoculation.
Comment 33 Robert Marcano 2004-07-31 11:07:26 PDT
I think that this can be solved the same way Java applets do when they open out
of browser page windows: any non signed XUL jar application or signed jar
without privileges granted, must show a warning attached below the windows
notifying the user that it is a remote not signed application
Comment 34 Luiz Américo 2004-07-31 12:40:12 PDT
Here's a (user) suggestion:

By default,when trying to execute a remote XUL app, a dialog should appear
warning the user that is a remote app and letting the user decide if he wants to
execute it anyway. An option to allow all XUL app from that site should be
available in cited dialog.
Also a white list of allowed sites to execute XUL apps, would be available in
Preferences/Security.

This way, it's possible to mantain the same aspect and advanced features of XUL
applications without compromise security.

I hope this can help.

Luiz
Comment 35 neilr8133 2004-07-31 23:09:17 PDT
I don't know if it's significant or not, but on my version of FireFox
(Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040707
Firefox/0.9.2) when I run the spoof demo for .9.0-.9.2 and try to look at the
bookmarks, under 'bookmark this page' the only thing there is an entry labled 
"manBookMarksCmd.label;(_M_ANBOOKMARKSCMD.ACCESSKEY;)"

It seems strange that my real bookmarks weren't loaded, so I thought I'd mention
this in case whatever bug/feature is preventing them from loading might be
exploited to defeat the spoofing itself.
Comment 36 Mike Kowalski 2004-07-31 23:20:56 PDT
I'm using Firefox 0.8 and I get

<key id="key_newMessage" key="&sendMessage.commandkey;"
command="Browser:NewMessage" modifiers="accel"/>
----------------------------------^

when I run the demo for 0.9-0.9.2.
Comment 37 alundra 2004-08-01 02:32:05 PDT
(In reply to comment #35)
> I don't know if it's significant or not, but on my version of FireFox
> (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040707
> Firefox/0.9.2) when I run the spoof demo for .9.0-.9.2 and try to look at the
> bookmarks, under 'bookmark this page' the only thing there is an entry labled 
> "manBookMarksCmd.label;(_M_ANBOOKMARKSCMD.ACCESSKEY;)"
> 
> It seems strange that my real bookmarks weren't loaded, so I thought I'd mention
> this in case whatever bug/feature is preventing them from loading might be
> exploited to defeat the spoofing itself.


I get the exact same thing here , i think this is important to be able to verify
this
Comment 38 alundra 2004-08-01 02:34:44 PDT
(In reply to comment #35)
> I don't know if it's significant or not, but on my version of FireFox
> (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040707
> Firefox/0.9.2) when I run the spoof demo for .9.0-.9.2 and try to look at the
> bookmarks, under 'bookmark this page' the only thing there is an entry labled 
> "manBookMarksCmd.label;(_M_ANBOOKMARKSCMD.ACCESSKEY;)"
> 
> It seems strange that my real bookmarks weren't loaded, so I thought I'd mention
> this in case whatever bug/feature is preventing them from loading might be
> exploited to defeat the spoofing itself.


I get the exact same thing here , i think this is important to be able to verify
this
Comment 39 Jeff Smith 2004-08-01 02:57:01 PDT
(In reply to comment #38)
> (In reply to comment #35)
> I get the exact same thing here , i think this is important to be able to verify
> this

Sorry!  That's all my fault!  I've been trying to make just the two demos work
for an increasing number of nightly builds, and they're all slightly different.
 I'll try to do some debugging tomorrow.
Comment 40 alundra 2004-08-01 03:10:59 PDT
Sorry for the double post ( something must have gone wrong)
I forgot to mention that i am using -> Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Comment 41 Snap 2004-08-01 07:56:10 PDT
(In reply to comment #34)
> Here's a (user) suggestion:
> 
> By default,when trying to execute a remote XUL app, a dialog should appear
> warning the user that is a remote app and letting the user decide if he wants to
> execute it anyway.

I think it's a good idea. And/or use a different GUI for all XUL windows.

(In reply to comment #3)
> How about a whitelist for known "good" sites (ex. mozilla.org, mozdev, paypal,
> ebay, amazon, etc etc.), they would be able to use the chrome:// protocol, other
> sites could be added by the user.

Why a whitelist or allow "good" sites ? I don't see why a "good" site would use
chrome://, but we can imagine many "bad" site would try to modify the whitelist.
Comment 42 Michael 2004-08-01 08:17:05 PDT
(In reply to comment #34)
> Here's a (user) suggestion:
> 
> By default,when trying to execute a remote XUL app, a dialog should appear
> warning the user that is a remote app and letting the user decide if he wants to
> execute it anyway. An option to allow all XUL app from that site should be
> available in cited dialog.
> Also a white list of allowed sites to execute XUL apps, would be available in
> Preferences/Security.

Isn't it possible to use some kind of sandbox model as it is used in java? The
idea is to inform the user that a website is XUL enhanced and there might be a
classification of things XUL will address, hiding Menu, statusbar etc.

If that is not possible, sorry XUL, why not deactivate it completely for remote
components, i've learned that mozilla/firefox... needs it for rendering, that is
quite fine, great, but is there a single website that makes use of XUL? Haven't
seen any lately, in the last 10 years or so ;-) </Joke> 

Maybe we should think about some kind of zone model the IE uses: So XUL could be
enabled for local and intranet access and some selected funtions even in the
internet zone. 
Comment 43 Christian :Biesinger (don't email me, ping me on IRC) 2004-08-01 08:44:33 PDT
(In reply to comment #14)
> Why do we allow content to window.open or otherwise use chrome: URLs?

<img> does not use checkloaduri. iirc that's because that'd break inserting
images in editor... see bug 69070
Comment 44 Blake Ross 2004-08-01 17:36:28 PDT

*** This bug has been marked as a duplicate of 22183 ***
Comment 45 Jesse Ruderman 2007-03-15 17:57:41 PDT
*** Bug 374129 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.