Certificate Pinning - Shezartech
post-template-default,single,single-post,postid-11386,single-format-standard,mkd-core-1.0.2,sparks child-child-ver-1.0.0,sparks-ver-1.5,mkd-smooth-scroll,mkd-smooth-page-transitions,mkd-ajax,mkd-grid-1300,mkd-blog-installed,mkd-header-standard,mkd-sticky-header-on-scroll-down-up,mkd-default-mobile-header,mkd-sticky-up-mobile-header,mkd-dropdown-default,mkd-header-style-on-scroll,mkd-full-width-wide-menu,mkd-header-standard-in-grid-shadow-disable,wpb-js-composer js-comp-ver-6.0.3,vc_responsive

Certificate Pinning

A mobile app frequently communicates with its backend running on a remote server. The mobile app or the server may initiate communication.  Such conversation comprises of service/data requests, updates, and acknowledgment for responses received from the other end. It is necessary to verify identity in interaction. Let’s have an example where a server is initiating a communication. The server sends over a certificate to the mobile application. This certificate comprises the signature of the server. The mobile app would inspect the sign to verify the server’s identity.

The mobile app may adopt a couple of approaches for verifying the signature. The first approach is only to confirm that a signature is present. Second is permanently having the server’s certificate available locally to check that the same certificate is provided.

Adopting the first approach would allow attackers to send a certificate in a valid format but with a sign of their own. The mobile app would have no way to verify the genuineness of the signature. The application then would start communication with the attacker and share some sensitive information — this type of attack is known as Man in the Middle attack. Alternatively, an attacker may perform ‘SSL Striping’ as well. SSL stripping is the act of getting rid of the encryption and subsequently making malicious use of the obtained information. The solution is, ensuring that the certificate or its public key is available with the mobile app permanently. This would enable the app to verify the authenticity of the server and detect an impersonator.