diff -Nru avahi-0.7/debian/changelog avahi-0.7/debian/changelog --- avahi-0.7/debian/changelog 2021-07-06 15:39:14.000000000 +0000 +++ avahi-0.7/debian/changelog 2023-05-31 13:59:47.000000000 +0000 @@ -1,3 +1,12 @@ +avahi (0.7-4ubuntu7.2) focal-security; urgency=medium + + * SECURITY UPDATE: avahi-daemon can be crashed via DBus + - debian/patches/CVE-2023-1981.patch: emit error if requested service + is not found in avahi-daemon/dbus-protocol.c. + - CVE-2023-1981 + + -- Marc Deslauriers Wed, 31 May 2023 09:59:47 -0400 + avahi (0.7-4ubuntu7.1) focal-security; urgency=medium * SECURITY UPDATE: DoS via infinite loop on local socket diff -Nru avahi-0.7/debian/patches/CVE-2023-1981.patch avahi-0.7/debian/patches/CVE-2023-1981.patch --- avahi-0.7/debian/patches/CVE-2023-1981.patch 1970-01-01 00:00:00.000000000 +0000 +++ avahi-0.7/debian/patches/CVE-2023-1981.patch 2023-05-31 13:59:40.000000000 +0000 @@ -0,0 +1,55 @@ +Backport of: + +From a2696da2f2c50ac43b6c4903f72290d5c3fa9f6f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= +Date: Thu, 17 Nov 2022 01:51:53 +0100 +Subject: [PATCH] Emit error if requested service is not found + +It currently just crashes instead of replying with error. Check return +value and emit error instead of passing NULL pointer to reply. + +Fixes #375 +--- + avahi-daemon/dbus-protocol.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +--- a/avahi-daemon/dbus-protocol.c ++++ b/avahi-daemon/dbus-protocol.c +@@ -391,10 +391,14 @@ static DBusHandlerResult msg_server_impl + } + + t = avahi_alternative_host_name(n); +- avahi_dbus_respond_string(c, m, t); +- avahi_free(t); +- +- return DBUS_HANDLER_RESULT_HANDLED; ++ if (t) { ++ avahi_dbus_respond_string(c, m, t); ++ avahi_free(t); ++ ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } else { ++ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Hostname not found"); ++ } + + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAlternativeServiceName")) { + char *n, *t; +@@ -405,10 +409,14 @@ static DBusHandlerResult msg_server_impl + } + + t = avahi_alternative_service_name(n); +- avahi_dbus_respond_string(c, m, t); +- avahi_free(t); +- +- return DBUS_HANDLER_RESULT_HANDLED; ++ if (t) { ++ avahi_dbus_respond_string(c, m, t); ++ avahi_free(t); ++ ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } else { ++ return avahi_dbus_respond_error(c, m, AVAHI_ERR_NOT_FOUND, "Service not found"); ++ } + + } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "EntryGroupNew")) { + Client *client; diff -Nru avahi-0.7/debian/patches/series avahi-0.7/debian/patches/series --- avahi-0.7/debian/patches/series 2021-07-06 15:39:10.000000000 +0000 +++ avahi-0.7/debian/patches/series 2023-05-31 13:57:30.000000000 +0000 @@ -6,3 +6,4 @@ local-only-services-support.patch CVE-2017-6519-and-CVE-2018-1000845.patch CVE-2021-3468.patch +CVE-2023-1981.patch