draft-ietf-dnsext-forgery-resilience-05.txt   draft-ietf-dnsext-forgery-resilience-06.txt 
DNS Extensions (DNSEXT) A. Hubert DNS Extensions (DNSEXT) A. Hubert
Internet-Draft Netherlabs Computer Consulting BV. Internet-Draft Netherlabs Computer Consulting BV.
Updates: 1034 (if approved) R. van Mook Updates: 2181 (if approved) R. van Mook
Intended status: Standards Track Virtu Intended status: Standards Track Equinix
Expires: December 28, 2008 June 26, 2008 Expires: January 31, 2009 July 30, 2008
Measures for making DNS more resilient against forged answers Measures for making DNS more resilient against forged answers
draft-ietf-dnsext-forgery-resilience-05.txt draft-ietf-dnsext-forgery-resilience-06.txt
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
skipping to change at page 1, line 35 skipping to change at page 1, line 35
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on December 28, 2008. This Internet-Draft will expire on January 31, 2009.
Abstract Abstract
The current Internet climate poses serious threats to the Domain Name The current Internet climate poses serious threats to the Domain Name
System. In the interim period before the DNS protocol can be secured System. In the interim period before the DNS protocol can be secured
more fully, measures can already be taken to harden the DNS to make more fully, measures can already be taken to harden the DNS to make
'spoofing' a recursing nameserver many orders of magnitude harder. 'spoofing' a recursing nameserver many orders of magnitude harder.
Even a cryptographically secured DNS benefits from having the ability Even a cryptographically secured DNS benefits from having the ability
to discard bogus responses quickly, as this potentially saves large to discard bogus responses quickly, as this potentially saves large
amounts of computation. amounts of computation.
By describing certain behaviour that has previously not been By describing certain behaviour that has previously not been
standardised, this document sets out how to make the DNS more standardised, this document sets out how to make the DNS more
resilient against accepting incorrect responses. This document resilient against accepting incorrect responses. This document
updates RFC 1034. updates RFC 1034.
Table of Contents Table of Contents
1. Requirements and definitions . . . . . . . . . . . . . . . . . 3 1. Requirements and definitions . . . . . . . . . . . . . . . . . 4
1.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 4
1.2. Key words . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Key words . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5
3. Description of DNS spoofing . . . . . . . . . . . . . . . . . 6 3. Description of DNS spoofing . . . . . . . . . . . . . . . . . 7
4. Detailed Description of Spoofing Scenarios . . . . . . . . . . 7 4. Detailed Description of Spoofing Scenarios . . . . . . . . . . 8
4.1. Forcing a question . . . . . . . . . . . . . . . . . . . . 7 4.1. Forcing a query . . . . . . . . . . . . . . . . . . . . . 8
4.2. Matching the question section . . . . . . . . . . . . . . 8 4.2. Matching the question section . . . . . . . . . . . . . . 9
4.3. Matching the ID field . . . . . . . . . . . . . . . . . . 8 4.3. Matching the ID field . . . . . . . . . . . . . . . . . . 9
4.4. Matching the source address of the authentic response . . 8 4.4. Matching the source address of the authentic response . . 9
4.5. Matching the destination address and port of the 4.5. Matching the destination address and port of the
authentic response . . . . . . . . . . . . . . . . . . . . 8 authentic response . . . . . . . . . . . . . . . . . . . . 9
4.6. Have the response arrive before the authentic response . . 9 4.6. Have the response arrive before the authentic response . . 10
5. Birthday attacks . . . . . . . . . . . . . . . . . . . . . . . 10 5. Birthday attacks . . . . . . . . . . . . . . . . . . . . . . . 11
6. Accepting only in-zone records . . . . . . . . . . . . . . . . 11 6. Accepting only in-domain records . . . . . . . . . . . . . . . 12
7. Combined difficulty . . . . . . . . . . . . . . . . . . . . . 12 7. Combined difficulty . . . . . . . . . . . . . . . . . . . . . 13
7.1. Symbols used in calculation . . . . . . . . . . . . . . . 12 7.1. Symbols used in calculation . . . . . . . . . . . . . . . 13
7.2. Calculation . . . . . . . . . . . . . . . . . . . . . . . 13 7.2. Calculation . . . . . . . . . . . . . . . . . . . . . . . 14
8. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 15 8. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9. Recommended Countermeasures . . . . . . . . . . . . . . . . . 16 9. Forgery countermeasures . . . . . . . . . . . . . . . . . . . 17
10. Security Considerations . . . . . . . . . . . . . . . . . . . 18 9.1. Query matching rules . . . . . . . . . . . . . . . . . . . 17
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 9.2. Extending the Q-ID space by using ports and addresses . . 17
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 20 9.2.1. Justification and Discussion . . . . . . . . . . . . . 18
13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21 9.3. Spoof detection and countermeasure . . . . . . . . . . . . 18
13.1. Normative References . . . . . . . . . . . . . . . . . . . 21 10. Security Considerations . . . . . . . . . . . . . . . . . . . 19
13.2. Informative References . . . . . . . . . . . . . . . . . . 21 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 21
Intellectual Property and Copyright Statements . . . . . . . . . . 24 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22
13.1. Normative References . . . . . . . . . . . . . . . . . . . 22
13.2. Informative References . . . . . . . . . . . . . . . . . . 22
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 24
Intellectual Property and Copyright Statements . . . . . . . . . . 25
1. Requirements and definitions 1. Requirements and definitions
1.1. Definitions 1.1. Definitions
This document uses the following definitions: This document uses the following definitions:
Client: typically a 'stub-resolver' on an end-user's computer Client: typically a 'stub-resolver' on an end-user's computer
Resolver: a nameserver performing recursive service for clients, Resolver: a nameserver performing recursive service for clients,
skipping to change at page 4, line 9 skipping to change at page 5, line 9
1.2. Key words 1.2. Key words
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
2. Introduction 2. Introduction
This document describes several common problems in DNS This document describes several common problems in DNS
implementations which, although previously recognized, remain largely implementations which, although previously recognized, remain largely
unsolved. Besides briefly recapping these problems, this RFC unsolved. Besides briefly recapping these problems, this document
contains rules that, if implemented, make complying resolvers vastly contains rules that, if implemented, make complying resolvers vastly
more resistant to the attacks described. The goal is to make the more resistant to the attacks described. The goal is to make the
existing DNS as secure as possible within the current protocol existing DNS as secure as possible within the current protocol
boundaries. boundaries.
The words below are aimed at authors of resolvers: it is up to The words below are aimed at authors of resolvers: it is up to
operators to decide which nameserver implementation to use, or which operators to decide which nameserver implementation to use, or which
options to enable. Operational constraints may override the security options to enable. Operational constraints may override the security
concerns described below. However, implementations are expected to concerns described below. However, implementations are expected to
allow an operator to enable functionality described in this document. allow an operator to enable functionality described in this document.
skipping to change at page 5, line 15 skipping to change at page 6, line 15
of existing rules and guidelines embodied in the relevant DNS of existing rules and guidelines embodied in the relevant DNS
protocol specifications. The following also specifies new protocol specifications. The following also specifies new
requirements to make sure the Domain Name System can be relied upon requirements to make sure the Domain Name System can be relied upon
until a more secure protocol has been standardised and deployed. until a more secure protocol has been standardised and deployed.
It should be noted that even when all measures suggested below are It should be noted that even when all measures suggested below are
implemented, protocol users are not protected against third parties implemented, protocol users are not protected against third parties
with the ability to observe, modify or inject packets in the traffic with the ability to observe, modify or inject packets in the traffic
of a resolver. of a resolver.
For protocol extensions under development that offer protection For protocol extensions that offer protection against these
against these scenarios, see [RFC4033] and beyond. scenarios, see [RFC4033] and beyond.
3. Description of DNS spoofing 3. Description of DNS spoofing
When certain steps are taken it is feasible to 'spoof' the current When certain steps are taken it is feasible to 'spoof' the current
deployed majority of resolvers with carefully crafted and timed DNS deployed majority of resolvers with carefully crafted and timed DNS
packets. Once spoofed, a caching server will repeat the data it packets. Once spoofed, a caching server will repeat the data it
wrongfully accepted, and make its clients contact the wrong, and wrongfully accepted, and make its clients contact the wrong, and
possibly malicious, servers. possibly malicious, servers.
To understand how this process works it is important to know what To understand how this process works it is important to know what
skipping to change at page 7, line 15 skipping to change at page 8, line 15
4. Detailed Description of Spoofing Scenarios 4. Detailed Description of Spoofing Scenarios
The previous paragraph discussed a number of requirements an attacker The previous paragraph discussed a number of requirements an attacker
must match in order to spoof in manipulated (or fake) data. This must match in order to spoof in manipulated (or fake) data. This
section discusses the relative difficulties and how implementation section discusses the relative difficulties and how implementation
defined choices impact the amount of work an attacker has to perform defined choices impact the amount of work an attacker has to perform
to meet said difficulties. to meet said difficulties.
Some more details can be found in section 2.2 of [RFC3833]. Some more details can be found in section 2.2 of [RFC3833].
4.1. Forcing a question 4.1. Forcing a query
Formally, there is no need for a nameserver to perform service except Formally, there is no need for a nameserver to perform service except
for its operator, its customers or more generally its users. for its operator, its customers or more generally its users.
Recently, open recursing nameservers have been used to amplify denial Recently, open recursing nameservers have been used to amplify denial
of service attacks. of service attacks.
Providing full service enables the third party to send the target Providing full service enables the third party to send the target
resolver a question for the domain name it intends to spoof. On resolver a query for the domain name it intends to spoof. On
receiving this question, and not finding the answer in its cache, the receiving this query, and not finding the answer in its cache, the
resolver will transmit queries to relevant authoritative nameservers. resolver will transmit queries to relevant authoritative nameservers.
This opens up a window of opportunity for getting fake answer data This opens up a window of opportunity for getting fake answer data
accepted. accepted.
Queries may however be forced indirectly, for example by inducing a Queries may however be forced indirectly, for example by inducing a
mail server to perform DNS lookups. mail server to perform DNS lookups.
Some operators restrict access by not recursing for unauthorised IP Some operators restrict access by not recursing for unauthorised IP
addresses, but only respond with data from the cache. This makes addresses, but only respond with data from the cache. This makes
spoofing harder for a third party as it cannot then force the exact spoofing harder for a third party as it cannot then force the exact
moment a question will be asked. It is still possible however to moment a question will be asked. It is still possible however to
determine a time range when this will happen, because nameservers determine a time range when this will happen, because nameservers
helpfully publish the decreasing TTL of entries in the cache, which helpfully publish the decreasing TTL of entries in the cache, which
indicate from which absolute time onwards a new query could be sent indicate from which absolute time onwards a new query could be sent
to refresh the expired entry. to refresh the expired entry.
The time to live of the target domain name's RRSETs determines how The time to live of the target domain name's RRSets determines how
often a window of opportunity is available, which implies that a often a window of opportunity is available, which implies that a
short TTL makes spoofing far more viable. short TTL makes spoofing far more viable.
Note that the attacker might very well have authorised access to the Note that the attacker might very well have authorised access to the
target resolver by virtue of being a customer or employee of its target resolver by virtue of being a customer or employee of its
operator. In addition, access may be enabled through the use of operator. In addition, access may be enabled through the use of
reflectors as outlined in [I-D.ietf-dnsop-reflectors-are-evil]. reflectors as outlined in [I-D.ietf-dnsop-reflectors-are-evil].
4.2. Matching the question section 4.2. Matching the question section
skipping to change at page 8, line 51 skipping to change at page 9, line 51
nameserver would originally be queried - the one most likely to nameserver would originally be queried - the one most likely to
respond the quickest. respond the quickest.
Generally, this condition requires at most two or three attempts Generally, this condition requires at most two or three attempts
before it is matched. before it is matched.
4.5. Matching the destination address and port of the authentic 4.5. Matching the destination address and port of the authentic
response response
Note that the destination address of the authentic response is the Note that the destination address of the authentic response is the
source address of the original question. source address of the original query.
The actual address of a recursing nameserver is generally known; the The actual address of a recursing nameserver is generally known; the
port used for asking questions is harder to determine. Most current port used for asking questions is harder to determine. Most current
resolvers pick an arbitrary port at startup (possibly at random) and resolvers pick an arbitrary port at startup (possibly at random) and
use this for all outgoing questions. In quite a number of cases the use this for all outgoing queries. In quite a number of cases the
source port of outgoing questions is fixed at the traditional DNS source port of outgoing questions is fixed at the traditional DNS
assigned server port number of 53. assigned server port number of 53.
If the source port of the original question is random, but static, If the source port of the original query is random, but static, any
any authoritative nameserver under observation by the attacker can be authoritative nameserver under observation by the attacker can be
used to determine this port. This means that matching this used to determine this port. This means that matching this
conditions often requires no guess work. conditions often requires no guess work.
If multiple ports are used for sending questions, this enlarges the If multiple ports are used for sending queries, this enlarges the
effective ID space by a factor equal to the number of ports used. effective ID space by a factor equal to the number of ports used.
Less common resolving servers choose a random port per outgoing Less common resolving servers choose a random port per outgoing
question. If this strategy is followed, this port number can be query. If this strategy is followed, this port number can be
regarded as an additional ID field, again containing up to 16 bits. regarded as an additional ID field, again containing up to 16 bits.
If the maximum ports range is utilized, on average, around 32128 If the maximum ports range is utilized, on average, around 32256
source ports would have to be tried before matching the source port source ports would have to be tried before matching the source port
of the original question as ports below 1024 may be unavailable for of the original query as ports below 1024 may be unavailable for use,
use, leaving 64512 options. leaving 64512 options.
It should be noted that a firewall will not prevent the matching of It should be noted that a firewall will not prevent the matching of
this address, as it will accept answers that (appear) to come from this address, as it will accept answers that (appear) to come from
the correct address, offering no additional security. the correct address, offering no additional security.
4.6. Have the response arrive before the authentic response 4.6. Have the response arrive before the authentic response
Once any packet has matched the previous four conditions (plus Once any packet has matched the previous four conditions (plus
possible additional conditions), no further responses are generally possible additional conditions), no further responses are generally
accepted. accepted.
skipping to change at page 10, line 12 skipping to change at page 11, line 12
nameservers are (briefly) overloaded by queries, perhaps by the nameservers are (briefly) overloaded by queries, perhaps by the
attacker. attacker.
5. Birthday attacks 5. Birthday attacks
The so called birthday paradox implies that a group of 23 people The so called birthday paradox implies that a group of 23 people
suffices to have a more than even chance of having two or more suffices to have a more than even chance of having two or more
members of the group share a birthday. members of the group share a birthday.
An attacker can benefit from this exact phenomenon if it can force An attacker can benefit from this exact phenomenon if it can force
the target resolver to have multiple equivalent outstanding queries the target resolver to have multiple equivalent (identical QNAME,
at any one time to the same authoritative server. QTYPE and QCLASS) outstanding queries at any one time to the same
authoritative server.
Any packet the attacker sends then has a much higher chance of being Any packet the attacker sends then has a much higher chance of being
accepted because it only has to match any of the outstanding queries accepted because it only has to match any of the outstanding queries
for that single domain. Compared to the birthday analogy above, of for that single domain. Compared to the birthday analogy above, of
the group composed of queries and responses, the chance of having any the group composed of queries and responses, the chance of having any
of these share an ID rises quickly. of these share an ID rises quickly.
As long as small numbers of queries are sent out, the chance of As long as small numbers of queries are sent out, the chance of
successfully spoofing a response rises linearly with the number of successfully spoofing a response rises linearly with the number of
outstanding queries for the exact domain and nameserver. outstanding queries for the exact domain and nameserver.
For larger numbers this effect is less pronounced. For larger numbers this effect is less pronounced.
More details are available in US-CERT [vu-457875]. More details are available in US-CERT [vu-457875].
6. Accepting only in-zone records 6. Accepting only in-domain records
Responses from authoritative nameservers often contain information Responses from authoritative nameservers often contain information
that is not part of the zone for which we deem it authoritative. As that is not part of the zone for which we deem it authoritative. As
an example, a query for the MX record of a domain might get as its an example, a query for the MX record of a domain might get as its
responses a mail exchanger in another domain, and additionally the IP responses a mail exchanger in another domain, and additionally the IP
address of this mail exchanger. address of this mail exchanger.
If accepted uncritically, the resolver stands the chance of accepting If accepted uncritically, the resolver stands the chance of accepting
data from an untrusted source. Care must be taken to only accept data from an untrusted source. Care must be taken to only accept
data if it is known that the originator is authoritative for that data if it is known that the originator is authoritative for the
data. QNAME or a parent of the QNAME.
One very simple way to achieve this is to only accept data if it is One very simple way to achieve this is to only accept data if it is
part of the domain the query was for. part of the domain the query was for.
7. Combined difficulty 7. Combined difficulty
Given a known or static destination port, matching ID field, source Given a known or static destination port, matching ID field, source
and destination address requires on average in the order of 2 * 2^15 and destination address requires on average in the order of 2 * 2^15
= 65000 packets, assuming a domain has 2 authoritative nameservers. = 65000 packets, assuming a zone has 2 authoritative nameservers.
If the window of opportunity available is around 100ms, as assumed If the window of opportunity available is around 100ms, as assumed
above, an attacker would need to be able to briefly transmit 650000 above, an attacker would need to be able to briefly transmit 650000
packets/s to have a 50% chance to get spoofed data accepted on the packets/s to have a 50% chance to get spoofed data accepted on the
first attempt. first attempt.
A realistic minimal DNS response consists of around 80 bytes, A realistic minimal DNS response consists of around 80 bytes,
including IP headers, making the packet rate above correspond to a including IP headers, making the packet rate above correspond to a
respectable burst of 416Mb/s. respectable burst of 416Mb/s.
skipping to change at page 13, line 40 skipping to change at page 14, line 40
It is more useful to reason not in terms of aggregate packets but to It is more useful to reason not in terms of aggregate packets but to
convert to packet rate, which can easily be converted to bandwidth if convert to packet rate, which can easily be converted to bandwidth if
needed. needed.
If the Window of opportunity length is 'W' and the attacker can send If the Window of opportunity length is 'W' and the attacker can send
'R' packets per second, the number of fake packets 'F' that are 'R' packets per second, the number of fake packets 'F' that are
candidates to be accepted is: candidates to be accepted is:
D * R * W D * R * W
F = R * W -> P_s = ---------- F = R * W -> P_s = ---------
N * P * I N * P * I
Finally, to calculate the combined chance 'P_cs' of spoofing over a Finally, to calculate the combined chance 'P_cs' of spoofing over a
chosen time period 'T', it should be realised that the attacker has a chosen time period 'T', it should be realised that the attacker has a
new window of opportunity each time the TTL 'TTL' of the target new window of opportunity each time the TTL 'TTL' of the target
domain expires. This means that the number of attempts 'A' is equal domain expires. This means that the number of attempts 'A' is equal
to 'T / TTL'. to 'T / TTL'.
To calculate the combined chance of at least one success, the To calculate the combined chance of at least one success, the
following formula holds: following formula holds:
skipping to change at page 15, line 8 skipping to change at page 16, line 8
Raising N, the number of authoritative nameservers, is not feasible Raising N, the number of authoritative nameservers, is not feasible
beyond a small number. beyond a small number.
For the degenerate case of a zero-second TTL, a window of opportunity For the degenerate case of a zero-second TTL, a window of opportunity
opens for each query sent, making the effective TTL equal to 'W' opens for each query sent, making the effective TTL equal to 'W'
above, the response time of the authoritative server. above, the response time of the authoritative server.
8. Discussion 8. Discussion
The calculations above indicate the relative ease with which DNS data The calculations above indicate the relative ease with which DNS data
can be spoofed. For example, using the formula derived earlier on a can be spoofed. For example, using the formula derived earlier on an
domain with a 3600 second TTL, an attacker sending 7000 fake response RRSet with a 3600 second TTL, an attacker sending 7000 fake response
packets/s (a rate of 4.5Mb/s), stands a 10% chance of spoofing a packets/s (a rate of 4.5Mb/s), stands a 10% chance of spoofing a
record in the first 24 hours, which rises to 50% after a week. record in the first 24 hours, which rises to 50% after a week.
For a domain with a TTL of 60 seconds, the 10% level is hit after 24 For an RRSet with a TTL of 60 seconds, the 10% level is hit after 24
minutes, 50% after less than 3 hours, 90% after around 9 hours. minutes, 50% after less than 3 hours, 90% after around 9 hours.
Note that the attacks mentioned above can be detected by watchful Note that the attacks mentioned above can be detected by watchful
server operators - an unexpected incoming stream of 4.5mbit/s of server operators - an unexpected incoming stream of 4.5mbit/s of
packets might be noticed. packets might be noticed.
An important assumption however in these calculations is a known or An important assumption however in these calculations is a known or
static destination port of the authentic response. static destination port of the authentic response.
If that port number is unknown and needs to be guessed as well, the If that port number is unknown and needs to be guessed as well, the
problem space expands by a factor of 64000, leading the attacker to problem space expands by a factor of 64000, leading the attacker to
need in excess of 285Gb/s to achieve similar success rates. need in excess of 285Gb/s to achieve similar success rates.
Such bandwidth is not generally available, nor expected to be so in Such bandwidth is not generally available, nor expected to be so in
the foreseeable future. the foreseeable future.
Note that some firewalls may need reconfiguring if they are currently Note that some firewalls may need reconfiguring if they are currently
setup to only allow outgoing queries from a single DNS source port. setup to only allow outgoing queries from a single DNS source port.
9. Recommended Countermeasures 9. Forgery countermeasures
Given the above, a resolver implementation MUST match responses to 9.1. Query matching rules
the following attributes of the query:
o Remote address A resolver implementation MUST match responses to all of the
following attributes of the query:
o Local address o Source address against query destination address
o Query port o Destination address against query source address
o Destination port against query source port
o Query ID o Query ID
o Question name (compared case-insensitively) o Query name
o Question class and type o Query class and type
before applying DNS trustworthiness rules (see [RFC2181], section before applying DNS trustworthiness rules (see [RFC2181], section
5.4.1). More precisely, the response source IP address MUST match 5.4.1).
the query's destination IP address and the response destination IP
address MUST match the query's source IP address. A mismatch should
be considered a format error, and the response invalid.
Resolver implementations MUST have the ability to: A mismatch and the response MUST be considered invalid.
9.2. Extending the Q-ID space by using ports and addresses
Resolver implementations MUST:
o Use an unpredictable source port for outgoing queries from the o Use an unpredictable source port for outgoing queries from the
range (53, or > 1024) of available ports that is as large as range of available ports (53, or 1024 and above) that is as large
possible and practicable; as possible and practicable;
o Use multiple different source ports simultaneously in case of o Use multiple different source ports simultaneously in case of
multiple outstanding queries; multiple outstanding queries;
o Use an unpredictable query ID for outgoing queries, utilizing the o Use an unpredictable query ID for outgoing queries, utilizing the
full range available (0-65535); full range available (0-65535)
Please note that source ports could be selected from a larger range
than indicated, but that this range is regarded as safe, with some
lower port numbers reserved for activities which might conflict with
proper DNS operation.
In case these abilities are enabled, the implementation MUST strive
to have its choices of source port and query ID remain unpredictable,
even if an attacker has knowledge of its (pseudo-)random generator.
If a resolver is multihomed or otherwise has the ability to transmit
and receive datagrams using more than one IP source address, then an
IP address can be chosen at random in order to increase an attacker's
difficulty in guessing what address to flood.
If a resolver sends out multiple equivalent queries to any Resolvers that have multiple IP addresses SHOULD use them in an
authoritative server, before receiving a response, all MUST have unpredictable manner for outgoing queries.
identical ID, source address and source port.
Resolvers SHOULD favour authoritative nameservers with which a trust Resolvers SHOULD favour authoritative nameservers with which a trust
relation has been established; Stub-resolvers SHOULD be able to use relation has been established; Stub-resolvers SHOULD be able to use
TSIG ([RFC2845]) or IPSEC ([RFC4301]) when communicating with their TSIG ([RFC2845]) or IPsec ([RFC4301]) when communicating with their
recursive resolver. recursive resolver
In case a cryptographic verification of response validity is In case a cryptographic verification of response validity is
available, resolver implementations MAY waive above rules, and rely available (TSIG, SIG(0)), resolver implementations MAY waive above
on this guarantee instead. rules, and rely on this guarantee instead.
Proper unpredictability can be achieved by employing a high quality Proper unpredictability can be achieved by employing a high quality
random generator, as described in [RFC4086]. (pseudo-)random generator, as described in [RFC4086].
9.2.1. Justification and Discussion
Since an attacker can force a full DNS resolver to send queries to
the attacker's own name servers, any constant or sequential state
held by such a resolver can be measured, and it must not be trivially
easy to reverse engineer the resolver's internal state in a way that
allows low-cost high-accuracy prediction of future state.
A full DNS resolver with only one or a small number of upstream-
facing endpoints is effectively using constants for IP source address
and UDP port number, and these are very predictable by potential
attackers, and must therefore be avoided.
A full DNS resolver that uses a simple increment to get its next DNS
ID is likewise very predictable and so very spoofable.
Finally, weak random number generators have been shown to expose
their internal state, such that an attacker who witnesses several
sequential "random" values can easily predict the next ones. A
crypto-strength random number generator is one whose output cannot be
predicted no matter how many successive values are witnessed.
9.3. Spoof detection and countermeasure
If a resolver detects that an attempt is being made to spoof it, If a resolver detects that an attempt is being made to spoof it,
perhaps by discovering that many packets fail the criteria as perhaps by discovering that many packets fail the criteria as
outlined above, it MAY abandon the UDP query and re-issue it over outlined above, it MAY abandon the UDP query and re-issue it over
TCP. TCP, by the nature of its use of sequence numbers, is far more TCP. TCP, by the nature of its use of sequence numbers, is far more
resilient against forgery by third parties. resilient against forgery by third parties.
10. Security Considerations 10. Security Considerations
This document provides clarification of the DNS specification to This document provides clarification of the DNS specification to
skipping to change at page 18, line 25 skipping to change at page 19, line 25
available 16 bits. available 16 bits.
A resolver that does not implement the recommendations outlined above A resolver that does not implement the recommendations outlined above
can easily be forced to accept spoofed responses, which in turn are can easily be forced to accept spoofed responses, which in turn are
passed on to client computers - misdirecting (user) traffic to passed on to client computers - misdirecting (user) traffic to
possibly malicious entities. possibly malicious entities.
This document directly impacts the security of the Domain Name This document directly impacts the security of the Domain Name
System, implementers are urged to follow its recommendations. System, implementers are urged to follow its recommendations.
Most security considerations can be found in Section 5, while Most security considerations can be found in Section 4 and Section 5,
proposed countermeasures are described in Section 9. while proposed countermeasures are described in Section 9.
For brevity's sake, in lieu of repeating the security considerations For brevity's sake, in lieu of repeating the security considerations
references, the reader is referred to these sections. references, the reader is referred to these sections.
Nothing in this document specifies specific algorithms for operators Nothing in this document specifies specific algorithms for operators
to use; it does specify algorithms implementations SHOULD or MUST to use; it does specify algorithms implementations SHOULD or MUST
support. support.
The above notwithstanding, it should be noted that using a low Time The above notwithstanding, it should be noted that using a low Time
To Live for DNS records raises the chances of an attacker spoofing a To Live for DNS records raises the chances of an attacker spoofing a
resolver. resolver.
It should be noted that the effects of source port randomization may
be dramatically reduced by NAT devices which either serialize or
limit in volume the UDP source ports used by the querying resolver."
11. IANA Considerations 11. IANA Considerations
This document does not make any assignments and has no actions for This document does not make any assignments and has no actions for
IANA. IANA.
12. Acknowledgements 12. Acknowledgements
Source port randomisation in DNS was first implemented and possibly Source port randomisation in DNS was first implemented and possibly
invented by Dan. J. Bernstein. invented by Dan. J. Bernstein.
skipping to change at page 23, line 7 skipping to change at page 24, line 7
[RFC4301] Kent, S. and K. Seo, "Security Architecture for the [RFC4301] Kent, S. and K. Seo, "Security Architecture for the
Internet Protocol", RFC 4301, December 2005. Internet Protocol", RFC 4301, December 2005.
[vu-457875] [vu-457875]
United States CERT, "Various DNS service implementations United States CERT, "Various DNS service implementations
generate multiple simultaneous queries for the same generate multiple simultaneous queries for the same
resource record", VU 457875, November 2002. resource record", VU 457875, November 2002.
Authors' Addresses Authors' Addresses
bert hubert Bert Hubert
Netherlabs Computer Consulting BV. Netherlabs Computer Consulting BV.
Braillelaan 10 Braillelaan 10
Rijswijk (ZH) 2289 CM Rijswijk (ZH) 2289 CM
The Netherlands The Netherlands
Email: bert.hubert@netherlabs.nl Email: bert.hubert@netherlabs.nl
Remco van Mook Remco van Mook
Virtu Equinix
Auke Vleerstraat 1 Auke Vleerstraat 1
Enschede 7521 PE Enschede 7521 PE
The Netherlands The Netherlands
Email: remco@virtu.nl Email: remco@eu.equinix.com
Full Copyright Statement Full Copyright Statement
Copyright (C) The IETF Trust (2008). Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors contained in BCP 78, and except as set forth therein, the authors
retain all their rights. retain all their rights.
This document and the information contained herein are provided on an This document and the information contained herein are provided on an
 End of changes. 44 change blocks. 
101 lines changed or deleted 122 lines changed or added

This html diff was produced by rfcdiff 1.35. The latest version is available from http://tools.ietf.org/tools/rfcdiff/