LWN.net Logo

SSL flaws revealed at Black Hat

By Jake Edge
August 5, 2009

The annual Black Hat security conference in Las Vegas is probably the premier security event each year—at least for the disclosure of new vulnerabilities. The event usually has one or more high-profile disclosures that often lead to software vendors and projects scrambling to fix the vulnerable code. This year was no exception, with Secure Sockets Layer (SSL) taking center stage. Two of the vulnerabilities led to Mozilla security updates, while others showed flaws in the certificate authority (CA) infrastructure and browser handling of Extended Validation (EV) SSL certificates.

The most serious problem would seem to be a disconnect between CAs and browsers on how to handle certificates with NUL (i.e. '\0') bytes in the domain name. CAs have been willing to issue certificates for host/domain names containing NULs, but browsers were handling them in ways that made certificate spoofing much easier. Moxie Marlinspike and Dan Kaminsky independently discovered the problem and both presented about it at Black Hat. Marlinspike's example was a certificate issued for www.paypal.com\0.thoughtcrime.org, which would appear to be a legitimate PayPal certificate to the browser user.

It has been argued that the CAs should not be issuing certificates of that sort, especially given that C-based programs interpret NUL as the end of string, but the browsers have a certain amount of responsibility here as well. It's hard to see a legitimate use for a certificate with a NUL byte as part of the domain name, but browsers could and should have used the string length, which is specified in the certificate to determine how to display and handle the domain name. The CAs should also stop signing such certificates, and revoke those that they have already issued, but that, of course, doesn't stop anyone from self-signing a certificate with a NUL byte in the domain name.

The flaw could be exploited to do a man-in-the-middle attack against users. An attacker who could intercept network traffic—via a compromised, or just maliciously configured, wireless router for example—could present one of these certificates when a victim visited PayPal. Because the browser only looked at the host name information before the NUL, the user would believe they had a secure session with PayPal, when, in fact, they were talking to a host under the attacker's control.

Marlinspike found another problem, which only seems to have affected the Firefox 3.0 series, in how wildcards were handled in the host names presented in certificates. Wildcard certificates are meant to solve the problem of multiple hosts in a given domain that need to share certificates. So, a CA could sign a single certificate that would work for webhost00.example.com through webhost99.example.com. Firefox 3.0 and earlier supported a non-standard Netscape regular expression syntax which Marlinspike found a way to exploit.

That exploit would cause a heap overflow that could allow arbitrary code execution—another particularly nasty outcome. According to the Mozilla advisory: "With version 3.5 Firefox switched to the more limited industry-standard wildcard syntax instead and is not vulnerable to this flaw."

Kaminsky's talk also covered a number of other issues with SSL certificate handling. Red Hat's director of security response Mark Cox summarized those problems along with their impact on various free software packages. For the most part, they had much less impact than the NUL-byte spoofing attack, which Cox notes as having been fixed in April for Firefox 3.5 in RHEL.

Another presentation on SSL came from Alexander Sotirov and Mike Zusman. They showed that EV certificates can be replaced with valid, conventional (aka Domain Validated or DV) certificates without changing the browsers display to reflect the potentially reduced security. Browsers display sites using EV certificates in green in the address bar to denote the supposed higher security. By using a man-in-the-middle attack, and a valid DV certificate for the domain, they were able to send the second certificate, which caused the browser to switch encryption keys to that contained in the DV certificate. So the session was secured with the "lesser" DV certificate, which the attacker controlled, but still showed the green address bar.

Zusman also gave a presentation at DefCon (which follows Black Hat) on the reliability of the web applications that CAs use for handling certificate requests. As might be guessed, they turn out to be vulnerable to the usual web application suspects: cross-site scripting and SQL injection, but he found additional problems as well. He was able to circumvent the domain name validation used by some CAs so that he could get certificates for domains that he did not control.

It is rather worrisome that the CAs, who are supposedly guarding the safety of web traffic, are so lax about the security of their own applications. As Zusman noted in the article: "If you can game a CA's validation mechanism, they don't get hurt — they might even make some money. [Those] who suffer are those who use the Internet."

SSL is an important part of the web infrastructure that users must rely on daily to protect their communications with sensitive sites. It is not surprising that it would be targeted by security researchers, nor is it all that surprising that problems were found. While attacks against these specific problems may be difficult to pull off in practice, they represent holes that clearly need to be filled. If security researchers are finding these kinds of problems, it's pretty likely that attackers are finding them as well—but the attackers are much less likely to tell us about it at Black Hat.


(Log in to post comments)

SSL flaws revealed at Black Hat

Posted Aug 6, 2009 16:48 UTC (Thu) by flewellyn (subscriber, #5047) [Link]

More evidence that the "certificate authority" idea is a bad one to begin with.

SSL flaws revealed at Black Hat

Posted Aug 13, 2009 22:59 UTC (Thu) by obi (guest, #5784) [Link]

I agree, the whole thing seems very brittle. I'd rather see individuals make up their own mind about who to trust, than hope no catastrophic failure happens with the CAs. Well, transitive trust is tricky, and it difficult to create an easily understood UI. But the current CA dialogs aren't easily understood either.

SSL flaws revealed at Black Hat

Posted Aug 7, 2009 10:27 UTC (Fri) by intgr (subscriber, #39733) [Link]

Quote:
The CAs should also stop signing such certificates, and revoke those that they have already issued, but that, of course, doesn't stop anyone from self-signing a certificate with a NUL byte in the domain name.
But what do you gain from creating self-signed certificates with the null byte? It was always possible to forge a self-signed certificate for any domain, adding a null byte anywhere doesn't really help you. You can sign a certificate for www.paypal.com\0.thoughtcrime.org just like you can sign one for www.paypal.com

SSL flaws revealed at Black Hat

Posted Aug 7, 2009 11:45 UTC (Fri) by farnz (guest, #17727) [Link]

Given the use of self-signed SSL certs all over the place for things like mailing list archives, the exploit goes something like:

  1. Convince user to install your "CA" certificate, to avoid warnings on a Facebook application/mailing list archive/other low-security requirement site.
  2. Create certificate for www.paypal.com\0.example.com.
  3. Go phish!

We know from various trojans that users can be convinced to do various very stupid things, given the right inducement. We know that SSL warnings are scary, and that browsers are making them scarier. We also know that SSL certificates for commercial use from CAs included in all major browsers (including older browsers like IE6) aren't free. Put these together, and a decent criminal should be able to come up with a plausible reason to install their CA certificate, then go play.

SSL flaws revealed at Black Hat

Posted Aug 12, 2009 17:54 UTC (Wed) by yodermk (subscriber, #3803) [Link]

But how is that different than using that same CA to just sign one for www.paypal.com?

Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds