Designate mDNS DoS through incorrect handling of large RecordSets
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Designate |
Fix Released
|
Critical
|
Kiall Mac Innes | ||
Kilo |
Fix Committed
|
Critical
|
Kiall Mac Innes | ||
designate (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Designate does not enforce the DNS protocol limit concerning record set sizes when adding records for a domain name. The protocol limit is slightly less than 2**16 bytes because of some data that must accompany any record set, as part of the zone file transfer.
As a result, the rendering loop in desginate-mdns can does not make progress because the problematic record set at rrsets[i] will never fit (per designate/
# Render the results, yielding a packet after each TooBig exception.
i, renderer = 0, None
while i < len(rrsets):
# No renderer? Build one
if renderer is None:
…
try:
i += 1
except dns.exception.
if request.had_tsig:
…
When this happens, designate-mdns will keep sending SOA records over and over again:
sendto(37, "\0\35<
sendto(37, "\0\35<
sendto(37, "\0\35<
Here is how I triggered this. I created a domain example.org:
+------
| id | name | serial |
+------
| ded903fc-
+------
Then I added several hundred NS records for the same subdomain, using this shell command:
for x in {1..304} ; do
designate record-create --name 'sub.example.org.' --type NS --data \
$x'.xxxxxxxxxxx
ded903fc-
done
In the tested configuration, PowerDNS will attempt a zone file transfer, and trigger the bug. Because it keeps receiving data, it does not seem it will ever run into a timeout (and if it does, it will try again).
Downstream bug report: https:/
no longer affects: | designate/kilo |
Changed in designate: | |
status: | New → Triaged |
importance: | Undecided → Critical |
milestone: | none → liberty-2 |
Changed in designate: | |
assignee: | nobody → Kiall Mac Innes (kiall) |
summary: |
- Lack of record set size checking leads to denial of service + Designate mDNS DoS through incorrect handling of large RecordSets |
Changed in designate: | |
status: | Triaged → In Progress |
information type: | Private Security → Public Security |
Changed in designate: | |
status: | Fix Committed → Fix Released |
Changed in designate (Ubuntu): | |
status: | New → Confirmed |
Changed in designate (Ubuntu): | |
status: | Confirmed → Fix Released |
Changed in designate: | |
milestone: | liberty-2 → 1.0.0 |
Attached a patch providing an initial candidate fix, based off master.
Tests are passing, but this has not yet been validated with BIND/PowerDNS etc