Your message dated Mon, 11 May 2015 07:19:46 +0000
with message-id <[email protected]>
and subject line Bug#781608: fixed in caja 1.8.2-4
has caused the Debian Bug report #781608,
regarding MATE should disable automounting when screen is locked
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
781608: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=781608
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: caja
Version: 1.8.2-3
Severity: normal
Tags: patch, security
User: [email protected]
Usertags: origin-ubuntu natty ubuntu-patch

To avoid auto-run drive-by attacks by a physically proximate attacker on
the system from USB auto-mounting screen is locked, the desktop should
delay automounting until the screen is unlocked (to not interfere with
the case of sitting back down at your system, plugging in a device,
and then unlocking your screen).

This is similar to how gnome-keyring flushes all keys the when locking
the screen.

http://www.net-security.org/secworld.php?id=10544

This was fixed in Gnome upstream and in Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/714958
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/724285

The attached patch likely needs the dbus names changed to, e.g.,
"org.mate.ScreenSaver".

Thanks!

-Kees

-- 
Kees Cook                                            @debian.org
>From 98ebb6be0882ba2dbb0c621a2906e5190108bca1 Mon Sep 17 00:00:00 2001
From: Martin Pitt <[email protected]>
Date: Tue, 22 Feb 2011 14:06:14 +0100
Subject: [PATCH] disable automounting while screen is locked

On the recent Shmoocon there was a presentation by Jon Larimer demonstrating
how to abuse vulnerabilities and bugs, or even just creating socially or
security compromising thumbnails in mounting and thumbnailing, which happens o
automounting USB drives. This is a particular issue when this happens on a
locked box where the attacker doesn't otherwise have access to the user
account:

  http://www.net-security.org/secworld.php?id=10544

Disable automounting if the GNOME screen saver is currently locked.

Backported from gnome-settings-daemon trunk commits 71deedf7 and 90c0f8676.

https://bugzilla.gnome.org/show_bug.cgi?id=642020
---
 src/nautilus-application.c |  219 +++++++++++++++++++++++++++++++++++++++++++-
 src/nautilus-application.h |    5 +
 2 files changed, 223 insertions(+), 1 deletions(-)

Index: nautilus-2.32.2.1/src/nautilus-application.c
===================================================================
--- nautilus-2.32.2.1.orig/src/nautilus-application.c	2010-12-28 16:54:38.000000000 +0100
+++ nautilus-2.32.2.1/src/nautilus-application.c	2011-03-15 15:04:00.659603038 +0100
@@ -116,6 +116,9 @@
 static void     volume_added_callback              (GVolumeMonitor           *monitor,
 						    GVolume                  *volume,
 						    NautilusApplication      *application);
+static void     volume_removed_callback            (GVolumeMonitor           *monitor,
+						    GVolume                  *volume,
+						    NautilusApplication      *application);
 static void     drive_connected_callback           (GVolumeMonitor           *monitor,
 						    GDrive                   *drive,
 						    NautilusApplication      *application);
@@ -347,6 +350,15 @@
 
 	g_object_unref (application->unique_app);
 
+	if (application->ss_watch_id > 0) {
+		g_bus_unwatch_name (application->ss_watch_id);
+	}
+	
+	if (application->volume_queue != NULL) {
+		g_list_free_full (application->volume_queue, g_object_unref);
+		application->volume_queue = NULL;
+	}
+
 	if (application->automount_idle_id != 0) {
 		g_source_remove (application->automount_idle_id);
 		application->automount_idle_id = 0;
@@ -357,6 +369,11 @@
 		application->proxy = NULL;
 	}
 
+	if (application->ss_proxy != NULL) {
+		g_object_unref (application->ss_proxy);
+		application->ss_proxy = NULL;
+	}
+
         G_OBJECT_CLASS (nautilus_application_parent_class)->finalize (object);
 }
 
@@ -663,6 +680,175 @@
 }
 
 static void
