From f02f2bc4ab18eba3be41fb4ee268d1337b2a98c1 Mon Sep 17 00:00:00 2001 From: Evan Vetere Date: Fri, 11 Sep 2026 12:14:06 -0400 Subject: [PATCH] fix(deps): update hickory crates to 0.26.3 for RUSTSEC-2026-0119 hickory-proto 0.25.2 is affected by GHSA-q2qq-hmj6-3wpp (RUSTSEC-2026-0119): name compression during message encoding does a linear scan per label, so a response with many records can burn CPU. The fix is in hickory-proto 0.26.1. This moves to 0.26.3, the latest patch release, which also carries the security fixes from 0.26.2 and the regression fixes that followed them. hickory-server has to move with hickory-proto. The dns-dev server builds Name and Record values with hickory-proto and hands them to hickory-server, so both crates must use the same hickory-proto version. Bumping hickory-proto alone, as Renovate did in #181, leaves hickory-server 0.25.2 on hickory-proto 0.25.2 and the types no longer match. The lockfile also moves the transitive hickory-resolver and hickory-net, which iroh pulls in, from 0.26.1 to 0.26.3. After this change the workspace has a single hickory-proto version. The code changes in dns_dev.rs follow the 0.26 renames and signature changes: ServerFuture is now Server, the authority module is now zone_handler, InMemoryAuthority is now InMemoryZoneHandler and takes an AxfrPolicy instead of a bool (Deny matches the old false), Record exposes dns_class as a public field instead of a setter, and RequestHandler::handle_request gained a Time type parameter that the shared catalog wrapper passes through. The zone contents and serving behavior are unchanged. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Mcy6SZHB23ewuDivM6uAUi --- Cargo.lock | 119 ++++++++++++++------------------------------- cli/Cargo.toml | 4 +- cli/src/dns_dev.rs | 30 +++++++----- 3 files changed, 57 insertions(+), 96 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b847dc..e1105f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -289,7 +289,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1712,7 +1712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccc2776f0c61eca1ca32528f85548abd1a4be8fb53d1b21c013e4f18da1e7090" dependencies = [ "data-encoding", - "syn 2.0.117", + "syn 1.0.109", ] [[package]] @@ -1722,7 +1722,7 @@ dependencies = [ "async-trait", "clap", "dotenv", - "hickory-proto 0.25.2", + "hickory-proto", "hickory-server", "humantime", "iroh-base", @@ -2542,7 +2542,7 @@ dependencies = [ "libc", "option-ext", "redox_users 0.5.2", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -2783,18 +2783,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "enum-assoc" version = "1.3.0" @@ -2860,7 +2848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -3343,8 +3331,8 @@ dependencies = [ "libc", "log", "rustversion", - "windows-link 0.2.1", - "windows-result 0.4.1", + "windows-link 0.1.3", + "windows-result 0.3.4", ] [[package]] @@ -3787,9 +3775,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hickory-net" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2295ed2f9c31e471e1428a8f88a3f0e1f4b27c15049592138d1eebe9c35b183" +checksum = "c480823ed7c2c5d0f09c41020cb6b7c28029ce60ec42dc942158dcf22f8e0a4d" dependencies = [ "async-trait", "bytes", @@ -3799,7 +3787,7 @@ dependencies = [ "futures-io", "futures-util", "h2", - "hickory-proto 0.26.1", + "hickory-proto", "http 1.4.0", "idna", "ipnet", @@ -3816,44 +3804,19 @@ dependencies = [ [[package]] name = "hickory-proto" -version = "0.25.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna", - "ipnet", - "once_cell", - "rand 0.9.4", - "ring", - "serde", - "thiserror 2.0.18", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "hickory-proto" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", "ipnet", "jni 0.22.4", "once_cell", - "prefix-trie 0.8.4", + "prefix-trie", "rand 0.10.2", "ring", + "serde", "thiserror 2.0.18", "tinyvec", "tracing", @@ -3862,14 +3825,14 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d58d28879ceecde6607729660c2667a081ccdc082e082675042793960f178c" +checksum = "3f3da5255c95d5a716857d54b5b8f4e8d67c3484d3beaaaae2ce25063b3ba981" dependencies = [ "cfg-if", "futures-util", "hickory-net", - "hickory-proto 0.26.1", + "hickory-proto", "ipconfig", "ipnet", "jni 0.22.4", @@ -3890,19 +3853,19 @@ dependencies = [ [[package]] name = "hickory-server" -version = "0.25.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53e5fe811b941c74ee46b8818228bfd2bc2688ba276a0eaeb0f2c95ea3b2585" +checksum = "950c2ad9ba2ad35d6890b725baff91305f65b87d7719a6c6071514dc70f13eeb" dependencies = [ "async-trait", "bytes", "cfg-if", "data-encoding", - "enum-as-inner", "futures-util", - "hickory-proto 0.25.2", + "hickory-net", + "hickory-proto", "ipnet", - "prefix-trie 0.7.0", + "prefix-trie", "serde", "thiserror 2.0.18", "time", @@ -4118,7 +4081,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.3", + "socket2 0.5.10", "system-configuration", "tokio", "tower-layer", @@ -6045,7 +6008,7 @@ dependencies = [ "pin-project-lite", "rustc-hash 2.1.2", "rustls", - "socket2 0.6.3", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tokio-stream", @@ -6090,7 +6053,7 @@ checksum = "3137a52df66c20090a889828d1c655f21f52294cba64e5c4fbb04fc83eee7c8e" dependencies = [ "cfg_aliases", "libc", - "socket2 0.6.3", + "socket2 0.5.10", "tracing", "windows-sys 0.61.2", ] @@ -6114,7 +6077,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -7232,16 +7195,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "prefix-trie" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cf4c7c25f1dd66c76b451e9041a8cfce26e4ca754934fa7aed8d5a59a01d20" -dependencies = [ - "ipnet", - "num-traits", -] - [[package]] name = "prefix-trie" version = "0.8.4" @@ -7456,7 +7409,7 @@ dependencies = [ "quinn-udp", "rustc-hash 2.1.2", "rustls", - "socket2 0.6.3", + "socket2 0.5.10", "thiserror 2.0.18", "tokio", "tracing", @@ -7494,7 +7447,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.3", + "socket2 0.5.10", "tracing", "windows-sys 0.60.2", ] @@ -8109,7 +8062,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -8189,7 +8142,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs 1.0.7", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -8342,7 +8295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -8943,7 +8896,7 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.117", @@ -8966,7 +8919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -9304,7 +9257,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] @@ -10424,7 +10377,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.59.0", ] [[package]] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 51d3ccd..4860934 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -16,8 +16,8 @@ serde.workspace = true serde_yml.workspace = true async-trait = "0.1.89" humantime = "2.1.0" -hickory-server = "0.25.2" -hickory-proto = "0.25.2" +hickory-server = "0.26.3" +hickory-proto = "0.26.3" iroh-base.workspace = true z32 = "1.0.3" rand.workspace = true diff --git a/cli/src/dns_dev.rs b/cli/src/dns_dev.rs index 80e34d2..1b84f49 100644 --- a/cli/src/dns_dev.rs +++ b/cli/src/dns_dev.rs @@ -11,9 +11,9 @@ use hickory_proto::rr::{ rdata::{NS, SOA, TXT}, }; use hickory_server::{ - ServerFuture, - authority::{Catalog, ZoneType}, - store::in_memory::InMemoryAuthority, + Server, + store::in_memory::InMemoryZoneHandler, + zone_handler::{AxfrPolicy, Catalog, ZoneType}, }; use iroh_base::EndpointId; use n0_error::StdResultExt; @@ -49,7 +49,7 @@ pub async fn serve( let catalog = ArcCatalog::new(build_catalog(&config_path, &origin)?); let handler = SharedCatalog::new(catalog.clone()); - let mut server = ServerFuture::new(handler); + let mut server = Server::new(handler); let socket = UdpSocket::bind(bind_addr).await?; server.register_socket(socket); @@ -141,7 +141,8 @@ fn build_catalog(config_path: &PathBuf, fallback_origin: &str) -> n0_error::Resu let origin = normalize_origin(&origin); let zone_name = Name::from_str(&format!("{origin}.")).anyerr()?; - let mut authority = InMemoryAuthority::empty(zone_name.clone(), ZoneType::Primary, false); + let mut authority: InMemoryZoneHandler = + InMemoryZoneHandler::empty(zone_name.clone(), ZoneType::Primary, AxfrPolicy::Deny); let serial = 1; let ttl = 30; @@ -149,11 +150,11 @@ fn build_catalog(config_path: &PathBuf, fallback_origin: &str) -> n0_error::Resu let rname = Name::from_str(&format!("admin.{origin}.")).anyerr()?; let soa = SOA::new(mname.clone(), rname, serial, 60, 60, 60, 30); let mut soa_record = Record::from_rdata(zone_name.clone(), ttl, RData::SOA(soa)); - soa_record.set_dns_class(DNSClass::IN); + soa_record.dns_class = DNSClass::IN; authority.upsert_mut(soa_record, serial); let mut ns_record = Record::from_rdata(zone_name.clone(), ttl, RData::NS(NS(mname))); - ns_record.set_dns_class(DNSClass::IN); + ns_record.dns_class = DNSClass::IN; authority.upsert_mut(ns_record, serial); for record in config.records { @@ -179,7 +180,7 @@ fn build_catalog(config_path: &PathBuf, fallback_origin: &str) -> n0_error::Resu } let txt = TXT::new(txt_entries); let mut txt_record = Record::from_rdata(name, ttl, RData::TXT(txt)); - txt_record.set_dns_class(DNSClass::IN); + txt_record.dns_class = DNSClass::IN; authority.upsert_mut(txt_record, serial); } @@ -224,13 +225,20 @@ impl SharedCatalog { #[async_trait::async_trait] impl hickory_server::server::RequestHandler for SharedCatalog { - async fn handle_request( + async fn handle_request< + R: hickory_server::server::ResponseHandler, + T: hickory_server::net::runtime::Time, + >( &self, request: &hickory_server::server::Request, response_handle: R, ) -> hickory_server::server::ResponseInfo { let catalog = self.inner.inner.read().await; - hickory_server::server::RequestHandler::handle_request(&*catalog, request, response_handle) - .await + hickory_server::server::RequestHandler::handle_request::( + &*catalog, + request, + response_handle, + ) + .await } }