mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 11:45:33 -04:00
Core: Propagate TSIG status in DoQ transport (#7947)
This PR nsure DoQ writer preserves and returns TSIG verification status, preventing authentication bypass on DNS-over-QUIC. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -224,6 +224,14 @@ func (s *ServerQUIC) serveQUICStream(stream *quic.Stream, conn *quic.Conn) {
|
||||
Msg: req,
|
||||
}
|
||||
|
||||
if tsig := req.IsTsig(); tsig != nil {
|
||||
if s.tsigSecret == nil {
|
||||
w.tsigStatus = dns.ErrSecret
|
||||
} else if _, ok := s.tsigSecret[tsig.Hdr.Name]; !ok {
|
||||
w.tsigStatus = dns.ErrSecret
|
||||
}
|
||||
}
|
||||
|
||||
dnsCtx := context.WithValue(stream.Context(), Key{}, s.Server)
|
||||
dnsCtx = context.WithValue(dnsCtx, LoopKey{}, 0)
|
||||
s.ServeDNS(dnsCtx, w, req)
|
||||
|
||||
Reference in New Issue
Block a user