After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 170493 - Handle "unsafe" files better
Handle "unsafe" files better
Status: RESOLVED OBSOLETE
Product: epiphany
Classification: Core
Component: Downloads
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garcia Campos
Marco Pesenti Gritti
: 134193 (view as bug list)
Depends on:
Blocks: 755382
 
 
Reported: 2005-03-15 20:46 UTC by Luis Villa
Modified: 2016-02-28 05:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Consider unknown mime types as unsafe. (899 bytes, patch)
2005-03-23 21:39 UTC, Jean-François Rameau
none Details | Review
Easier. (732 bytes, patch)
2005-03-23 21:52 UTC, Jean-François Rameau
committed Details | Review
Patch to check-mime.py (928 bytes, patch)
2005-03-24 20:36 UTC, Jean-François Rameau
committed Details | Review
New safe and unsafe mime types (syncho with freedesktop) (16.91 KB, patch)
2005-03-29 20:09 UTC, Jean-François Rameau
none Details | Review
New safe and unsafe mime types (syncho with freedesktop) (16.91 KB, patch)
2005-03-30 09:31 UTC, Jean-François Rameau
committed Details | Review

Description Luis Villa 2005-03-15 20:46:50 UTC
(1) install gnome-btdownload, ensure that it is set up to open a .torrent file
in nautilus.
(2) go to http://torrent.dulug.duke.edu/ and try to open the
gnome-2.10-livecd.iso torrent.
(3) note that it says it doesn't have a handler for .torrent files
(4) edit $prefix/share/epiphany/mime-types-permissions.xml, adding
application/x-bittorrent to the 'safe' section
(5) note that you can now open the file from torrent.dulug.duke.edu

In very poor form, this is two bugs:
(1) that torrents are not in the 'safe' mime type list
(2) that if your mimetype is not 'safe', you get told you don't have a handler,
and are allowed to download it anyway.
Comment 1 Jean-François Rameau 2005-03-23 21:39:32 UTC
Created attachment 39149 [details] [review]
Consider unknown mime types as unsafe.
Comment 2 Jean-François Rameau 2005-03-23 21:52:30 UTC
Created attachment 39152 [details] [review]
Easier.
Comment 3 Christian Persch 2005-03-24 15:49:43 UTC
Thanks for the patch! Committed to HEAD and gnome-2-10. Leaving bug open for the
mime type work.
Comment 4 Jean-François Rameau 2005-03-24 20:35:48 UTC
I propose to add the following mime types to safe part

<mime-type type="application/vnd.corel-draw"/>
<mime-type type="application/vnd.mozilla.xul+xml"/>
<mime-type type="application/vnd.wordperfect"/>
<mime-type type="application/x-xbel"/>
<mime-type type="application/x-bittorrent"/>
<mime-type type="application/x-blender"/>
<mime-type type="application/x-font-type1"/>
<mime-type type="application/x-font-otf"/>
<mime-type type="application/x-javascript"/>
<mime-type type="application/x-magicpoint"/>
<mime-type type="application/x-matroska"/>
<mime-type type="application/x-mozilla-bookmarks"/>
<mime-type type="application/x-netscape-bookmarks"/>
<mime-type type="application/x-wpg"/>
<mime-type type="audio/x-flac"/>
<mime-type type="audio/x-ms-asx"/>
<mime-type type="image/jpeg2000"/>
<mime-type type="image/x-pict"/>
<mime-type type="image/rle"/>
<mime-type type="image/x-dcm"/>
<mime-type type="image/x-dib"/>
<mime-type type="image/vnd.djvu"/>
<mime-type type="image/dpx"/>
<mime-type type="image/x-fits"/>
<mime-type type="image/x-fpx"/>
<mime-type type="image/x-icb"/>
<mime-type type="image/x-sgi"/>
<mime-type type="image/x-sun-raster"/>
<mime-type type="image/x-win-bitmap"/>
<mime-type type="text/x-gettext-translation-template"/>
<mime-type type="text/x-csharp"/>
<mime-type type="text/x-uil"/>
<mime-type type="text/x-xmi"/>
<mime-type type="video/x-nsv"/>

And for the unsafe ones:

