mirror of
https://github.com/chatmail/relay.git
synced 2026-08-10 10:30:51 +00:00
fix: ignore CNAME records when resolving TXT records (#177)
This commit is contained in:
@@ -95,6 +95,12 @@ impl LookupTxt for CachedResolver {
|
||||
lookup
|
||||
.answers()
|
||||
.iter()
|
||||
.filter(|record| {
|
||||
// Select only TXT records.
|
||||
// When resolving TXT query, CNAMEs are also returned as answers.
|
||||
// We want to filter out CNAMEs first.
|
||||
matches!(record.data, hickory_resolver::proto::rr::RData::TXT(_))
|
||||
})
|
||||
// We don't check all records, as this can be a DoS attack vector.
|
||||
// In theory, selector domains should only have a single TXT record.
|
||||
// In practice, we check at most 3, just in case of weird configuration.
|
||||
|
||||
Reference in New Issue
Block a user