Jump to content
Nytro

Bypass OpenSSL Certificate Pinning on iOS

Recommended Posts

Posted

Bypass OpenSSL Certificate Pinning on iOS

Daniel Mayer (daniel@matasano.com)

January 7, 2015

Abstract:

When mobile applications communicate with an API or web service, this should generally happen

via TLS/SSL (e.g., HTTPS). In order to verify the identity of the server and to prevent man-in-themiddle

attacks, TLS relies on certificates which prove the identity of the web server. Browsers

and mobile operating systems come preconfigured with a list of trusted Certificate Authorities

(CAs). Since any of the CAs may issue a certificate for any hostname/server, security-conscious

applications should “pin” the expected server certificate in the application, i.e., not accept any

certificate but the one issued by the known-good CA which the application developer uses.

From a penetration testing perspective, this may cause practical problems since it is difficult to

intercept the communication of an application that makes use of this technique. Without pinning,

interception typically involves adding the TLS certificate of an intercepting proxy (such as Burp)

to the certificate store of the target operating system. However, when the app uses certificate

pinning, this store is often ignored. On iOS, when the app uses standard iOS APIs, the iOS SSL

Kill Switch, developed by Matasano’s sister company iSEC Partners, can be used to bypass pinning

and force the application to accept any certificate presented by the server or proxy. The Kill Switch

uses Cydia Substrate which hooks the iOS functions used for certificate validation and modifies

them so that they accept any certificate. It becomes more complicated when the app uses the

OpenSSL library instead of the native iOS frameworks since they are not affected by the Kill Switch’s

hooking.

There is more than one way of bypassing OpenSSL-based certificate pinning and, in this paper we

detail two of these methods: binary patching and Cydia Substrate.

Download: http://matasano.com/research/bypassing_openssl_pinning.pdf

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...