Slashdot Log In
BIND Still Susceptible To DNS Cache Poisoning
Posted by
Soulskill
on Sat Aug 09, 2008 08:05 AM
from the still-in-a-bind dept.
from the still-in-a-bind dept.
An anonymous reader writes "John Markoff of the NYTimes writes about a Russian hacker, Evgeniy Polyakov, who has successfully poisoned the latest, patched BIND with randomized ports. Originally, the randomized ports were never supposed to completely solve the problem, but just make it harder to do. It was thought that with port randomization, it would take roughly a week to get a hit. Using his own exploit code, two desktop computers and a GigE link, Polyakov reduced the time to 10 hours."
Related Stories
[+]
IT: Massive, Coordinated Patch To the DNS Released 315 comments
tkrabec alerts us to a CERT advisory announcing a massive, multi-vendor DNS patch released today. Early this year, researcher Dan Kaminsky discovered a basic flaw in the DNS that could allow attackers easily to compromise any name server; it also affects clients. Kaminsky has been working in secret with a large group of vendors on a coordinated patch. Eighty-one vendors are listed in the CERT advisory (DOC). Here is the executive overview (PDF) to the CERT advisory — text reproduced at the link above. There's a podcast interview with Dan Kaminsky too. His site has a DNS checker tool on the top page. "The issue is extremely serious, and all name servers should be patched as soon as possible. Updates are also being released for a variety of other platforms since this is a problem with the DNS protocol itself, not a specific implementation. The good news is this is a really strange situation where the fix does not [immediately] reveal the vulnerability and reverse engineering isn't directly possible."
Submission: BIND Still Susceptible to DNS Cache Poisoning by Anonymous Coward
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Full
Abbreviated
Hidden
Loading... please wait.
IPv6 could solve this! (Score:4, Insightful)
With IPv6, you would have enough source addresses to add that to the 'random pool' too. Another 64K addresses would make it harder to hack.
Does anyone else think that maybe we are approaching this problem the wrong way?
Re: (Score:2)
The source addresses would be the same though - there are only a limited number of DNS servers and it's not hard to sniff a link and work out what the common ones are... so you're not adding anything, just creating a situation where the average home user can't actuallly use your DNS server.
Re: (Score:3, Insightful)
I meant the source address of your request. Eg when your internal dns caching server sends a dns request, your router nat's the source address from a random pool of 64k (or more) addresses. In order for someone to spoof the reply, they would need to know the dns request id, the source port you used to send, and the source IP address chosen by your nat router. It's a client side solution only.
As a solution, it would rely on the following:
. a useful number of DNS servers being reachable via IPv6 (not the case
Re:IPv6 could solve this! (Score:4, Insightful)
Another 64K addresses would make it harder to hack.
You said it, it'd make it harder, but not impossible, specially with hardware geting faster every year.
Parent
Re:IPv6 could solve this! (Score:4, Informative)
Yes, the wrong way being tacking on extra transaction ID space by means of fragile kludges such as random source port numbers and, possibly, random IPv6 addresses.
It will require a lot more effort, but the right way to solve this problem is by improving the protocol itself. That may mean putting a much larger transaction ID field in the packets, where it cannot be mangled by NAT devices. Or it may mean delegating nameservers by IP address rather than domain name so that resolvers will no longer need to accept potentially-malicious glue records. But preferably, it means moving to a cryptographically-strong domain name system such as DNSSEC.
Parent
Re: (Score:3, Informative)
Or it may mean delegating nameservers by IP address rather than domain name so that resolvers will no longer need to accept potentially-malicious glue records.
Good post. Forgive me for focusing in on this one point and nitpicking it.. ;)
0. Glue used to have a specific meaning: records configured in a parent to help delegate a zone. You (and many people reporting on the current flaws) seem additionally to use it to refer to "additional answers" in DNS replies. While such answers often are glue records, they'
Re: (Score:3, Informative)
The third party hierarchical trust you disdain is one of the primary benefits of DNSSEC, because DNSSEC can eventually replace certificates for distribution of public keys. Currently, the only PKI we have is from a third-party non-hierarchical trust—the CAs—who are really not that trustworthy. DNS, however, is already hierarchical, and it makes a lot more sense to use a hierarchical system of trust—the same system in fact—to validate it. Do you really think having hundreds of trust a
Re: (Score:3, Informative)
who are really not that trustworthy.
I generally don't trust the CA's further than I can throw them. Who do you figure is trustworthy enough to handle it for DNS? Who could be regarded as trustworthy, no matter who in the world you ask? There seems to be some administrative problems with handing the keys to Mother Theresa.
hundreds of trust anchors
Having trust anchors at all is the problem. You need to verify against several independent sources, preferably sources you have some reason to trust, to avoid singl
Re: (Score:3, Informative)
Yet, they are the current standard for providing end-to-end security. So how mainstream to you think your level of doubt is?
Mind you, I don't trust the CAs either, which is why I want DNSSEC, since it can provide a superior mechanism with far fewer vectors for subversion, which I can control for my own domains, and which also is not vulnerable to cache poisoning.
Re: (Score:3, Informative)
DNS does already work over TCP, and is used where the response will be over a certain size, eg a zone transfer from primary to secondary DNS server.
The problem is one of efficiency. TCP has much higher overheads, you need three packets just to get a connection started and then you have to keep track of the connection and shut it down properly. Three packets doesn't sound like much but over a high latency link (eg 500ms) it makes for a huge increase in the time it takes to resolve a name.
Re: (Score:2)
Does anyone else think that maybe we are approaching this problem the wrong way?
Of course 'we' are.
Making something harder to exploit != fixing the exploit.
Re: (Score:2)
Does anyone else think that maybe we are approaching this problem the wrong way?
No, although I think that quite a few people may have the wrong end of the stick. I got the distinct impression that while it's still a good idea, using random source ports wasn't intended to be THE fix for the problem. Rather that it was just a generic, vendor neutral workaround to enable people to have a chance to secure themselves against the immediate threat without revealing enough information to Black Hats to exploit the issue. A more permanent solution, that might otherwise have entailed revealing
Re: (Score:2)
I haven't been too far into the technical aspects of this issue, but from what I gather, it is related to brutally "predicting" the source ports used for recursion, and injecting fraudulent responses?
It would generate more traffic, sure, but wouldn't an immediately obvious solution be to demand multiple confirmatory replies to recursion, each request using a different randomisation algorithm for the source port used?
You Will Never Solve This Problem! (Score:5, Insightful)
If your DNS server says that slashdot.org resolves to something other than 216.34.181.45 then that's where you're going to end up. There are also legitimate reasons why someone might want to do something like that, and it is part of the inherent flexibility that has made the internet and its technologies as ubiquitous and as well used as they are. No one said that there weren't downsides. If you locked everything down in the manner that some idiots will inevitably now talk about, shouting and squealing about financial institutions, then I'm willing yo bet that you will lose a good portion of the flexibility that makes the 'internet' actually work on a wide scale.
Re: (Score:2)
Re: (Score:3, Interesting)
Isn't the real issue here our continued reliance on passwords that can be used more than once? When are we going to move wholeheartedly into a single-use password environment?
Incidentally, when is somebody going to throw the fact that US banks have completely ignored the two-factor authentication requirement (part of the Patriot Act, I believe; maybe we should start sending *bankers* to Gitmo and see if *that* gets their attention) back at the finance industry when they start to squeal?
Re: (Score:3, Insightful)
I wonder why the parent is modded Insightful. You don't seem to have gotten the problem.
The problem is not the servers being able to redcirect you to a different address, but the fact that any person (not only the people that control the servers you query) can make you server direct people to anywhere.
The problem is not about trust, but not being able to make sure who you are really getting a message from. You can't even have a trust problem if you are not sure who is talking to you.
GigE (Score:2, Interesting)
Re: (Score:2)
Given a setup like that you could poison just about any protocol unless it was using SSL... anything that has a two way conversation expects replies and you can inject packets into it by getting there 'first.
TBH though given that setup I'd just respond to ARP requests for the router and intercept the entire traffic flow. DNS poisoning not required.
I'm safe, in my ADSL utopia (Score:2)
So, if you have a GigE lan, any trojaned machine can poison your DNS during one night...
People at home are safe though - that's the main thing. People on the local net at home are generally known people, with access to your house (WiFi excepted), and could probably find easier ways to steal your identity, capture keystrokes, etc. And you're safe from Internet people too - at the end of my 8Mb connection, I think I'd notice a Gb of traffic heading my way, to say nothing of it taking 125 times longer anyway.
Re: (Score:2)
You local machine's cache is probably safe, yes (or reasonably so). What about your ISP's, which in all likelihood you're using when you don't have a local cache of the required information? Not only are you vulnerable to that, but so is everyone else using your ISP.
Re: (Score:2)
A server at a hosting-provider might be a nice place for this exploit. But everyone in the know, already knew this was a possible target.
Re: (Score:3)
It depends ARP spoofing is just confined to the broadcast-domain (possible a VLAN), while a DNS-server probably is used by a much broader 'audiance'.
Isn't it a birthday attack? (Score:3, Interesting)
Re: (Score:2)
They do, mostly. There's a certain amount of caching built in at all levels these days (which is why for example on windows you have to do ipconfig/flushdns sometimes if DHCP changes the address of a machine).
Limit the bandwidth, compare notes (Score:4, Insightful)
The exploit depends on a GigE connection to the DNS server. So a caching server behind a T1 is going to take much longer to exploit. So running your own caching server on a T1, DSL, or cable is going to be more resistant than using the ISP DNS with a fat pipe.
If there is actually 1 GigE of DNS traffic at an ISP, they could distribute the requests to 100 bandwidth limited servers. Then the attack would only manage to poison one of the servers in 10 hours. Even more interesting would be if the 100 servers could compare notes to detect the poisoning.
Re:Limit the bandwidth, compare notes (Score:4, Insightful)
A decent firewall could be trained to recognize an attack like this take preventative action easily enough - to even get it to work you'd have to saturate the link with packets hoping to get a 'hit'.. So you can do it in gigE in 10 hours. You can attack just about any connection based system using similar methods, but you'd have to saturate the link and it'd get noticed... especially if you did it at gigE bandwidth for 10 hours!!
Parent
Re: (Score:2)
Re: (Score:3, Insightful)
The packets won't look like that though will they - at that bandwidth they'd have to be on the local network so they'd be coming from a different source mac (and that's pretty much the only way to do this attack anyway - any ISP worth the money will drop any packets with fake source addresses on the floor before they get routed externally, so it'd have to be an internal attack).
Worst case you shut down the DNS server and everyone drops to the backups until the attacker is traced and shut down.
Re: (Score:2)
at that bandwidth they'd have to be on the local network
Or be a medium-large botnet.
(and that's pretty much the only way to do this attack anyway - any ISP worth the money will drop any packets with fake source addresses on the floor before they get routed externally, so it'd have to be an internal attack)
So why was the original problem considered to be such a big deal? Any DNS poisoning attack requires that you pretend to be the real DNS server, so if it's only possible from the local network why was that big coordinated patch worth the effort?
Re: (Score:2)
I'm no expert, but would asking twice make it ^2 harder to get a hit?
Gigabit link? (Score:2)
Re: (Score:2)
The internet at large is safe until either:
1. Everyone is connected by a gigabit cable to a common nameserver, and the admin of the nameserver is too stupid to realize that their dns being saturated with bogus packets at gigE speeds for 10 hours is not normal.
2. Both ISPs and routers for some reason decide stop filtering source addresses so that such an attack is possible without being directly connected.
That's a lot of bandwidth (Score:2)
Let's see 10 hours * 1Gbps / 512kbps = 2.22 years.
If you have a 10Mbps link that makes it 41 days.
I think I would have made a dns request and got the valid dns reply into my cache before the 2 years are up. Or my connection would have gone down and I'd get a different IP by then. Thanks to TM Net for protecting me from such attacks
Either that or I'll be safe because the site would have DoSed me off the net wi
I guess it's time... (Score:2)
for DNSv2.
(whatever that means)
Re:I guess it's time... for Secure DNS (Score:4, Insightful)
It's long past time for Secure DNS, which is a combination of TSIG+TKEY, SIG(0), and DNSSEC. End to end crypto authentication. Protects not just against off-path spoofed-source attacks like Kaminsky's, but also on-disk attacks against zone files, and provider-in-the-middle attackers who remap your NXDOMAIN responses into pointers to their advertising servers.
Sadly, it's a year away even if everybody started now, and most people want to be last not first, so very few people have started, and some of those people are saying "why bother, if it's not an instant solution there's no point to it, let's scrap the design and start over." (Had it not taken 12 years to get Secure DNS defined, then the prospect of doubling that time would not daunt me as much as it does.)
So, everybody please start already. NSD and Unbound from NLNetLabs supports DNSSEC. So does BIND, obviously. Sign your zones, and if your registrar won't accept keys from you, send them to a DLV registry [isc.org] while you wait for that. Turn on DNSSEC validation in your recursive nameservers. Write a letter to your congresscritter saying "please instruct US-DoC to give ICANN permission to sign the root DNS zone." In the time it would take for this Russian physicist's attack to work over your 512K DSL line (2.2 years, I heard?) we could completely secure the DNS or at least the parts of DNS whose operators gave a rat's ass about security (which is not the majority but it certainly includes your server, right?)
Parent
DJB's take . . . (Score:5, Informative)
For those that haven't seen it, djb threw up some information regarding this problem and various options a few years ago.
http://cr.yp.to/djbdns/forgery.html [cr.yp.to]
Re: (Score:3, Informative)
For those that haven't seen it, djb threw up some information regarding this problem and various options a few years ago.
http://cr.yp.to/djbdns/forgery.html [cr.yp.to]
I went and had a look at the thread (dated from Jul 30 2001) referenced in the excerpt at djb's site (follow the posting link in the URL above). As far as I can tell, Jim Reid was pooh-poohing the usefulness of port randomization, the approach used as an emergency backstop against Kaminsky's attach just over seven years later. To be fair, Reid was doing so in the context of advocating for Secure DNS.
djb drives people crazy (particularly the BIND folks), but he's someone to listen to - is it the case, as I
Re: (Score:2, Funny)
This isn't a BIND problem. (Score:5, Informative)
This has nothing to do with BIND vulnerabilities. DJdns, or whatever you feel is more secure, has exactly the same problem. It is a protocol weakness. The article mentions BIND only because it is the reference implementation for DNS.
The most interesting idea I've seen is to use IPv6 for DNS [slashdot.org]. The oldest idea is to start using DNSSEC.
Parent
Re:This isn't a BIND problem. (Score:4, Insightful)
Since the basis of the attack is spoofing server IPs, how does DJBDNS detect spoofed packets? "only come from defined servers" is useless when the packets are spoofed. It helps, of course, to not accept new glue records whenever they appear, but keep existing ones until they expire. But this just makes the attack take a little longer.
Parent
Re:This isn't a BIND problem. (Score:5, Informative)
The basis of the attack is to include "extra" information in a forged response to a query for a non-existent host. Bind trusts that extra information and other DNS servers only pay attention to that information if it falls under certain strict rules.
I ask for aaaae3fcg.bankofamerica.com and also send 100,000 responses to that query to that same recursive DNS server, that all say something to the effect of "a record aaae3fcg.bankofamerica.com = bah, also look to 666.666.666.666 for anything else related to bankofamerica.com. Oh, and cache this until the sun goes dark"
Nobody asks Bind to believe the part about THE REST OF THE WHOLE BLOODY DOMAIN in the response for a single record in the domain. No other servers cache that information.
That bind also used non-random ports made it a 5 minute attack over a fast link, instead of a 10 hour attack. That in the past bind used bad random numbers for the transaction ID made it a 30 packet attack...
Who's the fanboy now?
Parent
Re: (Score:2, Interesting)
It does not make the attack take "a little longer". It makes cache poisoning take as long as it took before the new attack method. If you only get a chance to poison the cache once whenever the cache purges the target record, then you have to guess the transaction ID correctly on the first try. The new thing about the current attack is that you get as many tries as you want at guessing transaction IDs and port numbers. That only works because servers allow glue to replace already cached records.
Port randomi
Re: (Score:3, Informative)
Not all dns servers cache the glue records beyond that transaction. Those that don't *cache* the glue are not vulnerable to this attack.
Re: (Score:2, Informative)
$ apt-cache -n search power dns | wc -l
0
Re:Power DNS Recursor.. (Score:4, Informative)
% apt-cache -n search pdns-recursor
pdns-recursor - PowerDNS recursor
Granted, it *is* actually missing on several architectures because of some unimplemented system calls, but that shouldn't bother too many people.
Parent
Re:Power DNS Recursor.. (Score:5, Informative)
Consider reading the links in the article. Obfuscation isn't a fix.
Article says, that DJBDNS does not suffer from this attack. It does. Everyone does. With some tweaks it can take longer than BIND, but overall problem is there.
Parent
Re:BIND (Score:5, Funny)
I think you mean B0wnd
Parent
Re: (Score:2)
Aren't all physicists hackers?
Re: (Score:3, Interesting)
This isn't an attack one could run against a client out on a DSL line, but if you were able to take over one machine in a colo, you might be able, over time, to get traffic for other machines directed to yours.
True. On the other hand, if you are on the same network segment then there are many other options available to you if you want to do evil. Blasting about 4 terabytes (1 Gb/s for 10H) at a DNS server isn't exactly a quiet attack, so if you intend to stay below the radar you're probably a lot better off trying some good old arp spoofing or tcp hijacking instead.