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 747953 - Information leak via plain text HTTP connection
Information leak via plain text HTTP connection
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
3.22
Depends on:
Blocks:
 
 
Reported: 2015-04-15 22:05 UTC by Tobias Mueller
Modified: 2016-05-24 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
source: Add "net:plaintext" source tag doc (1.26 KB, patch)
2015-07-02 10:48 UTC, Bastien Nocera
committed Details | Review
lua-factory: Block plain text queries when source doesn't advertise it (1.95 KB, patch)
2015-07-02 10:48 UTC, Bastien Nocera
committed Details | Review
grilo: Don't leak information over http (1003 bytes, patch)
2016-05-12 19:30 UTC, Marinus Schraal
committed Details | Review

Description Tobias Mueller 2015-04-15 22:05:43 UTC
According to https://mail.gnome.org/archives/safety-list/2015-January/msg00000.html <mid:CAN0s7yT92JOXSv7Pyt6D=tebzLREnmr1FxUa=OYo9FS205nw0A@mail.gmail.com> GNOME music leaks information although it can prevent most of it by using the HTTPS API.
Comment 1 Vadim Rutkovsky 2015-06-09 14:44:39 UTC
(In reply to Tobias Mueller from comment #0)
> According to
> https://mail.gnome.org/archives/safety-list/2015-January/msg00000.html
> <mid:CAN0s7yT92JOXSv7Pyt6D=tebzLREnmr1FxUa=OYo9FS205nw0A@mail.gmail.com>
> GNOME music leaks information although it can prevent most of it by using
> the HTTPS API.

Ressigning to grilo, since we request it via a grilo plugin
Comment 2 Bastien Nocera 2015-06-09 15:05:53 UTC
What changes are we supposed to make to the last.fm plugin exactly? And really, we shouldn't have to go fish out that information from a mailing-list archive, please put the relevant details in Bugzilla in the future.
Comment 3 Elad Alfassa 2015-06-09 15:12:03 UTC
We can't do anything on our end, it's all in bug 743449 comment 0 - last.fm's CDN does not support HTTPS for everything.
Comment 4 Andres Gomez 2015-06-09 15:30:04 UTC
In one hand, grilo's plugin is using 1.0 API which, most probably is already deprecated.

In the other hand, consider:
https://ws.audioscrobbler.com/1.0/album/enya/The%20Celts/info.xml

The albumart URLs are:

<coverart>
<small>http://userserve-ak.last.fm/serve/34s/85450891.png</small>
<medium>http://userserve-ak.last.fm/serve/64s/85450891.png</medium>
<large>http://userserve-ak.last.fm/serve/126/85450891.png</large>
</coverart>

As Elad comments, the certificate for https://userserve-ak.last.fm is invalid but the HTTPS method is not working even if we accept the invalid cert.

Hence, the only way is to asume using HTTP.

In addition, there is no personal ID in that URL so, even though there is no reason to leak which albumart are you browsing, the leaking information is not that compromising, IMHO.

I would propose WONTFIX.
Comment 5 Andres Gomez 2015-06-09 15:31:21 UTC
Consider also bug 700276 for WONTFIXing.
Comment 6 Elad Alfassa 2015-06-09 15:37:15 UTC
(In reply to Andres Gomez from comment #4)
> In addition, there is no personal ID in that URL so, even though there is no
> reason to leak which albumart are you browsing, the leaking information is
> not that compromising, IMHO.
> 

That's slightly misleading, because if you look at the big picture (and not just one individual request) you can fetch a list of all albums in the user's library - which is pretty much uniquely identifying (most people would have different sets of albums on their machines).

However, I do agree that this should be closed, either as WONTFIX or NOTGNOME, because there's nothing we can do.
Comment 7 Tobias Mueller 2015-06-18 09:11:48 UTC
Am I correct assuming that this information leak only occurs when using the last.fm plugin?  Such that not installing (or uninstalling) that plugin will make GNOME Music stop leaking your identity.
Comment 8 Andres Gomez 2015-06-18 09:18:53 UTC
(In reply to Tobias Mueller from comment #7)
> Am I correct assuming that this information leak only occurs when using the
> last.fm plugin?  Such that not installing (or uninstalling) that plugin will
> make GNOME Music stop leaking your identity.

I think that's correct. If the lastfm-albumart plugin is not installed, there is no leak of identity.
Comment 9 Michael Catanzaro 2015-07-01 23:53:00 UTC
Yo Andres, can we remove the lastfm-albumart plugin until this is resolved? It's important that our applications respect users, and that includes keeping personal info like music preferences private by default.

One possible resolution, if HTTPS is not possible, would be an opt-in that explains the risk without any technical details, something like: "Displaying album arts allows other people on the internet to see the music you listen to. [Cancel] [Enable album art]"
Comment 10 Andres Gomez 2015-07-02 08:56:13 UTC
(In reply to Michael Catanzaro from comment #9)
> One possible resolution, if HTTPS is not possible, would be an opt-in that
> explains the risk without any technical details, something like: "Displaying
> album arts allows other people on the internet to see the music you listen
> to. [Cancel] [Enable album art]"

I think that kind of opt-in has to come from the apps using this plugin through grilo.

About removing the plugin, I will let someone with more "authority" to say ...
Comment 11 Juan A. Suarez Romero 2015-07-02 09:16:05 UTC
This very same concern could be applied for any kind of plugin that uses a public REST API (i.e., that doesn't allow encrypting the parameters).

For instance, if I provide a plugin that, let's say, gets the lyrics from a webpage, the same can be said: it is leaking the data.


Is it a problem? It depends on the application. In the case of Music , it can be seen as a problems. In others maybe not.


If for Music is a problem, Music should black-list it: if the plugin is loaded, then unload it.
Comment 12 Juan A. Suarez Romero 2015-07-02 09:20:57 UTC
Ok, I need to say something else: yes, using HTTPS would fix the problem.

Probably the right approach is either Music unloading that plugin, or asking packagers to remove the plugin.
Comment 13 Juan A. Suarez Romero 2015-07-02 09:23:37 UTC
Related with bug #700276
Comment 14 Juan A. Suarez Romero 2015-07-02 09:35:49 UTC
BTW, the 2.0 API wouldn't fix the problem: the final jpg cover is obtained through http, not https.
Comment 15 Andres Gomez 2015-07-02 09:44:56 UTC
(In reply to Elad Alfassa from comment #6)
> (In reply to Andres Gomez from comment #4)
> > In addition, there is no personal ID in that URL so, even though there is no
> > reason to leak which albumart are you browsing, the leaking information is
> > not that compromising, IMHO.
> > 
> 
> That's slightly misleading, because if you look at the big picture (and not
> just one individual request) you can fetch a list of all albums in the
> user's library - which is pretty much uniquely identifying (most people
> would have different sets of albums on their machines).

Not that much misleading, IMHO.

It is true that you can "re-construct" a finger print of your musical taste but you will need first to be able to match an album from its cover art.

Maybe you can do this if you have available a similar album art DB like LastFm's (Spotify, Amazon, etc.), but, although not impossible, this is not so trivial, IMHO.
Comment 16 Elad Alfassa 2015-07-02 09:47:39 UTC
Just a list of all pictures fetched is enough to construct a fingerprint and thus identifying your device across networks.

Regardless, Music can't disable this plugin... Music's UX relies on having album art. And since there's no HTTPS possible here, there's nothing we can do about it and this bug should really be closed.
Comment 17 Juan A. Suarez Romero 2015-07-02 09:56:04 UTC
(In reply to Elad Alfassa from comment #16)
> Just a list of all pictures fetched is enough to construct a fingerprint and
> thus identifying your device across networks.
> 

Maybe caching those covers on disk would minimize the problem (not remove it). At least, you wouldn't be identified in next connections.

> Regardless, Music can't disable this plugin... Music's UX relies on having
> album art. And since there's no HTTPS possible here, there's nothing we can
> do about it and this bug should really be closed.

Yep. We would need an alternative plugin.
Comment 18 Elad Alfassa 2015-07-02 09:58:58 UTC
Yeah, caching would be useful... but should it be implemented in the plugin or in Music itself?
Comment 19 Juan A. Suarez Romero 2015-07-02 10:19:56 UTC
It depends.

If you implement in Music, you have more flexibility regarding how to store the images, and how to recover them.

If you do through the plugin itself, then probably the best approach would be saving the images following the MediaArt spec. Later, the covers could be recovered directly by Music (computing the expected image value) or through Tracker.

In case of doing through plugin,this should be an optional parameter.
Comment 20 Bastien Nocera 2015-07-02 10:48:08 UTC
Created attachment 306594 [details] [review]
source: Add "net:plaintext" source tag doc

This will make it easier for applications to avoid using plaintext
channels, such as HTTP-only connections, when doing requests.

Adding a tag allows applications to avoid hard-coding sources which
might leak private information.
Comment 21 Bastien Nocera 2015-07-02 10:48:26 UTC
Created attachment 306595 [details] [review]
lua-factory: Block plain text queries when source doesn't advertise it

To avoid sources from doing plain text queries without advertising them,
verify the schemes used by the URLs passed to grl.fetch.
Comment 22 Bastien Nocera 2015-07-02 10:50:22 UTC
Those 2 above are my way of "fixing" this. We still need patches to the various sources that make plain text HTTP queries, like the last.fm one, but at least, now, applications can make informed decisions on which sources to use.
Comment 23 Bastien Nocera 2015-07-17 11:33:14 UTC
Am I going to get any feedback on this?
Comment 24 Tobias Mueller 2015-07-17 11:57:16 UTC
FWIW: I like the approach.
Comment 25 Bastien Nocera 2015-07-17 12:18:10 UTC
Comment on attachment 306594 [details] [review]
source: Add "net:plaintext" source tag doc

Attachment 306594 [details] pushed as 7e87137 - source: Add "net:plaintext" source tag doc
Comment 26 Bastien Nocera 2015-07-17 12:18:32 UTC
Attachment 306595 [details] pushed as 975a810 - lua-factory: Block plain text queries when source doesn't advertise it
Comment 27 Michael Catanzaro 2015-07-17 15:29:10 UTC
Does this mean the connections are blocked unless the application opts-in?
Comment 28 Bastien Nocera 2015-07-17 15:53:03 UTC
(In reply to Michael Catanzaro from comment #27)
> Does this mean the connections are blocked unless the application opts-in?

No, the application will have to destroy the sources it doesn't want, such as the ones advertising themselves as "net:plaintext" in the tags.
Comment 29 Michael Catanzaro 2016-01-02 21:25:18 UTC
Ping-pong back to GNOME Music, since it sounds like changes are required in Music. Maybe someone who is familiar with grilo could take a stab at a patch?
Comment 30 Marinus Schraal 2016-05-12 19:30:10 UTC
Created attachment 327736 [details] [review]
grilo: Don't leak information over http

Grilo can use sources that use insecure http connections, leaking
information about the users behaviour while doing so.

Disable all Grilo sources that use insecure connections by checking for
the net:plaintext tag.
Comment 31 Marinus Schraal 2016-05-12 19:35:17 UTC
The patch in #30 should fix this issue. I think this should be the default behaviour.

However, this currently disables music's main albumart source (lastfm). There are other sources, but in my opinion they aren't as extensive.

So, we should probably allow users a choice if they want to use the unsafe sources as well. Is this possibly something to be integrated in the cc privacy options?
Comment 32 Michael Catanzaro 2016-05-12 20:25:33 UTC
(In reply to Marinus Schraal from comment #31)
> So, we should probably allow users a choice if they want to use the unsafe
> sources as well. Is this possibly something to be integrated in the cc
> privacy options?

No, I don't think we should add application-specific settings under Privacy, nor do I want to make users some generic functionality vs. privacy switch.
Comment 33 Michael Catanzaro 2016-05-12 20:28:14 UTC
Review of attachment 327736 [details] [review]:

I think it's totally acceptable to lose some album art for the time being, until the LastFM provider can be improved to use their new secure API.

::: gnomemusic/grilo.py
@@ +174,3 @@
     def _on_source_added(self, pluginRegistry, mediaSource):
+        if "net:plaintext" in mediaSource.get_tags():
+            return

Bastien, I think it's a bad idea that we are required to have this non-obvious code in GNOME Music to make it secure. Preferably grilo would just not return any plaintext sources unless the application specifies otherwise. It should be secure by default, else tons of applications will get this wrong.
Comment 34 Marinus Schraal 2016-05-12 21:08:14 UTC
(In reply to Michael Catanzaro from comment #33)
> I think it's totally acceptable to lose some album art for the time being,
> until the LastFM provider can be improved to use their new secure API.

The secure API is already used, only all the image links provided by the api go over http.

But I just noticed that it actually works now to get them over https, only the certificate is untrusted.
Comment 35 Michael Catanzaro 2016-05-12 21:16:04 UTC
(In reply to Marinus Schraal from comment #34)
> But I just noticed that it actually works now to get them over https, only
> the certificate is untrusted.

Incredible. I don't think it's a good idea to pin this certificate, as we can't expect them to give us advance notice when changing it to avoid breaking GNOME Music. Maybe they'll fix this if we ask nicely.
Comment 36 Bastien Nocera 2016-05-13 01:42:09 UTC
(In reply to Michael Catanzaro from comment #33)
<snip>
> Bastien, I think it's a bad idea that we are required to have this
> non-obvious code in GNOME Music to make it secure. Preferably grilo would
> just not return any plaintext sources unless the application specifies
> otherwise. It should be secure by default, else tons of applications will
> get this wrong.

We give you all the information we have. It's up to the application to filter them out. Totem filters out "adult" tagged sources for example.
Comment 37 Marinus Schraal 2016-05-23 12:14:01 UTC
Comment on attachment 327736 [details] [review]
grilo: Don't leak information over http

Committed this as it solves the problem now.

As for the discussion, I do agree that we should strive for a secure by default approach in this day and age.

I opened a bug about this for grilo: bug #766788 .
Comment 38 Marinus Schraal 2016-05-23 12:15:58 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Comment 39 Bastien Nocera 2016-05-23 12:18:47 UTC
(In reply to Marinus Schraal from comment #37)
> Comment on attachment 327736 [details] [review] [review]
> grilo: Don't leak information over http
> 
> Committed this as it solves the problem now.

Pretty sure this patch is broken. It doesn't unregister the source.

> As for the discussion, I do agree that we should strive for a secure by
> default approach in this day and age.
> 
> I opened a bug about this for grilo: bug #766788 .
Comment 40 Marinus Schraal 2016-05-23 12:38:10 UTC
(In reply to Bastien Nocera from comment #39)
> 
> Pretty sure this patch is broken. It doesn't unregister the source.

I'm pretty sure music is broken, it never unregistered a source ever afaics. Please do file a bug, let's fix it in one go.
Comment 41 Bastien Nocera 2016-05-23 13:36:26 UTC
(In reply to Marinus Schraal from comment #40)
> (In reply to Bastien Nocera from comment #39)
> > 
> > Pretty sure this patch is broken. It doesn't unregister the source.
> 
> I'm pretty sure music is broken, it never unregistered a source ever afaics.
> Please do file a bug, let's fix it in one go.

Your patch doesn't do what you thought it did. Your fix is broken, and will still call those sources that are marked as insecure.
Comment 42 Marinus Schraal 2016-05-24 10:24:31 UTC
Fair enough, should be fixed now. Thanks for the heads-up.