mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-30 00:01:16 +00:00
The response parser only checked the transaction ID, the QR bit, the presence of a question, and the RCODE. It then took the queried name from the response's own question section, so a forged reply that guessed the 16-bit ID and supplied its own question could have its answers accepted for an arbitrary name. CNAME-following decisions were taken on a packet whose ID was never verified, since only the final hop was checked. Validate every hop in send_query_following_cnames: check_response now takes the queried name and type and rejects any response whose single question does not echo them, alongside the existing ID, QR, and RCODE checks. The parse_* functions become pure extractors that run on an already-validated response, anchoring CNAME resolution on the verified question.
iroh-dns
DNS-based endpoint discovery for Iroh.
This crate contains the core types for publishing and resolving iroh endpoint information via DNS, using the pkarr signed packet format.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.