<mime-type type="application/vnd.palm"/>
<mime-type type="application/vnd.hp-hpgl"/>
<mime-type type="application/vnd.hp-pcl"/>
<mime-type type="application/x-ipod-firmware"/>
<mime-type type="application/x-macbinary"/>
<mime-type type="application/x-ms-dos-executable"/>
<mime-type type="application/x-ole-storage"/>
<mime-type type="inode/mount-point"/>
Comment 5 Jean-François Rameau 2005-03-24 20:36:37 UTC
Created attachment 39220 [details] [review]
Patch to check-mime.py
Comment 6 Jean-François Rameau 2005-03-24 21:11:31 UTC
Safe part:

<mime-type type="application/vnd.corel-draw"/>
<mime-type type="application/vnd.wordperfect"/>
<mime-type type="application/x-xbel"/>
<mime-type type="application/x-bittorrent"/>
<mime-type type="application/x-blender"/>
<mime-type type="application/x-font-type1"/>
<mime-type type="application/x-font-otf"/>
<mime-type type="application/x-javascript"/>
<mime-type type="application/x-magicpoint"/>
<mime-type type="application/x-matroska"/>
<mime-type type="application/x-mozilla-bookmarks"/>
<mime-type type="application/x-netscape-bookmarks"/>
<mime-type type="application/x-wpg"/>
<mime-type type="audio/x-flac"/>
<mime-type type="audio/x-ms-asx"/>
<mime-type type="image/jpeg2000"/>
<mime-type type="image/x-pict"/>
<mime-type type="image/rle"/>
<mime-type type="image/x-dcm"/>
<mime-type type="image/x-dib"/>
<mime-type type="image/vnd.djvu"/>
<mime-type type="image/dpx"/>
<mime-type type="image/x-fits"/>
<mime-type type="image/x-fpx"/>
<mime-type type="image/x-icb"/>
<mime-type type="image/x-sgi"/>
<mime-type type="image/x-sun-raster"/>
<mime-type type="image/x-win-bitmap"/>
<mime-type type="text/x-gettext-translation-template"/>
<mime-type type="text/x-csharp"/>
<mime-type type="text/x-uil"/>
<mime-type type="text/x-xmi"/>
<mime-type type="video/x-nsv"/>

Unsafe category:

<mime-type type="application/vnd.mozilla.xul+xml"/>
<mime-type type="application/vnd.palm"/>
<mime-type type="application/vnd.hp-hpgl"/>
<mime-type type="application/vnd.hp-pcl"/>
<mime-type type="application/x-ipod-firmware"/>
<mime-type type="application/x-macbinary"/>
<mime-type type="application/x-ms-dos-executable"/>
<mime-type type="application/x-ole-storage"/>
<mime-type type="inode/mount-point"/>
Comment 7 Jean-François Rameau 2005-03-29 20:09:45 UTC
Created attachment 39402 [details] [review]
New safe and unsafe mime types (syncho with freedesktop)

The patch sorts the mime types so the big difference with the old
mime-types-permissions.xml.

And I'm suspicious of:

<mime-type type="inode/blockdevice"/>
<mime-type type="inode/chardevice"/>
<mime-type type="inode/directory"/>
<mime-type type="inode/fifo"/>
<mime-type type="inode/socket"/>
<mime-type type="inode/symlink"/>
<mime-type type="application/x-shared-library-la"/>
<mime-type type="application/x-sharedlib"
Comment 8 Christian Persch 2005-03-29 20:37:29 UTC
Looks mostly good, thanks for the patch!

