mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-26 03:35:52 +03:00
[GH-ISSUE #2415] CAA RDATA should hold invalid issuer names as-is #983
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#983
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @divergentdave on GitHub (Sep 3, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2415
Is your feature request related to a problem? Please describe.
I set up an environment with Unbound serving
hickory-dns.testing. 86400 IN CAA 0 issue "%%%%%"for a zone, and with Hickory DNS acting as a recursive resolver. This record is based on an example in this figure from the CAA RFC. If I request the CAA record from the Unbound authoritative server, I get it back as-is in the answer section. If I request the same thing from the resolver, I get back an empty answer section, with a status ofNOERROR, after five seconds. Hickory's logs include a line saying that it dropped a malformed response message, due to a "Label contains invalid characters" error. This is a problem because CAs are supposed to treat this invalid issue-value "the same as one specifying an empty issuer-domain-name", and refuse to issue certificates for whatever zone holds this CAA record. Returning a NOERROR message with no CAA records would result in a CA relying on this response to instead allow certificate issuance.Describe the solution you'd like
This could be addressed by adding an enum somewhere in the internal representation of this RDATA to hold uninterpreted bytes, if they do not match the ABNF syntax. This would keep the proto layer from returning an error when parsing a response message, and allow sending the same record, with an invalid issuer name, back to the original client. This would also provide a way to address the
\.\.problem identified in #2353, though that would require using stricter checks than those inName::parse()to trigger using the invalid variant.Describe alternatives you've considered
Alternately, the recursor (and the stub resolver) could skip parsing any RDATA types that are not relevant to recursive resolution or DNSSEC validation, and carry
CAA,TXT,SVCB,HTTPS, etc. around as vectors of bytes. I think this would require a recursor-specific alternative to thehickory_proto::rr::RDataenum. This would simplify the data path for a lot of the more complicated record types, and make many potential recursor/resolver correctness bugs impossible.Consumers using the
hickory_protoorhickory_clientcrates directly would still be affected by the above inability to parse records with certain invalid issuer names, so it may make sense to make both changes.@djc commented on GitHub (Sep 4, 2024):
So what would a response "specifying an empty issuer-domain-name" look like, and would it make more sense to synthesize that instead?
This seems interesting but also (if I understand correctly) potentially a large change? I think you're suggesting to decouple the proto-layer transferring of these record types from "higher-level" knowledge on how to parse these, right, and moving the parsing out to the outer edges of the API?
@marcus0x62, @bluejekyll any thoughts?
@divergentdave commented on GitHub (Sep 4, 2024):
The typical way is with
example.com CAA 0 issue ";". I think it would generally be better to pass records through as-is, rather than try to transform them, for LangSec reasons.Yeah, that would be a big change. Deferring parsing would be one way to do it. Alternately if
hickory_clientwas generic over the record type or record data type, then we could swap in an enum that parses relevant record types and leaves others uninterpreted.@divergentdave commented on GitHub (Sep 4, 2024):
Actually, we already have
Value::Unknown, using that with the known property tags would provide a more comprehensive fallback. This would also address cases where, say, the issuer name is valid, but issuer parameters are encoded incorrectly.@marcus0x62 commented on GitHub (Sep 4, 2024):
Yeah, I deleted my last message when I saw this record is already wrapped in an enum with an Unknown variant. Leaving the error propagation in read_issuer but wrapping the call in read_value like so:
seems to do the trick without adding any extra complexity to the valid-issuer case.