Archive for July, 2008

Protocol-level DNS Flaw

Posted on July 22nd, 2008 in Computer Security, Life, Technology | 2 Comments »

I was going to wait until Dan Kaminsky announced more details about this flaw at the Black Hat Briefings on August 6th, but Halver Flake’s recent post as essentially squeezed the toothpaste out of the tube on this one. Just look at what Dan has to say.

I’m not going to talk about Dan’s decision not to release the details of this attack as soon as possible or the merits of full disclosure in computer security. Although interesting, it is less interesting to me than the flaw itself.

I know not everyone who reads this blog is technically oriented. To those people, I encourage you to try and make your way through this (long) post. I will try to keep things as simple as possible and I can guarantee you that a better understand of this particular problem will not only give you a better understanding of computer security, but also a better understanding of how the Internet really works.

Let me take a few moments to provide some background. The Domain Name System (DNS) is the protocol that translates a website’s domain name (e.g. somebank.com) into the corresponding IP Address (e.g. 192.168.1.1). IP Addresses are used by routers and network infrastructure to deliver information from one place to another on the Internet. DNS has been around since the mid 1980’s. It is a critical part of the infrastructure of the Internet. When you type in a domain name or use a bookmark to visit your bank’s website, you are trusting that the DNS protocol will take you to the correct server and not to a well-designed phishing website that looks just like your real bank.

The recent flaw in DNS is a protocol-level design flaw, not a software bug. A protocol is merely a pre-defined set of steps done to achieve some objective. For example, when Alice introduces two of her friends, Bob and Chris, to one another for the first time, she would follow a social protocol of introduction. She may introduce Bob to Chris as her co-worker from the Human Resources department, and she may follow this by immediately introducing Chris to Bob as her friend from church. If Alice forgot to introduce Bob to Chris and Bob eventually had to introduce himself to Chris while Alice was standing there, then that failure on Alice’s part is analogous to a failure in a single piece of software. If there were a flaw in this protocol, then every introduction performed based on this social protocol would fail. That is the difference between a protocol-level flaw and a software bug.

Now we have gotten to the crux of the issue. There is a protocol-level flaw in DNS that allows a phisher to take over the actual domain name of the site that it is trying to imitate. This is a serious problem that led to an astonishing collaboration to patch the entire Internet. Even patching the entire Internet isn’t going to “solve” this problem. Why? Because the patches are just that: patches. The problem still exists in the protocol.

What exactly is this problem? (And here’s where I may lose anyone who’s not technically oriented, but I’ll try and keep this simple.) When a DNS server doesn’t know how to translate a domain name into an IP address, it asks another, more trusted, DNS server for the information. Of course, this happens quite frequently since any given DNS server can’t store all the correct DNS translations for the entire Internet all the time (and since these translations can change).

Each time a DNS server has to ask a more trusted DNS server for a domain name to IP address translation, it does so by providing a number called a Query ID (QID). Now, there used to be a ton of attacks based on these QID since they were sequential. This class of attacks basically consisted of an evil doer asking a DNS server to perform a translation on a domain name that it didn’t already have. The evil doer would then start sending forged responses with sequentially increasing QIDs. If the evil doer got the right one, a bad domain name to IP address would be cached. Once a translation is cached, most DNS software implementations will ignore other updates to that domain’s information.

There are many ways to poison a DNS cache. This particular problem was patched (not solved) by just not using sequential QIDs. If a random QID is used, then it becomes very difficult for the evil doer to respond before the real response arrives.

Another interesting way to poison a DNS cache is to send a fake resource record. This attack works because of a chicken-ad-the-egg problem that I deftly avoided in my earlier description of DNS. I said that when a DNS server doesn’t know the proper translation for a domain name, it asks a more trusted DNS server. How? How does it know a more trusted DNS server? Basically, it only knows trusted DNS servers by their domain name. So it has to resolve a domain name for the next step in the hierarchy. Let me give a simple example.

Let’s say you’re a DNS server trying to resolve checking.somebank.com and you don’t know how. Who are you going to ask? Well, you’re going to ask whatever domain name server is controlling somebank.com since somebank.com is the next step in the hierarchy. If you don’t know that one, you’re going to ask the .com root server. Of course, you would like to learn how to ask somebank.com how to resolve all of it’s subdomains (e.g. checking.somebank.com, savings.somebank.com, etc…) since that would be efficient. This is done through a DNS Resource Record (RR).

Although there are many kinds of DNS Resource Records, for this attack all you need to know is that when you make a query for a DNS translation, you can receive back an answer as well as an additional resource record that is intended to help speed up future queries. Now, it used to be possible to poison DNS caches directly with this because there was a flaw in the protocol that allowed these resource records to be totally unrelated to the original request.

For example, let’s say you’re a DNS server and you just sent out a query about checking.somebank.com. It used to be possible that you would receive a domain name to IP address translation for checking.somebank.com and an addition resource record telling you that you should cache ns.evildoer.com as a name server for future queries. This was patched (not “solved”) by requiring the additional resource records be related to the query. (Thus, you would only be able to get a DNS RR for a somebank.com name server.)

The most recent DNS protocol-level flaw is related to both the QID problem and the DNS RR problem. Here’s how I believe it works (and these details are already available to anyone with access to google and a few minutes):

  1. Get a DNS server to look up a subdomain for the site that you want to compromise. For example, randomAAAAAA.somebank.com. The subdomain itself doesn’t really matter other than it shouldn’t exist.
  2. Since the DNS server doesn’t have this domain name to IP address translation it will have to look up the answer. Now, the evil doer can’t reliably predict the QID since random QIDs are used. The vast majority of these lookups will correctly be answered by ns.somebank.com as non-existent subdomains with the right QID. However, the evil doer can still try and race ns.somebank.com to guess an answer.
  3. The evil doer repeats step 2 and increments the random domain name every time. For example, the next domain name the evil doer might try could be randomAAAAAB.somebank.com. Since QIDs are just randomized and not cryptographically secure, the attacker may still have a mathematically reasonable chance at eventually guessing correctly and beating the real name server’s response. If that happens, then the real name server’s response is dropped and more importantly the attacker has earned the right to send a DNS Resource Record updating the name server for the bank. (i.e. The attacker gets to poison ns.somebank.com and make it point to their phishing site.)

It’s clever. It’s not easy to solve, so we’re going to play the patching game again and people are rushing to patch their DNS servers. Now, this post is not going to talk about the losing battle that is penetrate-and-patch. Although it would be fun to rant, that debate is no longer interesting since all the smart people are on the same team.

So why is the flaw (and perhaps computer security on the whole) interesting? The assumptions involved. Professor Spafford has a great quote about computer security and assumptions:

Finding vulnerabilities is simple; discover the assumptions a developer made, ad then violate those assumptions.

People have become accustomed to DNS working. They assume it will work. It’s not just users, but also developers that do this. Let’s take one example: OpenID.

For those who don’t know, OpenID is an identity system that enables users to store their identity information in one place. Instead of having usernames, passwords, addresses, and other account information stored separately at amazon.com, ebay.com, flickr.com, etc…, users would be able to store it (and update it) all in one place. It’s a really neat idea that could eventually provide useful services and save real people time. However, it was designed with the assumption that DNS just worked.

Kim Cameron points this out on his blog, but I think the best summary of the problem is by Tim Anderson:

Note that Cameron is not opposed to OpenID. Apart from anything else, he recognizes that this may well be the beginning of an identity revolution – part of a process, at the end of which we get a safer, less spam laden, less criminal-infested internet.

At the same time, he’s right. The whole OpenID structure hinges on the URL routing to the correct machine on the Internet. In other words, DNS. Now do some research on DNS poisoning. Scary.

Now, it strikes me that you can largely fix this by requiring SSL connections. In other words, have the OpenID URL be an https:// URL, and have the relying party (the website where you want to log in) check for a valid SSL certificate. Note thought that SSL must be used at every stage. OpenID lets you use your own URL as the identifier, but redirect to another OpenID identity provider. Both URLs must use SSL to maintain integrity.

Scary indeed. The OpenID developers have assumed reliable DNS. Now, Tim’s probably right that encryption is the solution to this problem, but I don’t think SSL would work. Even if there is a certificate for the site, most browsers fail to properly inform users what it means when an SSL certificate has changed or isn’t there now. Plus, people are trained to use the domain name and trust that it works.

So how can encryption help? Well, I think DNSSEC and IPSEC (or IPv6) would actually solve (not patch) the problem, but designing better protocols hasn’t been the real issue. DNSSEC and IPSEC have been around for a while. The problem is adoption. No one uses these protocols just like no one uses PGP for encrypting their email.

Metcalfe’s Law is holding most people back since they don’t want to be the only ones using the “other” network. This is another great example of why “road” or “highway” analogies don’t work for the Internet. If this were a pothole or even a collapsed bridge, we could fix the problem properly without really affecting most people. However, since this is the Internet, we can’t actually solve this unless everyone agrees to stop using DNS.

So we’re going to continue to see problems with old infrastructure protocols like DNS. As a result, phishing will continue to be a serious problem. The only way this will stop is if there is a problem so big that the monetary incentive to avoid the problem pushes everyone to change. Who wants to guess how big of a problem that would have to be?

Obama talks National Security at Purdue

Posted on July 17th, 2008 in Computer Security, Politics and Law, Technology | No Comments »

Yesterday Barack Obama was at Purdue University to talk about national security. You can read the text of his remarks here.

Purdue University may seem like a strange place to talk about National Security for many people, but this location was well-chosen for several reasons. First, Clinton won Indiana in the primaries and although the state tends to vote republican in November, Obama needs to continue to bring the democratic party together. Second, Sen. Evan Bayh (D-IN) supported Clinton in the primaries. He’s a very popular former governor of the state who’s father was also in the Senate. Being able to receive his support is important for Obama. Third, Sen. Richard Lugar (R-IN) is a foreign policy and national security expert. Although Sen. Lugar was not at the event, he was spoken of with high praise. Fourth, Purdue University is home of CERIAS, one of the best cyber security research institutions in the world. It makes sense to talk about national security in a state that has such an influential voice in that area.

As to the actual event itself, I strongly encourage you to read Professor Gene Spafford’s write up of his experiences at the event. He gives an overview of Obama’s speech and each of the three panels that followed. It is an excellent read if you are interested in national security, politics or computer security. Although there are many quotable sections of the post, I will refrain from quoting it in the hopes that my strong endorsement of it will encourage you to read the whole thing.

Six Years for Identity Fraud

Posted on July 15th, 2008 in Computer Security, Politics and Law | No Comments »

CNN is running an article about a 22 year old woman who is facing a probable sentence of six years for identity fraud. There are a couple of things to note in this story.

First, their victims were friends and family. This is a common form of identity fraud. More than a third of all victims of identity fraud know the person who victimized them. Why? The answer is access. Friends and family are more trusting and their identity information is simply more easily available. It may even be easier for criminals to use since many vendors may be willing to look the other way for a daughter using her mother’s credit.

Second, the article quotes a federal prosecutor using the phrase “identity fraud” rather than identity theft. This is extremely important because it more accurately describes the crime. We already have laws on the books for fraud. Fraud has been illegal for quite some time. Yes, there are technological issues in catching the criminals, but the situation is far better than it was a few yeas ago.

Jim Harper describes the difference in detail in his book Identity Crisis:

Silence of the Lambs was a 1991 movie starring Jodie Foster as FBI Special Agent Clarice Starling and Anthony Hopkins as the notorious and devious supercriminal Hannibal Lecter. At the end of the movie, Lecter overpowers ad kills two guards in order to escape from a special prison that has been built for him on the upper floors of a building. He changes into the uniform of one of the guards, hides the guard’s body and poses as that guard, badly injured but clinging o life. To complete the deception, Lecter tears the guard’s face off and places it over his own. The police wheel Lecter out of his prison on a gurey, underneath that gruesome mask. This is identity theft. Lecter has taken a key identifier from the dead and mutilated guard, who will never get it back.

Obviously, simply using an identifier is far different than stealing one. It is nice to see that the federal prosecutors are using the correct terminology and that it is making its way into the mainstream press.

FISA Ammendment Passes Senate 69-28

Posted on July 9th, 2008 in Life, Politics and Law, Technology | 2 Comments »

I have trouble describing how disappointed I am that this bill has passed. The roll call vote is available here. I have written about FISA previously here and here.

Although there are many aspects of this bill that disappoint me, I would like to take a moment to talk about the one closest to my research: legal compliance in technology systems. This bill sets an incredibly bad precedent for anyone advocating legal compliance. Essentially, what the telecommunications companies did was blatantly against the law. However, this bill retroactively provides them immunity for their actions [1]. When the consequences for violating the law are removed retroactively, companies have an incentive to violate the law in the future.

The ethics in situations like this are already difficult for engineers to recognize. For a technologist like Mark Klein, setting up a room with a whole bunch of cables going into it is a normal daily aspect of their job. Most will not see the ethical implications. Most engineers at that level are not aware of the bigger picture. They may not be able to say for sure whether their action is a violation of the law. To speak out about such a thing already takes great personal courage.

The last thing engineers need to see is a case like this. They will recognize that even if they do risk their job to speak out about a possible legal problem, and even if that possible problem is recognized as such, it is now, with the passage of this bill, clearly possible that Congress will bend over backwards to let their employer off the hook.

To understand how difficult it was before this amendment was passed for someone like Mark Klein to do what he did, I urge you to read the introduction Cindy Cohn gave him at the EFF Pioneer Awards. Congress has just made it harder on the heroes. This is a disappointing day.

[1] Yes, I realize that this bill doesn’t directly provide for retroactive immunity. However, the bill sets up a sham court proceeding to determine whether or not the companies involved were told it was ok to do what they did by the President, which is already widely known to be true.

[Update: There's an extremely well-written article on the FISA Ammedment Act on ThreatLevel.]

Pending FISA Amendment

Posted on July 7th, 2008 in Politics and Law, Technology | 1 Comment »

Tomorrow, on July 8th, the Senate will vote on a pending FISA amendment that includes provisions to give telecommunications companies legal protection for their role in the warrantless wiretapping, about which I have previously blogged here.

FISA stands for the Foreign Intelligence Surveillance Act and it was passed in 1978 to address abuses of several Presidents. The goal was to limit the ability of the executive to perform surveillance on anyone they wanted.

The initial reaction to the amendment from technologists and civil liberties advocates has been strong and consistent. Techdirt believes that our congress has failed us. The Technology Liberation Front believes this is bad policy and bad politics. The Center for Democracy and Technology believes that the bill is unclear and should at least be clarified for both national security and civil liberty. Finally, the whistleblower who got the ball rolling on all of this in the first place believes that this bill would create the “infrastructure for a police state.” It is also interesting to look at the politicians who received donations from telecommunications companies and also changed their votes.

There are other reasons to dislike this amendment. Representative Rush Holt’s thoughts are worth reading. Senator Chris Dodd gave an impassioned speech about FISA, which includes this gem, pointed out to me by Tim Lee:

This bill does not say, “Trust the American people; Trust the courts and judges and juries to come to just decisions.” Retroactive immunity sends a message that is crystal clear:

“Trust me.”

And that message comes straight from the mouth of this President. “Trust me.”

The amendment even redefines Weapons of Mass Destruction.

Let’s look back at the original goal of the FISA: to limit the power of the executive to watch anyone they wanted. Now, consider the current bill. It takes the power to determine the need for surveillance out of the hands of an impartial judge and puts that power into the hands of the President. It also provides blanket immunity to those companies that broke the law to allow the President to have this surveillance power over the last several years. Make no mistake about it; it is not a compromise.

Natural Disasters are Bad

Posted on July 7th, 2008 in Life, Politics and Law | No Comments »

One might assume that we can all agree that natural disasters are bad, but apparently we can’t. The Boston Globe has an article about how natural disasters are helpful. Yes, you read that right. The article is about how natural disasters are helpful.

Now, if you, like me, don’t believe that an earthquake which killed almost 70,000 people is helpful, then you may find yourself similarly disappointed that such an article could be published at a reputable paper. The concept is tortured logic at best. It goes something like this:

  1. A disaster occurs wiping out all sorts of things that are valuable like buildings, factories, vehicles, and infrastructure.
  2. At great financial cost, society re-builds all the things that were destroyed using the latest techniques.
  3. Measurements are taken of both before and after the disaster and someone concludes that those affected are better off because they have all new buildings, factories, vehicles and infrastructure.

Let’s think about some logical conclusions one might draw about this. If natural disaster is good because it forces us to rebuild, then wouldn’t man-made disaster be even better? I mean, we could pick the places where the disaster would occur and we would create jobs for the teams of people who could go around destroying things. Actually, that sounds a lot like war now. Heck, why don’t we just start wars all the time since the resulting disaster is so obviously good?

Doesn’t really make much sense, does it?

There are really only two salient points to be found in this article. First, the voice of reason:

To critics of this line of thinking, the problem is that it is, at best, a partial picture. It ignores, they argue, the fact that the money and labor that go into post-disaster rebuilding are simply being redirected from other productive uses.

“If you’re a carpenter, a trash remover, a physician, you may be made better off, but the things that those producers would have otherwise produced are not going to be produced,” says Donald Boudreaux, an economics professor at George Mason University. “Over any reasonably relevant period of time, society is not made wealthier by destroying resources,” he adds. If it were, “Beirut should be one of the wealthiest places in the world.”

Huh, who would have thought that disasters were actually bad? Of course, we have known this for a long time.

Second, the conclusion, which is surprisingly good given how horrible the rest of it was:

It may be, then, that disaster economics works best as a guide in those times when we don’t have disasters to contend with. Investing in human capital, replacing outdated plants and infrastructure – the things that Kunreuther and Skidmore argue disasters drive us to do – are also, it turns out, good ideas even in the absence of a crippling catastrophe. If the disaster economists are right, calamities are simply pushing societies to make the sort of sound economic decisions that inertia or fear or bureaucratic sclerosis prevents them from otherwise making. Governments and businesses might do well to adopt some of the urgency and innovation of a post-disaster mind-set even in more clement times.

Imagine that. If you invest in your business rather than limp along with outdated facilities and inefficient equipment, then your business will operate more efficiently.

War is bad. Disasters are bad. The end.