<html><body>
<h3>Signed-off-by: Kevin Weng &lt;t-keweng@microsoft.com&gt;</h3>
<pre>.../dbus/dbus/CVE-2019-12749.patch            | 127 ++++++++++++++++++
meta/recipes-core/dbus/dbus_1.12.10.bb        |   1 +
2 files changed, 128 insertions(+)
create mode 100644 meta/recipes-core/dbus/dbus/CVE-2019-12749.patch</pre>
<p>diff --git a/meta/recipes-core/dbus/dbus/CVE-2019-12749.patch b/meta/recipes-core/dbus/dbus/CVE-2019-12749.patch new file mode 100644 index 0000000000..393c70ca21 --- /dev/null +++ b/meta/recipes-core/dbus/dbus/CVE-2019-12749.patch @@ -0,0 +1,127 @@ +From f0120c5d97a4cc1b659e86d38f2b1f646ca20ea3 Mon Sep 17 00:00:00 2001 +From: Simon McVittie &lt;smcv@collabora.com&gt; +Date: Thu, 30 May 2019 12:53:03 +0100 +Subject: [PATCH] auth: Reject DBUS_COOKIE_SHA1 for users other than the server + owner + +The DBUS_COOKIE_SHA1 authentication mechanism aims to prove ownership +of a shared home directory by having the server write a secret &ldquo;cookie&rdquo; +into a .dbus-keyrings subdirectory of the desired identity's home +directory with 0700 permissions, and having the client prove that it can +read the cookie. This never actually worked for non-malicious clients in +the case where server uid != client uid (unless the server and client +both have privileges, such as Linux CAP_DAC_OVERRIDE or traditional +Unix uid 0) because an unprivileged server would fail to write out the +cookie, and an unprivileged client would be unable to read the resulting +file owned by the server. + +Additionally, since dbus 1.7.10 we have checked that ~/.dbus-keyrings +is owned by the uid of the server (a side-effect of a check added to +harden our use of XDG_RUNTIME_DIR), further ruling out successful use +by a non-malicious client with a uid differing from the server's. + +Joe Vennix of Apple Information Security discovered that the +implementation of DBUS_COOKIE_SHA1 was susceptible to a symbolic link +attack: a malicious client with write access to its own home directory +could manipulate a ~/.dbus-keyrings symlink to cause the DBusServer to +read and write in unintended locations. In the worst case this could +result in the DBusServer reusing a cookie that is known to the +malicious client, and treating that cookie as evidence that a subsequent +client connection came from an attacker-chosen uid, allowing +authentication bypass. + +This is mitigated by the fact that by default, the well-known system +dbus-daemon (since 2003) and the well-known session dbus-daemon (in +stable releases since dbus 1.10.0 in 2015) only accept the EXTERNAL +authentication mechanism, and as a result will reject DBUS_COOKIE_SHA1 +at an early stage, before manipulating cookies. As a result, this +vulnerability only applies to: + +* system or session dbus-daemons with non-standard configuration +* third-party dbus-daemon invocations such as at-spi2-core (although +  in practice at-spi2-core also only accepts EXTERNAL by default) +* third-party uses of DBusServer such as the one in Upstart + +Avoiding symlink attacks in a portable way is difficult, because APIs +like openat() and Linux /proc/self/fd are not universally available. +However, because DBUS_COOKIE_SHA1 already doesn't work in practice for +a non-matching uid, we can solve this vulnerability in an easier way +without regressions, by rejecting it early (before looking at +~/.dbus-keyrings) whenever the requested identity doesn't match the +identity of the process hosting the DBusServer. + +Signed-off-by: Simon McVittie &lt;smcv@collabora.com&gt; +Closes: <a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsqfojzsKaTLrhYk7-2F4AqW4Z0aTTxYxcMGlkfrpmYKZqw1bpnzzdxCB9YO7xZwpTvnA-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FJYsjDq1g468dzj84vKE7KK-2FvT22avn5U9YcVt85sTA7Ci94id0JRQk8Th4xIK8bD0jhcWXOjB3I7xt0ISZ-2BK-2BvU-2FuvYtcbIn15FUxv3WsfjSG94GQV64lcAcb6u5pjvWOzA6ei9JZq5P35aDDmFs9ExeWJ2wJjNldwgvdBTDoRJQ15Dxe-2Fbm0ju-2B4Y5eKknE">https://gitlab.freedesktop.org/dbus/dbus/issues/269</a> +Closes: CVE-2019-12749 + +Upstream-Status: Backport +[<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=ZUEdHBk4v9DOmlXxaQIXsqfojzsKaTLrhYk7-2F4AqW4Z0aTTxYxcMGlkfrpmYKZqwxlDxIUuV3NsS4-2FTIcFoyAA-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FJYsjDq1g468dzj84vKE7KK-2FvT22avn5U9YcVt85sTA5t2XbPlcsWduP-2BADzAzeEW4GgIrSwGSszbXgZK-2BJy-2B1-2FJoXCBuiQcIATkPelhgyGI54NTfYGfa3lmtW28UIhwzibz-2F8-2FPaFs-2B6qW6GcOzoFyoZ4OtwwkywGJ7LuGbMuiLAwpNuuxMJ5Gy-2Fl-2FBAalHT">https://gitlab.freedesktop.org/dbus/dbus/commit</a> +/47b1a4c41004bf494b87370987b222c934b19016] + +CVE: CVE-2019-12749 + +Signed-off-by: Kevin Weng &lt;t-keweng@microsoft.com&gt; +--- + dbus/dbus-auth.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c +index 37d8d4c9..7390a9d5 100644 +--- a/dbus/dbus-auth.c ++++ b/dbus/dbus-auth.c +@@ -529,6 +529,7 @@ sha1_handle_first_client_response (DBusAuth         <strong>auth, +   DBusString tmp2; +   dbus_bool_t retval = FALSE; +   DBusError error = DBUS_ERROR_INIT; ++  DBusCredentials <strong>myself = NULL; + +   _dbus_string_set_length (&amp;auth-&gt;challenge, 0); + +@@ -565,6 +566,34 @@ sha1_handle_first_client_response (DBusAuth         *auth, +       return FALSE; +     } + ++  myself = _dbus_credentials_new_from_current_process (); ++ ++  if (myself == NULL) ++    goto out; ++ ++  if (!_dbus_credentials_same_user (myself, auth-&gt;desired_identity)) ++    { ++      /</strong> ++       * DBUS_COOKIE_SHA1 is not suitable for authenticating that the ++       * client is anyone other than the user owning the process ++       * containing the DBusServer: we probably aren't allowed to write ++       * to other users' home directories. Even if we can (for example ++       * uid 0 on traditional Unix or CAP_DAC_OVERRIDE on Linux), we ++       * must not, because the other user controls their home directory, ++       * and could carry out symlink attacks to make us read from or ++       * write to unintended locations. It's difficult to avoid symlink ++       * attacks in a portable way, so we just don't try. This isn't a ++       * regression, because DBUS_COOKIE_SHA1 never worked for other ++       * users anyway. ++       */ ++      _dbus_verbose (&quot;%s: client tried to authenticate as \&quot;%s\&quot;, &quot; ++                     &ldquo;but that doesn't match this process&rdquo;, ++                     DBUS_AUTH_NAME (auth), ++                     _dbus_string_get_const_data (data)); ++      retval = send_rejected (auth); ++      goto out; ++    } ++ +   /</strong> we cache the keyring for speed, so here we drop it if it's the +    * wrong one. FIXME caching the keyring here is useless since we use +    * a different DBusAuth for every connection. +@@ -679,6 +708,9 @@ sha1_handle_first_client_response (DBusAuth         *auth, +   _dbus_string_zero (&amp;tmp2); +   _dbus_string_free (&amp;tmp2); + ++  if (myself != NULL) ++    _dbus_credentials_unref (myself); ++ +   return retval; + } + +-- +2.22.0 + diff --git a/meta/recipes-core/dbus/dbus_1.12.10.bb b/meta/recipes-core/dbus/dbus_1.12.10.bb index d71f7f7042..d7ad1d8be4 100644 --- a/meta/recipes-core/dbus/dbus_1.12.10.bb +++ b/meta/recipes-core/dbus/dbus_1.12.10.bb @@ -16,6 +16,7 @@ SRC_URI = &quot;<a href="https://u12060237.ct.sendgrid.net/wf/click?upn=a3Po4i5toNpKG6uRFNTh8GIk-2Ba9cxqoglrvIf-2BcUiBkNb-2FDZBz6aTAWHeAlspiXNEPZ4mipCGTcXzx-2FTbdD1JQ-3D-3D_TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FJYsjDq1g468dzj84vKE7KK-2FvT22avn5U9YcVt85sTA5fafWiajdjVwoGRjv-2BiI-2Bq6Jx9MUsdKQDdyHIffLLIVU9O4TbO9EHnss64xsCl8IyXPwkX9Kspq9F9R6UFX2py0E4VL25x9fTmQCrjoGAwlPEh698RAcJQWOnoZ5Xn1fPmHIRwQb-2BENSIp74QXyY-2F2">http://dbus.freedesktop.org/releases/dbus/dbus-$</a>{PV}.tar.gz \</p>
<pre>file://tmpdir.patch \
file://dbus-1.init \
file://clear-guid_from_server-if-send_negotiate_unix_f.patch \</pre>
<p>+                   <a href="file://CVE-2019-12749.patch">file://CVE-2019-12749.patch</a> \</p>
<pre>"

SRC_URI[md5sum] = "c3e12b4206e2a7da39d7cc42567790ef"</pre>
<p>&mdash; 2.22.0</p>

<img src="https://u12060237.ct.sendgrid.net/wf/open?upn=TE0Kxc-2FihH-2BEaJFZv0piOBm40-2F8jB5b-2FHzeWxsyZzZlOtbMQm4wqVCgNIpo7dsW-2FJYsjDq1g468dzj84vKE7KK-2FvT22avn5U9YcVt85sTA4NlAFEYciwro36Z-2F-2F4GlYwLKlJCZgczAl3F65-2Bixa0S4k0-2BIAh5sPfUmJEgeLl5SZt7bjg-2BpF2XHRRvPg5teHBzn-2BzTkhINNrssX5hs8OxfU1eiX4pcqlPP7xOGmO1CUYqVxQmJOc9FOVA9-2F-2BkgmYm" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>