Only thing I'm not sure about is application/x-*-rom ... move them to unsafe?
And the inode/* shouldn't occur on downloads, it's okay to remove them IMHO.
Comment 9 Jean-François Rameau 2005-03-30 09:31:35 UTC
Created attachment 39424 [details] [review]
New safe and unsafe mime types (syncho with freedesktop)

Ok, I moved inode/* to unsafe category.

And,

application/x-dc-rom:	     Dreamcast ROM
application/x-gameboy-rom:   Game Boy ROM
application/x-genesis-rom:   Genesis ROM
...
All are kind of executable, so I also moved them to unsafe category.
Comment 10 Christian Persch 2005-03-31 14:43:51 UTC
Committed the updated mime type list to HEAD and gnome-2-10.

From comment 0:
> (1) that torrents are not in the 'safe' mime type list
This is now fixed.

> (2) that if your mimetype is not 'safe', you get told you don't have a handler,
> and are allowed to download it anyway.
I don't understand this one: you mean we should disallow download of 'unsafe'
types completely?
Comment 11 Luis Villa 2005-03-31 17:16:57 UTC
wrt my (2), it seems like the current system doesn't actually provide any
safety- it gives an error message which implies that epiphany is broken, and
then allows you to download and launch the 'dangerous' item anyway.
Alternatives, off the top of my head:

* actually have the dialog say 'this is unsafe', instead of 'we don't have a
handler for it.' Explain why it is considered unsafe, what to do with it, etc.
(Probably good, I guess; I'm not sure where this list comes from or why it is so
unsafe, so I'm curious about the 'explain why' part myself :)

* Refuse to download it at all. (Probably not a great option :)

* Just ditch the dialog altogether, since as it currently stands, in 90% of
cases, the user is just going to (1) briefly bitch about how gnome/epiphany
sucks (2) download it (3) click on it in nautilus, presumably having the same
security impact as if epiphany launched it. (Honestly, my preferred option,
though maybe I'm missing something.)

[As an aside, why isn't this a blacklist? Why should I have to modify epiphany
every time I install a new mime-type handler?]
Comment 12 Christian Persch 2005-04-01 10:49:59 UTC
> * actually have the dialog say 'this is unsafe', instead of 'we don't have a
> handler for it.' 
Hmm right, we only show the 'unsafe' warning when it's both unsafe and a handler
exists. I'm not sure if that's wrong, though: if no handler exists, the 'unsafe'
type becomes 'safe', because there's no program bug to exploit by opening it, no?

> Explain why it is considered unsafe, what to do with it, etc.
> (Probably good, I guess; I'm not sure where this list comes from or why it is 
> so unsafe, so I'm curious about the 'explain why' part myself :)
We can do that; just need a good explanation. 'Unsafe' means 'we guessed it
might be possible that this file type is dangerous'. Like, shell scripts,
executables etc. And rpm/debs.

> * Refuse to download it at all. (Probably not a great option :)
Agreed, not a good option :)

> * Just ditch the dialog altogether, since as it currently stands, in 90% of
> cases, the user is just going to (1) briefly bitch about how gnome/epiphany
> sucks (2) download it (3) click on it in nautilus, presumably having the same
> security impact as if epiphany launched it. (Honestly, my preferred option,
> though maybe I'm missing something.)

AISI, there are 2 types of files: those that need another program to 'view'
them, and those that are self-contained. The first category is (mostly) safe
(except interpreted languages, and the like); the second is totally insecure.
Should we really make it any easier for users to run arbitrary code from the net?

> [As an aside, why isn't this a blacklist? Why should I have to modify epiphany
> every time I install a new mime-type handler?]

That's just a precaution, in case we overlooked an 'unsafe' format; we we treat
'unknown' like 'unsafe'.
Comment 13 Luis Villa 2005-04-02 06:24:45 UTC
> Should we really make it any easier for users to run arbitrary code from the
> net?

But you're not making it /hard/, you're just making it /irritating/. It's still
only 2 additional clicks to download the unsafe whatever, hide all windows, find
it on the desktop, and click to launch it. If we're really confident that this
stuff is insecure* then either refuse to download it altogether, or work with
the nautilus people to also block it there.

* and I'm really unconvinced we should make this determination at the browser
level, instead of at the handler/OS level.
Comment 14 Reinout van Schouwen 2005-11-28 00:15:54 UTC
*** Bug 134193 has been marked as a duplicate of this bug. ***
Comment 15 Reinout van Schouwen 2005-11-28 00:17:08 UTC
Adjusting summary.
Comment 16 Michael Catanzaro 2015-12-08 17:27:13 UTC
My guess is this bug is why various MIME types cannot be opened nowadays. We probably have more recent bug reports as well, but there's so many to sort through....