+check_volume_queue (NautilusApplication *application)
+{
+        GList *l, *next;
+        GVolume *volume;
+
+        l = application->volume_queue;
+
+        if (application->screensaver_active) {
+                return;
+        }
+
+        while (l != NULL) {
+		volume = l->data;
+		next = l->next;
+
+		nautilus_file_operations_mount_volume (NULL, volume, TRUE);
+		application->volume_queue =
+			g_list_remove (application->volume_queue, volume);
+
+		g_object_unref (volume);
+		l = next;
+        }
+
+        application->volume_queue = NULL;
+}
+
+#define SCREENSAVER_NAME "org.gnome.ScreenSaver"
+#define SCREENSAVER_PATH "/org/gnome/ScreenSaver"
+#define SCREENSAVER_INTERFACE "org.gnome.ScreenSaver"
+
+static void
+screensaver_signal_callback (GDBusProxy *proxy,
+                             const gchar *sender_name,
+                             const gchar *signal_name,
+                             GVariant *parameters,
+                             gpointer user_data)
+{
+	NautilusApplication *application = user_data;
+
+	if (g_strcmp0 (signal_name, "ActiveChanged") == 0) {
+		g_variant_get (parameters, "(b)", &application->screensaver_active);
+		g_debug ("Screensaver active changed to %d", application->screensaver_active);
+
+		check_volume_queue (application);
+	}
+}
+
+static void
+screensaver_get_active_ready_cb (GObject *source,
+				 GAsyncResult *res,
+				 gpointer user_data)
+{
+	NautilusApplication *application = user_data;
+	GDBusProxy *proxy = application->ss_proxy;
+	GVariant *result;
+	GError *error = NULL;
+
+	result = g_dbus_proxy_call_finish (proxy,
+					   res,
+					   &error);
+
+	if (error != NULL) {
+		g_warning ("Can't call GetActive() on the ScreenSaver object: %s",
+			   error->message);
+		g_error_free (error);
+
+		return;
+	}
+
+	g_variant_get (result, "(b)", &application->screensaver_active);
+	g_variant_unref (result);
+
+	g_debug ("Screensaver GetActive() returned %d", application->screensaver_active);
+}
+
+static void
+screensaver_proxy_ready_cb (GObject *source,
+			    GAsyncResult *res,
+			    gpointer user_data)
+{
+	NautilusApplication *application = user_data;
+	GError *error = NULL;
+	GDBusProxy *ss_proxy;
+	
+	ss_proxy = g_dbus_proxy_new_finish (res, &error);
+
+	if (error != NULL) {
+		g_warning ("Can't get proxy for the ScreenSaver object: %s",
+			   error->message);
+		g_error_free (error);
+
+		return;
+	}
+
+	g_debug ("ScreenSaver proxy ready");
+
+	application->ss_proxy = ss_proxy;
+
+	g_signal_connect (ss_proxy, "g-signal",
+			  G_CALLBACK (screensaver_signal_callback), application);
+
+	g_dbus_proxy_call (ss_proxy,
+			   "GetActive",
+			   NULL,
+			   G_DBUS_CALL_FLAGS_NO_AUTO_START,
+			   -1,
+			   NULL,
+			   screensaver_get_active_ready_cb,
+			   application);
+}
+
+static void
+screensaver_appeared_callback (GDBusConnection *connection,
+			       const gchar *name,
+			       const gchar *name_owner,
+			       gpointer user_data)
+{
+	NautilusApplication *application = user_data;
+
+	g_debug ("ScreenSaver name appeared");
+
+	application->screensaver_active = FALSE;
+
+	g_dbus_proxy_new (connection,
+			  G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+			  NULL,
+			  name,
+			  SCREENSAVER_PATH,
+			  SCREENSAVER_INTERFACE,
+			  NULL,
+			  screensaver_proxy_ready_cb,
+			  application);
+}
+
+static void
+screensaver_vanished_callback (GDBusConnection *connection,
+			       const gchar *name,
+			       gpointer user_data)
+{
+	NautilusApplication *application = user_data;
+
+	g_debug ("ScreenSaver name vanished");
+
+	application->screensaver_active = FALSE;
+	g_object_unref (&application->ss_proxy);
+
+	/* in this case force a clear of the volume queue, without
+	 * mounting them.
+	 */
+	if (application->volume_queue != NULL) {
+		g_list_free_full (application->volume_queue, g_object_unref);
+		application->volume_queue = NULL;
+	}
+}
+
+static void
+do_initialize_screensaver (NautilusApplication *application)
+{
+	application->ss_watch_id =
+		g_bus_watch_name (G_BUS_TYPE_SESSION,
+				  SCREENSAVER_NAME,
+				  G_BUS_NAME_WATCHER_FLAGS_NONE,
+				  screensaver_appeared_callback,
+				  screensaver_vanished_callback,
+				  application,
+				  NULL);
+}
+
+static void
 do_upgrades_once (NautilusApplication *application,
 		  gboolean no_desktop)
 {
@@ -709,6 +895,10 @@
 	/* Initialize the ConsoleKit listener for active session */
 	do_initialize_consolekit (application);
 
+	/* Initialize GNOME screen saver listener to control automount
+	 * permission */
+	do_initialize_screensaver (application);
+
 	/* Watch for mounts so we can restore open windows This used
 	 * to be for showing new window on mount, but is not used
 	 * anymore */
@@ -724,6 +914,8 @@
 				 G_CALLBACK (mount_added_callback), application, 0);
 	g_signal_connect_object (application->volume_monitor, "volume_added",
 				 G_CALLBACK (volume_added_callback), application, 0);
