diff --git a/SOURCES/bind-9.16-CVE-2023-3341.patch b/SOURCES/bind-9.16-CVE-2023-3341.patch new file mode 100644 index 0000000..97a3bf1 --- /dev/null +++ b/SOURCES/bind-9.16-CVE-2023-3341.patch @@ -0,0 +1,168 @@ +From b137e12dc8118cddee20e372e480a495585e72b6 Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Tue, 19 Sep 2023 12:44:31 +0200 +Subject: [PATCH] Fix CVE-2023-3341 + +6245. [security] Limit the amount of recursion that can be performed + by isccc_cc_fromwire. (CVE-2023-3341) [GL #4152] +--- + lib/isccc/cc.c | 39 ++++++++++++++++++++++++-------- + lib/isccc/include/isccc/result.h | 4 +++- + lib/isccc/result.c | 4 +++- + 3 files changed, 35 insertions(+), 12 deletions(-) + +diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c +index 0be28b9057..3744d0f037 100644 +--- a/lib/isccc/cc.c ++++ b/lib/isccc/cc.c +@@ -50,6 +50,10 @@ + + #define MAX_TAGS 256 + #define DUP_LIFETIME 900 ++#ifndef ISCCC_MAXDEPTH ++#define ISCCC_MAXDEPTH \ ++ 10 /* Big enough for rndc which just sends a string each way. */ ++#endif + + typedef isccc_sexpr_t *sexpr_ptr; + +@@ -480,19 +484,25 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, + + static isc_result_t + table_fromwire(isccc_region_t *source, isccc_region_t *secret, +- uint32_t algorithm, isccc_sexpr_t **alistp); ++ uint32_t algorithm, unsigned int depth, isccc_sexpr_t **alistp); + + static isc_result_t +-list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp); ++list_fromwire(isccc_region_t *source, unsigned int depth, ++ isccc_sexpr_t **listp); + + static isc_result_t +-value_fromwire(isccc_region_t *source, isccc_sexpr_t **valuep) { ++value_fromwire(isccc_region_t *source, unsigned int depth, ++ isccc_sexpr_t **valuep) { + unsigned int msgtype; + uint32_t len; + isccc_sexpr_t *value; + isccc_region_t active; + isc_result_t result; + ++ if (depth > ISCCC_MAXDEPTH) { ++ return (ISCCC_R_MAXDEPTH); ++ } ++ + if (REGION_SIZE(*source) < 1 + 4) { + return (ISC_R_UNEXPECTEDEND); + } +@@ -513,9 +523,9 @@ value_fromwire(isccc_region_t *source, isccc_sexpr_t **valuep) { + result = ISC_R_NOMEMORY; + } + } else if (msgtype == ISCCC_CCMSGTYPE_TABLE) { +- result = table_fromwire(&active, NULL, 0, valuep); ++ result = table_fromwire(&active, NULL, 0, depth + 1, valuep); + } else if (msgtype == ISCCC_CCMSGTYPE_LIST) { +- result = list_fromwire(&active, valuep); ++ result = list_fromwire(&active, depth + 1, valuep); + } else { + result = ISCCC_R_SYNTAX; + } +@@ -525,7 +535,7 @@ value_fromwire(isccc_region_t *source, isccc_sexpr_t **valuep) { + + static isc_result_t + table_fromwire(isccc_region_t *source, isccc_region_t *secret, +- uint32_t algorithm, isccc_sexpr_t **alistp) { ++ uint32_t algorithm, unsigned int depth, isccc_sexpr_t **alistp) { + char key[256]; + uint32_t len; + isc_result_t result; +@@ -535,6 +545,10 @@ table_fromwire(isccc_region_t *source, isccc_region_t *secret, + + REQUIRE(alistp != NULL && *alistp == NULL); + ++ if (depth > ISCCC_MAXDEPTH) { ++ return (ISCCC_R_MAXDEPTH); ++ } ++ + checksum_rstart = NULL; + first_tag = true; + alist = isccc_alist_create(); +@@ -551,7 +565,7 @@ table_fromwire(isccc_region_t *source, isccc_region_t *secret, + GET_MEM(key, len, source->rstart); + key[len] = '\0'; /* Ensure NUL termination. */ + value = NULL; +- result = value_fromwire(source, &value); ++ result = value_fromwire(source, depth + 1, &value); + if (result != ISC_R_SUCCESS) { + goto bad; + } +@@ -589,14 +603,19 @@ bad: + } + + static isc_result_t +-list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp) { ++list_fromwire(isccc_region_t *source, unsigned int depth, ++ isccc_sexpr_t **listp) { + isccc_sexpr_t *list, *value; + isc_result_t result; + ++ if (depth > ISCCC_MAXDEPTH) { ++ return (ISCCC_R_MAXDEPTH); ++ } ++ + list = NULL; + while (!REGION_EMPTY(*source)) { + value = NULL; +- result = value_fromwire(source, &value); ++ result = value_fromwire(source, depth + 1, &value); + if (result != ISC_R_SUCCESS) { + isccc_sexpr_free(&list); + return (result); +@@ -628,7 +647,7 @@ isccc_cc_fromwire(isccc_region_t *source, isccc_sexpr_t **alistp, + return (ISCCC_R_UNKNOWNVERSION); + } + +- return (table_fromwire(source, secret, algorithm, alistp)); ++ return (table_fromwire(source, secret, algorithm, 0, alistp)); + } + + static isc_result_t +diff --git a/lib/isccc/include/isccc/result.h b/lib/isccc/include/isccc/result.h +index 5346babefc..5b6a876d1c 100644 +--- a/lib/isccc/include/isccc/result.h ++++ b/lib/isccc/include/isccc/result.h +@@ -46,8 +46,10 @@ + #define ISCCC_R_CLOCKSKEW (ISC_RESULTCLASS_ISCCC + 4) + /*% Duplicate */ + #define ISCCC_R_DUPLICATE (ISC_RESULTCLASS_ISCCC + 5) ++/*% Maximum recursion depth */ ++#define ISCCC_R_MAXDEPTH (ISC_RESULTCLASS_ISCCC + 6) + +-#define ISCCC_R_NRESULTS 6 /*%< Number of results */ ++#define ISCCC_R_NRESULTS 7 /*%< Number of results */ + + ISC_LANG_BEGINDECLS + +diff --git a/lib/isccc/result.c b/lib/isccc/result.c +index 9285435209..1956cb1655 100644 +--- a/lib/isccc/result.c ++++ b/lib/isccc/result.c +@@ -36,12 +36,14 @@ static const char *text[ISCCC_R_NRESULTS] = { + "bad auth", /* 3 */ + "expired", /* 4 */ + "clock skew", /* 5 */ +- "duplicate" /* 6 */ ++ "duplicate", /* 6 */ ++ "max depth" /* 7 */ + }; + + static const char *ids[ISCCC_R_NRESULTS] = { + "ISCCC_R_UNKNOWNVERSION", "ISCCC_R_SYNTAX", "ISCCC_R_BADAUTH", + "ISCCC_R_EXPIRED", "ISCCC_R_CLOCKSKEW", "ISCCC_R_DUPLICATE", ++ "ISCCC_R_MAXDEPTH" + }; + + #define ISCCC_RESULT_RESULTSET 2 +-- +2.41.0 + diff --git a/SOURCES/bind-9.16-update-b.root-servers.net.patch b/SOURCES/bind-9.16-update-b.root-servers.net.patch new file mode 100644 index 0000000..97b3ab2 --- /dev/null +++ b/SOURCES/bind-9.16-update-b.root-servers.net.patch @@ -0,0 +1,53 @@ +From c532af966a7328f0e518273bc1f6051bb9d9e995 Mon Sep 17 00:00:00 2001 +From: Mark Andrews +Date: Thu, 12 Oct 2023 10:19:38 +1100 +Subject: [PATCH] Update b.root-servers.net IP addresses + +This covers both root hints and the default primaries for the root +zone mirror. The official change date is Nov 27, 2023. + +(cherry picked from commit 2ca2f7e9852a3d6e93f065c01ea4679f723688f7) +--- + bin/named/config.c | 4 ++-- + lib/dns/rootns.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/bin/named/config.c b/bin/named/config.c +index 8c6f90c..c37015f 100644 +--- a/bin/named/config.c ++++ b/bin/named/config.c +@@ -292,14 +292,14 @@ view \"_bind\" chaos {\n\ + "# END MANAGED KEYS\n\ + \n\ + primaries " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\ +- 2001:500:200::b; # b.root-servers.net\n\ ++ 2801:1b8:10::b; # b.root-servers.net\n\ + 2001:500:2::c; # c.root-servers.net\n\ + 2001:500:2f::f; # f.root-servers.net\n\ + 2001:500:12::d0d; # g.root-servers.net\n\ + 2001:7fd::1; # k.root-servers.net\n\ + 2620:0:2830:202::132; # xfr.cjr.dns.icann.org\n\ + 2620:0:2d0:202::132; # xfr.lax.dns.icann.org\n\ +- 199.9.14.201; # b.root-servers.net\n\ ++ 170.247.170.2; # b.root-servers.net\n\ + 192.33.4.12; # c.root-servers.net\n\ + 192.5.5.241; # f.root-servers.net\n\ + 192.112.36.4; # g.root-servers.net\n\ +diff --git a/lib/dns/rootns.c b/lib/dns/rootns.c +index 885c2fb..b06d247 100644 +--- a/lib/dns/rootns.c ++++ b/lib/dns/rootns.c +@@ -52,8 +52,8 @@ static char root_ns[] = + ". 518400 IN NS M.ROOT-SERVERS.NET.\n" + "A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4\n" + "A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:BA3E::2:30\n" +- "B.ROOT-SERVERS.NET. 3600000 IN A 199.9.14.201\n" +- "B.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:200::b\n" ++ "B.ROOT-SERVERS.NET. 3600000 IN A 170.247.170.2\n" ++ "B.ROOT-SERVERS.NET. 3600000 IN AAAA 2801:1b8:10::b\n" + "C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12\n" + "C.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2::c\n" + "D.ROOT-SERVERS.NET. 3600000 IN A 199.7.91.13\n" +-- +2.43.0 + diff --git a/SOURCES/named.root b/SOURCES/named.root index 532d4ff..18b8e44 100644 --- a/SOURCES/named.root +++ b/SOURCES/named.root @@ -1,13 +1,13 @@ -; <<>> DiG 9.11.3-RedHat-9.11.3-3.fc27 <<>> +bufsize=1200 +norec @a.root-servers.net -; (2 servers found) +; <<>> DiG 9.18.20 <<>> -4 +tcp +norec +nostats @d.root-servers.net +; (1 server found) ;; global options: +cmd ;; Got answer: -;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46900 +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47286 ;; flags: qr aa; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 27 ;; OPT PSEUDOSECTION: -; EDNS: version: 0, flags:; udp: 1472 +; EDNS: version: 0, flags:; udp: 1450 ;; QUESTION SECTION: ;. IN NS @@ -28,7 +28,7 @@ ;; ADDITIONAL SECTION: a.root-servers.net. 518400 IN A 198.41.0.4 -b.root-servers.net. 518400 IN A 199.9.14.201 +b.root-servers.net. 518400 IN A 170.247.170.2 c.root-servers.net. 518400 IN A 192.33.4.12 d.root-servers.net. 518400 IN A 199.7.91.13 e.root-servers.net. 518400 IN A 192.203.230.10 @@ -41,7 +41,7 @@ k.root-servers.net. 518400 IN A 193.0.14.129 l.root-servers.net. 518400 IN A 199.7.83.42 m.root-servers.net. 518400 IN A 202.12.27.33 a.root-servers.net. 518400 IN AAAA 2001:503:ba3e::2:30 -b.root-servers.net. 518400 IN AAAA 2001:500:200::b +b.root-servers.net. 518400 IN AAAA 2801:1b8:10::b c.root-servers.net. 518400 IN AAAA 2001:500:2::c d.root-servers.net. 518400 IN AAAA 2001:500:2d::d e.root-servers.net. 518400 IN AAAA 2001:500:a8::e @@ -54,8 +54,3 @@ k.root-servers.net. 518400 IN AAAA 2001:7fd::1 l.root-servers.net. 518400 IN AAAA 2001:500:9f::42 m.root-servers.net. 518400 IN AAAA 2001:dc3::35 -;; Query time: 24 msec -;; SERVER: 198.41.0.4#53(198.41.0.4) -;; WHEN: Thu Apr 05 15:57:34 CEST 2018 -;; MSG SIZE rcvd: 811 - diff --git a/SPECS/bind.spec b/SPECS/bind.spec index 53c53ba..37c39c4 100644 --- a/SPECS/bind.spec +++ b/SPECS/bind.spec @@ -51,7 +51,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.23 -Release: 13%{?dist} +Release: 15%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -132,6 +132,9 @@ Patch189: bind-9.16-CVE-2023-2911-1.patch Patch190: bind-9.16-CVE-2023-2911-2.patch # https://gitlab.isc.org/isc-projects/bind9/commit/c003c5bc3c68f3e513654b6689e1f60280d14844 Patch191: bind-9.16-CVE-2023-2911-3.patch +Patch192: bind-9.16-CVE-2023-3341.patch +# https://gitlab.isc.org/isc-projects/bind9/commit/8924adca613ca9daea63786563cce6fdbd742c56 +Patch193: bind-9.16-update-b.root-servers.net.patch %{?systemd_ordering} Requires: coreutils @@ -451,6 +454,8 @@ in HTML and PDF format. %patch189 -p1 -b .CVE-2023-2911-1 %patch190 -p1 -b .CVE-2023-2911-2 %patch191 -p1 -b .CVE-2023-2911-3 +%patch192 -p1 -b .CVE-2023-3341 +%patch193 -p1 -b .b.root-servers.net %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 @@ -1174,6 +1179,12 @@ fi; %endif %changelog +* Thu Dec 07 2023 Petr Menšík - 32:9.16.23-15 +- Update addresses of b.root-servers.net (RHEL-18188) + +* Wed Sep 20 2023 Petr Menšík - 32:9.16.23-14 +- Limit the amount of recursion possible in control channel (CVE-2023-3341) + * Mon Jun 26 2023 Petr Menšík - 32:9.16.23-13 - Prevent possible endless loop when refreshing stale data (CVE-2023-2911)