Open
Refix CVE-2026-59987 #207
nickyangAdd on 3 days ago
Refix CVE-2026-59987 #207
Open
Total: 2 files changed+15-8
| @@ -2,7 +2,7 @@ From cfeef2a28e260c67caac4b88440729c744cb24b6 Mon Sep 17 00:00:00 2001 | |||
| 2 | From: Evgeny Vereshchagin <evvers@ya.ru> | 2 | From: Evgeny Vereshchagin <evvers@ya.ru> |
| 3 | Date: Mon, 22 Jun 2026 03:30:28 +0000 | 3 | Date: Mon, 22 Jun 2026 03:30:28 +0000 |
| 4 | Subject: [PATCH] common: make sure valid domain names can be normalized | 4 | Subject: [PATCH] common: make sure valid domain names can be normalized |
| 5 | - | 5 | + |
| 6 | It fixes a bug where it was possible for unprivileged local users to | 6 | It fixes a bug where it was possible for unprivileged local users to |
| 7 | crash avahi-daemon via D-Bus by calling the RecordBrowserNew method with | 7 | crash avahi-daemon via D-Bus by calling the RecordBrowserNew method with |
| 8 | bogus domain names. For example when the following commands were run | 8 | bogus domain names. For example when the following commands were run |
| @@ -29,28 +29,32 @@ avahi-daemon: dbus-protocol.c:984: dbus_prepare_record_browser_object: Assertion | |||
| 29 | ==2424== by 0x4004EF7: run_server (main.c:1279) | 29 | ==2424== by 0x4004EF7: run_server (main.c:1279) |
| 30 | ==2424== by 0x4004EF7: main (main.c:1708) | 30 | ==2424== by 0x4004EF7: main (main.c:1708) |
| 31 | ``` | 31 | ``` |
| 32 | - | 32 | + |
| 33 | https://github.com/avahi/avahi/security/advisories/GHSA-4v6h-9g73-wm5j | 33 | https://github.com/avahi/avahi/security/advisories/GHSA-4v6h-9g73-wm5j |
| 34 | --- | 34 | --- |
| 35 | avahi-common/domain.c | 4 ++++ | 35 | avahi-common/domain.c | 4 ++++ |
| 36 | 1 file changed, 4 insertions(+) | 36 | 1 file changed, 4 insertions(+) |
| 37 | 37 | ||
| 38 | diff --git a/avahi-common/domain.c b/avahi-common/domain.c | 38 | diff --git a/avahi-common/domain.c b/avahi-common/domain.c |
| 39 | -index 2085f48..ab3ff6a 100644 | 39 | +index 2085f48..31c63bc 100644 |
| 40 | --- a/avahi-common/domain.c | 40 | --- a/avahi-common/domain.c |
| 41 | +++ b/avahi-common/domain.c | 41 | +++ b/avahi-common/domain.c |
| 42 | -@@ -368,7 +368,11 @@ int avahi_is_valid_service_subtype(const char *t) { | 42 | +@@ -368,11 +368,15 @@ int avahi_is_valid_service_subtype(const char *t) { |
| 43 | 43 | ||
| 44 | int avahi_is_valid_domain_name(const char *t) { | 44 | int avahi_is_valid_domain_name(const char *t) { |
| 45 | int is_first = 1; | 45 | int is_first = 1; |
| 46 | + char normalized[AVAHI_DOMAIN_NAME_MAX]; | 46 | + char normalized[AVAHI_DOMAIN_NAME_MAX]; |
| 47 | assert(t); | 47 | assert(t); |
| 48 | -+ | ||
| 49 | -+ if (!(avahi_normalize_name(t, normalized, sizeof(normalized)))) | ||
| 50 | -+ return 0; | ||
| 51 | 48 | ||
| 52 | if (strlen(t) >= AVAHI_DOMAIN_NAME_MAX) | 49 | if (strlen(t) >= AVAHI_DOMAIN_NAME_MAX) |
| 53 | return 0; | 50 | return 0; |
| 51 | + | ||
| 52 | ++ if (!(avahi_normalize_name(t, normalized, sizeof(normalized)))) | ||
| 53 | ++ return 0; | ||
| 54 | ++ | ||
| 55 | + do { | ||
| 56 | + char label[AVAHI_LABEL_MAX]; | ||
| 57 | + | ||
| 54 | -- | 58 | -- |
| 55 | 2.54.0 | 59 | 2.54.0 |
| 56 | 60 | ||