- Fix CVE-2026-54478, DNS Cookie bypass when combined with

proxy-protocol use. Thanks to Qifan Zhang, Palo Alto Networks,
  for the report.
This commit is contained in:
W.C.A. Wijngaards
2026-07-22 10:16:42 +02:00
parent 8c702de175
commit 8a15ffee62
+3 -3
View 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 &&