Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between SSL pinning (embedded in host) and normal certificates (presented by server)

I'm not quite understanding the necessity of certificate pinning in SSL connection establishment (to avoid Man in the Middle attacks).

SSL cert pinning requires embedding original server certificate in the host to verify with the one presented by server. what is the difference between the server certificate embedded in the host and the one presented by server to be validated by client?

What is that I am missing here?

like image 405
nari447 Avatar asked Aug 15 '17 18:08

nari447


People also ask

What are the 3 types of SSL?

There are three recognized categories of SSL certificate authentication types: Extended Validation (EV) Organization Validation (OV) Domain Validation (DV)

What are the different types of SSL?

There are three types of SSL Certificate available today; Extended Validation (EV SSL), Organization Validated (OV SSL) and Domain Validated (DV SSL). The encryption levels are the same for each certificate, what differs is the vetting and verification processes needed to obtain the certificate.

What is meant by SSL pinning?

What is SSL pinning? SSL (Secure socket layer) Certificate Pinning, or pinning for short, is the process of associating a host with its certificate or public key. Once you know a host's certificate or public key, you pin it to that host.

Which type of SSL certificate is best?

Extended Validation (EV) Certificates Extended Validation Certificate follows a strict verification process to a rigorous level and helps to detect phishing websites. Also, it provides a higher level of security than any other type of SSL certificate.


1 Answers

what is the difference between the server certificate embedded in the host and the one presented by server to be validated by client?

There should be none and that's exactly the point of certificate pinning.

Without certificate pinning an application commonly accepts any certificate which matches the requested hostname and is issued by a locally trusted CA (certificate authority). Given that there are usually more than 100 CA in the local trust store it is sufficient that one of these got successfully attacked as in the case of DigiNotar in 2011. Thus it makes sense to limit the certificate you accept to a specific one, i.e. pinning.

Besides the certificate pinning by comparing the certificate received with a locally stored certificate there are other ways of pinning: for example one might just check against a fingerprint (hash) and not the full certificate. In case the certificate can expire it might be more useful to check only the public key and not the whole certificate because the public key is often kept on certificate renewal. Or one might pin to a specific CA which one considers trusted to issue certificates for this domain.

Note that to understand pinning you might need to understand how the authentication of the server works. One part of this is that the server certificate is validated (hostname, expiration, trust chain ...). But this is not enough since the certificate itself is public, i.e. everybody can get it and could send it inside the TLS handshake. Thus the other major part of the authentication is that the server proves that it is the owner of the certificate. This is done by signing some data using the private key matching the certificate. Since only the owner of the certificate should have the private key this proves ownership. Because of this anybody could embed the servers certificate for pinning but only the server itself can prove ownership of the certificate.

like image 60
Steffen Ullrich Avatar answered Nov 02 '22 10:11

Steffen Ullrich