DNS and BIND Security Issues
DNS and BIND Security Issues
Paul Vixie
Internet Software Consortium
Abstract
Efforts are underway to add security to the DNS protocol. We have observed that if BIND would just
do what the DNS specifications say it should do, stop crashing, and start checking its inputs, then most
of the existing security holes in DNS as practiced would go away. To be sure, attackers would still
have a pretty easy time co-opting DNS in their break-in attempts. Our aim has been to get BIND to
the point where its only vulnerabilities are due to the DNS protocol, and not to the implementation.
This paper describes our progress to date.
If a delegation NS RR names a host which is not BIND now maintains for each cached RR a “credibility”
authoritative for the zone, then that host when queried level showing whether the data came from a zone, an
nonrecursively for names in that zone will answer with a authoritative answer, an authority section, or additional
delegation to a higher (that is, closer to the root) authority. data section. When a more credible RRset comes in, the
This is an error condition as perceived by the server that old one is completely wiped out. Older BINDs blindly
forwarded a nonrecursive query – if a name server is aggregated data from all sources, paying no attention to
listed in an NS RR, it is supposed to have the zone. It is the maxim that some sources are better than others.
Each RR also has the address of the name server who particular address if they have more than one interface –
sent it to us. This can be seen in cache dump when you’re so if you’re on the wrong side of a multihomed SunOS
looking at some bad data and wondering how it got to name server, all of its responses will appear to be
you. “unsolicited.”
Every change to BIND has the potential to push the We would like to segment the cache such that additional
Internet into the final abyss. We are therefore quite data can be cached for the duration of a query’s restarts,
conservative about anything that looks like it could have but not used to satisfy other queries (either as answer data,
far reaching consequences, which is to say, just about authority data, or additional data). Ideally, the only things
anything1. we would ever cache would be the answer and authority
sections, and only those from authoritative answers (AA
7.1. Query Restarts flag set). BIND’s current cache design is not ready for
this kind of overloading – we’ve pushed it about as far
Some of the information needed to properly validate a as it will go just by adding the credibility tags described
DNS response is expensive (in terms of bandwidth and earlier. What’s needed is a multilevel translucent cache
delay) to obtain, and for that reason it is inappropriate such that each lookup can specify a stack of caches
for every resolver to exhaustively validate every response to be searched, and each cache can be managed by an
it receives. Recursive or forwarding name servers, on appropriate purge policy.
the other hand, have (or should be able to obtain) all
the information the DNS has to offer, and it would be a 7.3. Empty Nonterminal Names
good thing if the name server validated responses before
forwarding them to the client. BIND does not currently do One of the gaping holes in BIND’s new nonpromiscuous
this, since it is not possible to edit responses in situ and we policy towards cache data is that the credibility and zone
are uncomfortable with the idea of BIND autonomously tags are held in the RR, not in the name. It is possible to
deciding that certain responses should not be forwarded determine, knowing only a name, whether that name lies
at all. within any of a server’s zones of authority. BIND doesn’t
Our current plan for circumventing this problem is to do that right now, it currently checks the RRs looking for
restart all queries. To “restart” means that upon receiving any that have a zone tag, and if none are found it assumes
an answer from a forwarded query, a name server will that it is in the cache. This is bad news in the case of
validate the response and insert “known good” data into empty nonterminal names – those names which have no
RRs and are only present to keep two dots from smashing
its cache, and then pretend that the original query had
“just now” been received. All the original RRsets would into each other.
be looked up again, and if any are still missing (either The ARPA domain was once empty other than for
because no response has yet included them, or because its IN-ADDR.ARPA subdomain, and eventually someone
the responses that included them were invalid in some accidentally fed a root server some NS RRs at that name.
way), new queries would be generated to bring in the That root server told the other root servers, and those
missing data. Query restarts are the only way to solve root servers told every name server on the Internet, and
certain other problems currently being encountered by pretty soon nobody anywhere could do address → name
2 translations. We quickly added some NS RRs at the ARPA
BIND – the security benefits will be a happy side effect.
One interesting question we’re pondering about domain and cold started the universe.
query restarts is whether to preserve the AA flag, which It would be better if BIND did not need data to be
as discussed earlier will tend to be set on forwarded present at a name in order to know that that name was
responses if those responses come from an authoritative inside a local zone of authority. Astute readers will note
server, but will tend to be clear on responses satisfied from that it’s really quite easy to add new names to someone
the forwarder’s cache. We could maintain the current else’s authority zones – just keep in mind during your
semantics with the hierarchical cache described below, experiments that these new names won’t appear in zone
but it’s not clear that the AA flag on forwarded responses transfers, so you will have to infect each authoritative
really matters that much. DNSv2 will probably have a AD name server manually.
flag – authority desired – to force forwarding in spite of
any cache. The proposed AD flag will probably have to 7.4. Unified Zone Cut View
bypass the query restart logic described here.
Right now the answer you’ll get for an NS query for a
domain will depend on who you ask. If you ask a server
of the parent zone, you will get the delegation information
from “above” the zone cut. If you ask the a server of
1
A Usenet article once opined, “BIND is like a train wreck inside.” the zone itself, you will get the actual authority data (an
2
Out of zone CNAMEs, for example. NS RRset and an SOA.) We believe it would be better
in most cases to have the server for the parent zone use 9. Which BIND Version Plugs Which Hole?
its delegation data only as hints, and that it should go
out and ask the servers named therein for their view Always assume that you need the latest BIND you can lay
of the real delegation data. This would prevent most your hands on. Our RCS libraries have the whole sordid
of the current instances of lame delegation, since the story, and from them we could derive a table of Versions
lameness would be detected by the server for the parent -vs- Vulnerabilities. You can bet that the upper class of
zone where it can most likely be fixed by the local name attackers can do this as well. Deriving that table would
server administrator. The lame data can be elided from be a lot of work and publishing it might do more harm
delegation responses, thus preventing other servers (giving folks the false idea that they don’t need to upgrade
from following it and having each other server syslog their BIND) than good (letting folks see how bad things
the lameness information to their local, helpless, name really are.) When we took over BIND, the latest version
server administrator. Naturally we would extend the logic was UCB 4.8.3. Our first release was DECWRL 4.9, which
so that the zone servers validate their own delegation contained quite a few security related changes. Our
information and likewise elide lame information from current release as of this writing is ISC 4.9.31, and it also
their responses. contains quite a few security related changes.
This unification would put a stop to the unpleasant
question, “how can both the parent and child zones References
answer authoritatively if they are allowed to answer
differently?” We may implement a stopgap whereby [Bel95a] Steven M. Bellovin. Using the Domain
parents stop setting the AA flag on referral responses – Name System for Syetem Break-ins. In
since the child is really the authority. Unfortunately, last Proceedings of the Fifth Usenix UNIX
time we changed the way we handed out referrals, some Security Syposium, Salt Lake City, UT.
major clients could not handle it and we had to back AT&T Bell Laboratories, 1995.
out to older, broken behaviour. Keeping track of client
sensitivities has become a first order task for us. [RFC1034] Paul V. Mockapetris (ISI). RFC 1034
– Domain Concepts and Facilities, IETF,
What we’re wrestling with on the unification theory 1987.
is whether the root servers should try to verify their
delegation data. With millions of zones delegated, it [RFC1035] Paul V. Mockapetris (ISI). RFC 1035 –
could take quite a while for each root server to get this Domain Implementation and Specification,
done at startup time, so if we do it, it’ll have to come after IETF, 1987.
we make the cache persistent.
[RFC1123] R. Braden, Editor. RFC 1123 – Require-
ments for Internet Hosts – Application and
8. DNSSEC – The IETF DNS Security WG Support, IETF, 1989.
As we’ve mentioned several times in this paper, there [RFC1510] John T. Kohl, et al. RFC 1510 – The
is presently work underway to add security to DNS. The Kerberos Network Authentication Service
current model is something like a “web of trust,” using (V5), IETF, 1993.
public key technology. A new KEY RR holds the public [RFC1760] N. Haller. RFC 1760 – The S/KEY
key and is added to the delegation data. This key is One-Time Password System, IETF, 1995.
sufficient to validate signed answers but not to actually
sign them. Signing is done by the authoritative servers,
and the SIG RR is used to carry the signature of any given
RRset.
Once DNSSEC is widely implemented, it will be
possible to determine from examination of a DNS
response whether its contents are authentic. This sounds
simple but it has deep reaching consequences in both the
protocol and the implementation – which is why it’s taken
more than a year to choose a security model and design a
solution. We expect it to be another year before DNSSEC
is in wide use on the leading edge, and at least a year after
that before its use is commonplace on the Internet.
1
see http://www.isc.org/isc/.