+	g_signal_connect_object (application->volume_monitor, "volume_removed",
+				 G_CALLBACK (volume_removed_callback), application, 0);
 	g_signal_connect_object (application->volume_monitor, "drive_connected",
 				 G_CALLBACK (drive_connected_callback), application, 0);
 
@@ -1520,6 +1712,33 @@
 }
 
 static void
+check_screen_lock_and_mount (NautilusApplication *application,
+                             GVolume *volume)
+{
+        if (application->screensaver_active) {
+                /* queue the volume, to mount it after the screensaver state changed */
+                g_debug ("Queuing volume %p", volume);
+                application->volume_queue = g_list_prepend (application->volume_queue,
+                                                              g_object_ref (volume));
+        } else {
+                /* mount it immediately */
+		nautilus_file_operations_mount_volume (NULL, volume, TRUE);
+        }       
+}
+
+static void
+volume_removed_callback (GVolumeMonitor *monitor,
+                         GVolume *volume,
+                         NautilusApplication *application)
+{
+        g_debug ("Volume %p removed, removing from the queue", volume);
+
+        /* clear it from the queue, if present */
+        application->volume_queue =
+                g_list_remove (application->volume_queue, volume);
+}
+
+static void
 volume_added_callback (GVolumeMonitor *monitor,
 		       GVolume *volume,
 		       NautilusApplication *application)
