RFC 5358

Preventing Use of Recursive Nameservers in Reflector Attacks

πŸ“… published October 2008, from ietf

Preventing Use of Recursive Nameservers in Reflector Attacks πŸŽ€

Part 1 of 2 πŸ’– Sections 5 through 7 plus the Authors' Addresses are coming next!

Okay bestie, let's talk about RFC 5358 🫢 It's a Best Current Practice, so it's BCP 140, and it lives in the Network Working Group stream. Joao Damas from ISC (Internet Systems Consortium) and Frederico A. C. Neves from Registro.br wrote it, and it was published in October 2008. It doesn't have an Obsoletes or Updates line, so it isn't replacing or changing any other RFC. Iconic, right? πŸ’…

Status of This Memo ✨

This is a Best Current Practice for the Internet Community 🌈 It literally asks for discussion and suggestions for improvements, and it can be distributed without limits.

Abstract πŸ¦‹

This doc explains how to stop default-configured recursive nameservers from being used as reflectors in Denial of Service (DoS) attacks. It also gives recommended configurations to help mitigate the attack πŸ”₯

Table of Contents 🌸

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . 2
   2.  Document Terminology  . . . . . . . . . . . . . . . . . . . . . 2
   3.  Problem Description . . . . . . . . . . . . . . . . . . . . . . 2
   4.  Recommended Configuration . . . . . . . . . . . . . . . . . . . 4
   5.  Security Considerations . . . . . . . . . . . . . . . . . . . . 5
   6.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 5
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . . . 5
     7.1.  Normative References  . . . . . . . . . . . . . . . . . . . 5
     7.2.  Informative References  . . . . . . . . . . . . . . . . . . 6

1. Introduction 🧚

Lowkey the DNS [RFC1034] got main character energy in DoS attacks. It became a major factor in generating massive amounts of network traffic for these attacks 😭 These are called reflector attacks, and they aren't caused by any particular flaw in the design of the DNS or its implementations. The real issue is that DNS relies heavily on UDP, and UDP is easy to abuse. The attacks mostly used DNS because of common default configurations that make it easy to use open recursive nameservers running that default setup πŸ’€

On top of that, DNS has a small-query, large-response vibe. That makes it super easy to amplify the source traffic into reflected traffic aimed at the victims πŸ”₯

Authoritative DNS servers that don't offer recursion to clients can be used as amplifiers too. Their amplification potential is much smaller, though. It's also not practical to restrict access to authoritative servers to a subset of the Internet, since they need to serve a wide audience to work normally. So there aren't many ways to shrink an attack by changing authoritative server configurations πŸ™ˆ This document focuses on recursive nameservers only.

In this doc we break down how the attack works and recommend DNS server configurations that specifically ease the problem. We also point to the only real solution: wide-scale deployment of ingress filtering to prevent the use of spoofed IP addresses [BCP38]. πŸ’–

2. Document Terminology πŸ’œ

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. These are the official BCP 14 key words, so they keep their exact meaning everywhere they show up πŸŽ€

3. Problem Description 🌈

Because most DNS traffic is stateless by design, an attacker could start a DoS attack like this πŸ‘€

  1. The attacker starts by configuring a record on any zone he has access to, normally with large RDATA and Time to Live (TTL).
  2. Taking advantage of clients on non-BCP38 networks, the attacker then crafts a query using the source address of their target victim and sends it to an open recursive nameserver.
  3. Each open recursive nameserver proceeds with the resolution, caches the record, and finally sends it to the target. After this first lookup, access to the authoritative nameservers is normally no longer necessary. The record will remain cached at the open recursive nameserver for the duration of the TTL, even if it's deleted from the zone.
  4. Cleanup of the zone might, depending on the implementation used in the open recursive nameserver, afford a way to clean the cached record from the open recursive nameserver. This would possibly involve queries luring the open recursive nameserver to lookup information for the same name that is being used in the amplification.

Because the characteristics of the attack normally involve a low volume of packets amongst all the kinds of actors besides the victim, it's unlikely any one of them would notice their involvement based on traffic pattern changes. Sneaky, right? πŸ™ˆ

Taking advantage of an open recursive nameserver that supports EDNS0 [RFC2671], the amplification factor (response packet size / query packet size) could be around 80. 😱 With this amplification factor, a relatively small army of clients and open recursive nameservers could generate gigabits of traffic towards the victim πŸ’₯

With the increasing length of authoritative DNS responses derived from deployment of DNSSEC [RFC4033] and NAPTR resource records as used in ENUM services, authoritative servers will eventually be more useful as actors in this sort of amplification attack. Not great, bestie πŸ’€

