Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent AXFR over UDP #4450

Closed
chantra opened this issue Feb 4, 2021 · 1 comment · Fixed by #4452
Closed

Prevent AXFR over UDP #4450

chantra opened this issue Feb 4, 2021 · 1 comment · Fixed by #4452
Labels

Comments

@chantra
Copy link
Contributor

chantra commented Feb 4, 2021

What happened: When sending an AXFR request over UDP (which typical clients like dig prevents you from doing), CoreDNS will happily reply over UDP, which has the potential of generating big payloads and used as an amplification vector.

What you expected to happen: AXFR to be limited in size and force TC or possibly return NOTIMPL (like root AXFR server do for instance)

How to reproduce it (as minimally and precisely as possible):

Using a modified miekg/exdns 's q.o

Running:

./coredns -dns.port=1053

With a Corefile:

$ cat Corefile
. {
 file somezonefile
    log
 transfer {
    to *
 }
}

using the modified q.go:

$ go run q.go -port 1053   @::1  AXFR

we can see that CoreDNS would reply to the AXFR request over UDP.
Anything else we need to know?:

Environment:

  • the version of CoreDNS:
CoreDNS-1.8.1
linux/amd64, go1.14.7, 03812bb1

  • Corefile:
. {
 file somezonefile
    log
 transfer {
    to *
 }
}
  • OS (e.g: cat /etc/os-release):
    Ubuntu 20.10
@chantra chantra added the bug label Feb 4, 2021
miekg added a commit that referenced this issue Feb 5, 2021
Return refused when the query comes in over udp.
No need to add a new test case as the current crop needed to be changed
to use TCP.

Fixes: #4450

Signed-off-by: Miek Gieben <[email protected]>
miekg added a commit that referenced this issue Feb 5, 2021
* plugin/transfer: only allow outgoing axfr over tcp

Return refused when the query comes in over udp.
No need to add a new test case as the current crop needed to be changed
to use TCP.

Fixes: #4450

Signed-off-by: Miek Gieben <[email protected]>

* transfer tests: this needs tcp as well

Signed-off-by: Miek Gieben <[email protected]>
@SuperQ
Copy link
Collaborator

SuperQ commented Feb 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants