On Tue, Oct 23, 2012 at 12:21 PM, Ralph Bergmann <[email protected]> wrote:
> I've read this article but what I do not understand: is it really so
> difficult to build a secure HTTPS connection?
Yes, it can be when working within SSL/TLS and PKI. You must take
additional steps to harden the browser and the channel.

The browser must make all requests through HTTPS, and not start with
HTTP or mix/match HTTP/HTTPS. Confer: " New Tricks for Defeating SSL
in Practice" 
(http://www.blackhat.com/presentations/bh-dc-09/Marlinspike/BlackHat-DC-09-Marlinspike-Defeating-SSL.pdf)
and sslstrip (http://www.thoughtcrime.org/software/sslstrip/). I
believe "strict-transport-security" is another option, but its not
widely adopted by servers and browsers (yet).

SSL/TLS is an absolute mess, and must be used in a hardened state.
Some of the problems with the channel "as-is" are listed on OWASP
Mobile's mailing list: "Mobile, SSL/TLS, and Certificate or Public Key
Pinning," 
http://lists.owasp.org/pipermail/owasp-mobile-security-project/2012-August/000345.html.
Pinning public keys can remediate most of the problems with the
infrastructure.

If you watch Google's I/O presentation ("Google I/O 2012: Security and
Privacy in Android Apps,"
https://developers.google.com/live/shows/ahNzfmdvb2dsZS1kZXZlbG9wZXJzcg4LEgVFdmVudBirxtoCDA/),
you will see that Google recommends pinning. In addition, Chrome users
did not suffer Diginotar's failure like others because Google pinned
its public key in the browser.

> Usually I open a HttpsURLConnection. Is this not enough? What I have to do
> to prevent man-in-the-middle attacks? How can I check the certificate and
> the host and if the host the right one?
Quod erat demonstrandum. While your basic checks are noteworthy, they
don't address the gaps in SSL/TLS and HTTP/HTTPS protocols. Put
another way, they are fine in a benign environment, but expose risk
when the environment is hostile. And the risk is not theoretical or
limited to financial losses (confer, Diginotar, Iran, and the
disposition of dissidents).

Somewhat on topic: Its not just Android (or Android applications) that
have deficient implementations. Apple, Symbian, et al have the same
problems. At the moment, I'm trying to figure out how to secure a
Cocoa/CocoaTouch UIWebView
(http://stackoverflow.com/questions/12994602/iphone-and-uiwebview-force-https-rewrite-urls-on-the-fly).
Apple does not make it easy.

Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Android Security Discussions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/android-security-discuss?hl=en.

Reply via email to