]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix CVE-2026-54478, DNS Cookie bypass when combined with
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 22 Jul 2026 08:16:42 +0000 (10:16 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 22 Jul 2026 08:16:42 +0000 (10:16 +0200)
  proxy-protocol use. Thanks to Qifan Zhang, Palo Alto Networks,
  for the report.

util/data/msgparse.c

index 9239f8fe396a8dcf9cd6e321f8c86265354c081f..7b2de102efa8b847b07c68937fd9a98899c24e94 100644 (file)
@@ -1068,13 +1068,13 @@ parse_edns_options_from_query(uint8_t* rdata_ptr, size_t rdata_len,
                         * purposes. It will be overwritten if (re)creation
                         * is needed.
                         */
-                       if(repinfo->remote_addr.ss_family == AF_INET) {
+                       if(repinfo->client_addr.ss_family == AF_INET) {
                                memcpy(server_cookie + 16,
-                                       &((struct sockaddr_in*)&repinfo->remote_addr)->sin_addr, 4);
+                                       &((struct sockaddr_in*)&repinfo->client_addr)->sin_addr, 4);
                        } else {
                                cookie_is_v4 = 0;
                                memcpy(server_cookie + 16,
-                                       &((struct sockaddr_in6*)&repinfo->remote_addr)->sin6_addr, 16);
+                                       &((struct sockaddr_in6*)&repinfo->client_addr)->sin6_addr, 16);
                        }
 
                        if(cfg->cookie_secret_file &&