DNS dampening: Slowing attacks, keeping resolvers alive

Summary

In September 2012 Lutz Donnerhacke tests a home-made BIND patch that scores DNS queries with penalty points and temporarily ignores conspicuous sources. The measurements bring surprises: internal check scripts triggered the dampening, and a missing minus sign made penalty points grow exponentially instead of decaying. After the fixes, the patch detected attacks within about 40 packets without disturbing normal queries.

What it was about

In 2012 attackers abused open and authoritative name servers for amplification attacks: a small query with a forged source address, for example of type ANY, produces a large response to the victim. In Lutz Donnerhacke's statistics, ANY ranks second behind A with 56,926 queries. Dampening is meant to slow such sources down without shutting the name server off for everyone else.

The solution that prevailed follows a similar idea. Response Rate Limiting (RRL) limits identical responses to the same client with a credit scheme; ISC ships it from BIND 9.10 onwards, while for BIND 9.9 it had to be enabled explicitly at build time. Since 2019, RFC 8482 also allows ANY queries to be answered minimally.

What the measurements taught

Lutz Donnerhacke exempts local networks from dampening: assuming forged senders there means distrusting one's own network. The open questions at the end are still the right ones, such as what happens when an attacker forges the address of a large provider's resolver.

Ideas

  • Dampening collects penalty points per source and temporarily suppresses conspicuous queries.
  • Early publication uncovered a serious bug in heap management.
  • Internal consistency checks can look like attack traffic.
  • Local networks belong on an exception list.
  • Penalty points must decay over time.
  • Fixed resource limits kept a programming error from bringing the server down.

Insights

  • Defence logic without production data easily becomes an availability problem itself.
  • A wrong algorithm can still be useful as an unplanned load test.
  • Source-based blocking also hits bystanders when senders are forged.

Quotes

  • Release often, release early (Lutz Donnerhacke)

Facts

  • The patch was based on BIND 9.9.1-P3 and intervened directly in the query path.
  • An internal check script generated about 40,000 queries within a few minutes.
  • In the statistics, 165,976 A queries were followed by 56,926 of type ANY.
  • ISC ships Response Rate Limiting as a standard feature from BIND 9.10.
  • RFC 8482 from 2019 allows minimal responses to ANY queries.

References

Remarks

  • The post documents its own programming errors as openly as the fixes.

Recommendations

  • Enable Response Rate Limiting on authoritative name servers.
  • Explicitly exempt internal monitoring and check systems from rate limits.
  • Give the state tables of defence mechanisms a fixed size.

Read the original article

Search the Web Archive

Found a mistake or have something to add? Get in touch.