p2p: DNSSEC validation result ignored for DNS seed node lookups
Related file(s): src/p2p/net_node.inl
Hello,
The function get_dns_seed_nodes which is used to initialize the p2p network currently ignores whether or not the DNS response for seed nodes was cryptographically verified, i.e., whether or not it was DNSSEC poisoned.
At the moment, the function captures two values from get_ipv4; avail and valid. avail provides the information on whether or not the resolver even supports DNSSEC at all, and valid provides the information of whether the provided records actually passed that verification. However, at the moment, these two values actually remain ignored. There is actually a comment above this part of the code reading: // TODO: care about dnssec avail/valid
I opened an issue regarding this first because I would like some input before touching a file that hasn't been touched in years, and I would also be more than happy to implement a possible fix.
At the moment, I'm not too sure what caring would mean? Heres a few suggestions I have come up with:
- Simply logging a warning whenever
avail = trueandvalid = falseto warn that the resolver supported DNSSEC but the records failed. - Same as above, but instead of just logging a warning, rejecting the results entirely and falling back to the hardcoded IP addresses that are used for e.g. when monerod is run with the testnet.
- Even warning when
avail = falseto say that DNSSEC is not supported. - Adding some type of flag, e.g.
--require-dnssec, that lets the user opt into the previously mentioned behaviour at all.
I would very much appreciate the opportunity to work on the fix and would welcome input from maintainers on which approach if any is preferred before I write the code, so I don't end up going in the wrong direction.
Thank you for your help, Maroof
Source: monero-project/monero