|
|
ea891e |
From 166978a09cf5edff4028e670b6074215a4c75eca Mon Sep 17 00:00:00 2001
|
|
|
ea891e |
From: Colin Walters <walters@verbum.org>
|
|
|
ea891e |
Date: Thu, 14 Feb 2013 10:19:34 -0500
|
|
|
ea891e |
Subject: [PATCH] CVE-2013-0292: dbus-gproxy: Verify sender of NameOwnerChanged signals to be o.f.DBus
|
|
|
ea891e |
|
|
|
ea891e |
Anyone can hop on the bus and emit a signal whose interface is
|
|
|
ea891e |
o.f.DBus; it's expected at the moments that clients (and notably DBus
|
|
|
ea891e |
libraries) check the sender.
|
|
|
ea891e |
|
|
|
ea891e |
This could previously be used to trick a system service using dbus-glib
|
|
|
ea891e |
into thinking a malicious signal came from a privileged source, by
|
|
|
ea891e |
claiming that ownership of the privileged source's well-known name had
|
|
|
ea891e |
changed from the privileged source's real unique name to the attacker's
|
|
|
ea891e |
unique name.
|
|
|
ea891e |
|
|
|
ea891e |
[altered to be NULL-safe so it won't crash on peer connections -smcv]
|
|
|
ea891e |
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
|
ea891e |
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
|
ea891e |
---
|
|
|
ea891e |
dbus/dbus-gproxy.c | 7 ++++---
|
|
|
ea891e |
1 files changed, 4 insertions(+), 3 deletions(-)
|
|
|
ea891e |
|
|
|
ea891e |
diff --git a/dbus/dbus-gproxy.c b/dbus/dbus-gproxy.c
|
|
|
ea891e |
index 2fc52f9..c3ae9ec 100644
|
|
|
ea891e |
--- a/dbus/dbus-gproxy.c
|
|
|
ea891e |
+++ b/dbus/dbus-gproxy.c
|
|
|
ea891e |
@@ -1250,8 +1250,11 @@ dbus_g_proxy_manager_filter (DBusConnection *connection,
|
|
|
ea891e |
GSList *tmp;
|
|
|
ea891e |
const char *sender;
|
|
|
ea891e |
|
|
|
ea891e |
+ sender = dbus_message_get_sender (message);
|
|
|
ea891e |
+
|
|
|
ea891e |
/* First we handle NameOwnerChanged internally */
|
|
|
ea891e |
- if (dbus_message_is_signal (message,
|
|
|
ea891e |
+ if (g_strcmp0 (sender, DBUS_SERVICE_DBUS) == 0 &&
|
|
|
ea891e |
+ dbus_message_is_signal (message,
|
|
|
ea891e |
DBUS_INTERFACE_DBUS,
|
|
|
ea891e |
"NameOwnerChanged"))
|
|
|
ea891e |
{
|
|
|
ea891e |
@@ -1280,8 +1283,6 @@ dbus_g_proxy_manager_filter (DBusConnection *connection,
|
|
|
ea891e |
}
|
|
|
ea891e |
}
|
|
|
ea891e |
|
|
|
ea891e |
- sender = dbus_message_get_sender (message);
|
|
|
ea891e |
-
|
|
|
ea891e |
/* dbus spec requires these, libdbus validates */
|
|
|
ea891e |
g_assert (dbus_message_get_path (message) != NULL);
|
|
|
ea891e |
g_assert (dbus_message_get_interface (message) != NULL);
|
|
|
ea891e |
--
|
|
|
ea891e |
1.7.1
|
|
|
ea891e |
|