@@ -1527,7 +1746,7 @@
 	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_MEDIA_AUTOMOUNT) &&
 	    g_volume_should_automount (volume) &&
 	    g_volume_can_mount (volume)) {
-		nautilus_file_operations_mount_volume (NULL, volume, TRUE);
+		check_screen_lock_and_mount (application, volume);
 	} else {
 		/* Allow nautilus_autorun() to run. When the mount is later
 		 * added programmatically (i.e. for a blank CD),
Index: nautilus-2.32.2.1/src/nautilus-application.h
===================================================================
--- nautilus-2.32.2.1.orig/src/nautilus-application.h	2010-12-28 16:54:38.000000000 +0100
+++ nautilus-2.32.2.1/src/nautilus-application.h	2011-03-15 15:03:21.099603020 +0100
@@ -68,6 +68,11 @@
 	unsigned int automount_idle_id;
 	GDBusProxy *proxy;
 	gboolean session_is_active;
+
+	gboolean screensaver_active;
+	guint ss_watch_id;
+	GDBusProxy *ss_proxy;
+	GList *volume_queue;
 } NautilusApplication;
 
 typedef struct {

--- End Message ---
--- Begin Message ---
Source: caja
Source-Version: 1.8.2-4

We believe that the bug you reported is fixed in the latest version of
caja, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mike Gabriel <[email protected]> (supplier of updated caja package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 11 May 2015 06:19:52 +0200
Source: caja
Binary: caja caja-common libcaja-extension1 libcaja-extension-dev gir1.2-caja 
caja-dbg libcaja-extension1-dbg
Architecture: source amd64 all
Version: 1.8.2-4
Distribution: unstable
Urgency: medium
Maintainer: MATE Packaging Team <[email protected]>
Changed-By: Mike Gabriel <[email protected]>
Description:
 caja       - file manager for the MATE desktop
 caja-common - file manager for the MATE desktop (common files)
 caja-dbg   - file manager for the MATE desktop (debugging symbols)
 gir1.2-caja - GObject introspection data for the caja library
 libcaja-extension-dev - libraries for caja components (development files)
 libcaja-extension1 - libraries for caja components
 libcaja-extension1-dbg - libraries for caja components (debugging symbols)
Closes: 781608
Changes:
 caja (1.8.2-4) unstable; urgency=medium
 .
   * debian/patches:
     + Add 0004_avoid-automounts-while-screen-is-locked.patch. Don't
       mount newly added USB flash drives / optical disks / etc. while
       a session is locked by the screensaver. Delay the automounting
       action until the session has been unlocked again. (Closes: #781608).
Checksums-Sha1:
 f1e82c4bfe4086230d8e3374e6034a52e0278a28 2869 caja_1.8.2-4.dsc
 05ae807d7a0128870cc739720e0453fb4211634f 12164 caja_1.8.2-4.debian.tar.xz
 9026cae58e1730100b9d400f860da4b3b22cdb8f 1252902 caja_1.8.2-4_amd64.deb
 a5de07d033a2c159d152aed3bd96b8551a0bf2b6 1798982 caja-common_1.8.2-4_all.deb
 b797b29a3b5556cbaeee9c3b2f9f1022f64a3afa 18262 
libcaja-extension1_1.8.2-4_amd64.deb
 a6c203977830de4a1923e8fb84794bfc1594f361 12042 
libcaja-extension-dev_1.8.2-4_amd64.deb
 636c0c91d79456e8f6abc1ebbb3326c12ec8ac08 13564 gir1.2-caja_1.8.2-4_amd64.deb
 77281b4e286633bc3df49eff0b20832d457c8afc 4030562 caja-dbg_1.8.2-4_amd64.deb
 4ee1741b172e6387b0a4d40cdb99531992e5db95 49192 
libcaja-extension1-dbg_1.8.2-4_amd64.deb
Checksums-Sha256:
 8de14be9b540a8900cba540f7855e918b45ca61d516e96d809e0789b747c880c 2869 
caja_1.8.2-4.dsc
 b59ffb1b8d0716d4026938f1d7d829ca5a5d1681b3283068f6ae52f38f37ca0e 12164 
caja_1.8.2-4.debian.tar.xz
 96eeb7920bdd134371abb727acc8607acd26a5a89881b48645f9811d25b04c31 1252902 
caja_1.8.2-4_amd64.deb
 e0101136803b0c9e0aea6e26c989ac328eb2b94225fe842b0f283720cb8fde32 1798982 
caja-common_1.8.2-4_all.deb
 283bdc98444f9de9fd6e7448b4490130f60643a94e1192546a7c56f722baca12 18262 
libcaja-extension1_1.8.2-4_amd64.deb
 89b5df998421541bc891783d03456b554415f5c2fb1567146f7aabffde8df961 12042 
libcaja-extension-dev_1.8.2-4_amd64.deb
 b24fc21137e1ef99f5004fdcab8dd961ffbc40dacaf2bc93a7d06e638b988646 13564 
gir1.2-caja_1.8.2-4_amd64.deb
 dc62d3cbae477f37037a3c7fd03ee6b1f7b44e03894f5daf7fe468fb94e74d6e 4030562 
caja-dbg_1.8.2-4_amd64.deb
 3ff821c2e1abb8a1c8042902cfac04f2c07669b208718e06948e5b610f7b6ce5 49192 
libcaja-extension1-dbg_1.8.2-4_amd64.deb
Files:
 ce0b034747e9992c50c002e19bb38dfc 2869 utils optional caja_1.8.2-4.dsc
 d99f0ee96509a0122210ec2ec7f231ff 12164 utils optional 
caja_1.8.2-4.debian.tar.xz
 397f7a9f3396905cd1d11004967ce278 1252902 utils optional caja_1.8.2-4_amd64.deb
 90ca95c584e87db5e61a0f79f4819c17 1798982 utils optional 
caja-common_1.8.2-4_all.deb
 2e6da34508ff10e6ed764cb0e03a0a42 18262 libs optional 
libcaja-extension1_1.8.2-4_amd64.deb
 ad1f277ceebf008dedd7a04b53ed1d80 12042 libdevel optional 
libcaja-extension-dev_1.8.2-4_amd64.deb
 9a5a69a111d13f7a87be8aa22defc231 13564 utils optional 
gir1.2-caja_1.8.2-4_amd64.deb
 aca3ef336e70a1f6e2ca907a9611c73c 4030562 debug extra caja-dbg_1.8.2-4_amd64.deb
 022bb6971aff4e53401f982be411c4cf 49192 debug extra 
libcaja-extension1-dbg_1.8.2-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVUFaLAAoJEJr0azAldxsxppYQAI7kY4iyvwwecxYJBwPFgKN7
IDh3O9cPF33V5uyhl/wk+YoDJDzrLBuZzqpaJDIeUWgTSTAhDOgKv2Nc6pi1rFWQ
WR67c9GQyEQxSbuu4d/vI8Z/DwlDZdg4J+awkex825boTbs6sy6lWHBiXZP2SuUV
SOJBrIf5oX8LjLjwkpHJQ1vd2ZjpF1n+t5+E30IzeOmtgi8cJ0MehnxgNxcE0ARm
bKocqPQOUQEfwNDXSyBF7OHypUzF9zQQkOjpdmqSv09l4RqpYy3fCJ17CXFrBbE1
KvyOxjHM1HKytVLjRHcfRBJUNIP4g/TNSn2WgET39RlbYnYsPBxXF81912qNyGZE
74ZNeOXfNFHgPtSTykpl0ThxW4cQzbVmoGzaDDpxFb7Qv0iuOFZbE++YACG5cHvI
Ttu96kUcfvdqiaxUEAXQlnJUcAwE2wLV3HfgvWm0vXAUC8zwF5mkGJ2bmq5vQs/p
zuYKBr/J3/np62zjd0HhD6+buVogT7wrehTbTGV4psGx42x+5B9O/5oGZcPb9yuG
tyImLNxzxbTyR2FUT++sdiLZEVEd0zx1GruTTvGN9KfzJzmzI8GhoqSdEOjxLq84
BsBlF95jUd4N4G41aXTKBQyumpy+bRUa/PK2noMeq0527tBRfNM5FtGviL6T2Ikt
BbDFQY+oeWYJA5Nat9vw
=mWcF
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to