Even if this amplification attack is only possible due to non-deployment of BCP38, it is easier to leverage because of historical reasons. Back when the Internet was a much closer-knit community, some nameserver implementations shipped with default configurations that, when used for recursive nameservers, made the server accessible to all hosts on the Internet πŸ•°οΈ

For years this was a convenient and helpful configuration, enabling wider availability of services. But as this document aims to make apparent, it is now much better to be conscious of one's own nameserver services and focus the delivery of services on the intended audience of those services. That audience might be a university campus, an enterprise, or an ISP's customers πŸŽ“ The target audience also includes operators of small networks and private server managers who decide to operate nameservers with the aim of optimising their DNS service, as these are more likely to use default configurations as shipped by implementors. 🧚

In this section we describe the Best Current Practice for operating recursive nameservers. Following these recommendations would reduce the chances of any given recursive nameserver being used for the generation of an amplification attack. Serve that main character energy responsibly 🫢

The generic recommendation to nameserver operators is to use the means provided by the implementation of choice to provide recursive name lookup service to only the intended clients. Client authorization can usually be done in several ways:

  • IP address based authorization. Use the IP source address of the DNS queries and filter them through an Access Control List (ACL) to service only the intended clients. This is easily applied if the recursive nameserver's service area is a reasonably fixed IP address range that is protected against external address spoofing, usually the local network.
  • Incoming interface based selection. Use the incoming interface for the query as a discriminator to select which clients are to be served. This is of particular applicability for SOHO (Small Office, Home Office) devices, such as broadband routers that include embedded recursive nameservers. 🏠
  • TSIG [RFC2845] or SIG(0) [RFC2931] signed queries to authenticate the clients. This is a less error prone method that allows server operators to provide service to clients who change IP address frequently (e.g., roaming clients). The current drawback of this method is that very few stub resolver implementations support TSIG or SIG(0) signing of outgoing queries. The effective use of this method implies, in most cases, running a local instance of a caching nameserver or forwarder that will be able to TSIG sign the queries and send them on to the recursive nameserver of choice. πŸ”
  • For mobile users, use a local caching nameserver running on the mobile device or use a Virtual Private Network to a trusted server. πŸ“±

In nameservers that do not need to be providing recursive service, for instance servers that are meant to be authoritative only, turn recursion off completely. In general, it is a good idea to keep recursive and authoritative services separate as much as practical. This, of course, depends on local circumstances. 🌸

Even with all these recommendations, network operators should consider deployment of ingress filtering [BCP38] in routers to prevent use of address spoofing as a viable course of action. In situations where more complex network setups are in place, "Ingress Filtering for Multihomed Network" [BCP84] maybe a useful additional reference. πŸ¦‹

By default, nameservers SHOULD NOT offer recursive service to external networks. 🚫

Part 1 wrap-up: we covered the title block, Status, Abstract, TOC, and Sections 1 through 4 πŸ’œ

Okay so the legal part is actually kinda iconic πŸ’… Copyright (C) The IETF Trust (2008) πŸŽ€. Everything here is subject to the rights, licenses, and restrictions in BCP 78, and except for what BCP 78 says, the authors keep all their rights πŸ¦‹.

This document and the info in it are given to you "AS IS" 🫢. THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE say they're NOT giving any warranties, express or implied 😭. That includes no promise that using the info won't infringe anyone's rights, and no implied warranties of merchantability or fitness for a particular purpose πŸ’€.

Intellectual Property

Not gonna lie, this part is a whole vibe 🌸. The IETF doesn't take a side on whether any Intellectual Property Rights or other rights that someone might claim over the tech in this document are valid or in scope 🧚. It also doesn't say whether anyone can get a license for them. And it hasn't done its own search for any such rights either πŸ™ˆ. If you want the rules for rights in RFC documents, check out BCP 78 and BCP 79 πŸ“š.

Copies of IPR disclosures sent to the IETF Secretariat are a thing, and so are any assurances of licenses that might be offered, or the results of trying to get a general license or permission for implementers or users to use proprietary rights πŸ“. You can find all of that in the IETF online IPR repository at http://www.ietf.org/ipr ✨.

The IETF also invites anyone to tell it about any copyrights, patents, patent applications, or other proprietary rights that might cover tech needed to implement this standard πŸ’–. Send that info to the IETF at ietf-ipr@ietf.org πŸ’Œ.

That's the whole legal section, bestie πŸ‘‘ ✨

πŸ“¦ where this page comes from