Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I'm superficially familiar with SSL and what certs do. Recently I saw some discussion on cert pinning but there wasn't a definition. A DDG search didn't turn up anything useful. What is certificate pinning?

share|improve this question

migrated from serverfault.com Jan 31 '13 at 7:45

This question came from our site for professional system and network administrators.

    
There's a reasonably succinct description of certificate pinning in Wikipedia. For a more detailed description see the IETF Web Security (websec) Working Group's Public Key Pinning Extension for HTTP specification (currently an Internet Draft but probably soon to be become an RFC). –  user30473 Feb 18 at 10:50

4 Answers 4

up vote 43 down vote accepted

Typically certificates are validated by checking the signature hierarchy; MyCert is signed by IntermediateCert which is signed by RootCert, and RootCert is listed in my computer's "certificates to trust" store.

Certificate Pinning is where you ignore that whole thing, and say trust this certificate only or perhaps trust only certificates signed by this certificate.

So for example, if you go to google.com, your browser will trust the certificate if it's signed by Verisign, Digicert, Thawte, or the Hong Kong Post Office (and dozens others). But if you use (on newer versions) Microsoft Windows Update, it will ONLY trust certificates signed by Microsoft. No Verisign, no Digicert, No Hong Kong Post office.

Also, some newer browsers (Chrome, for example) will do a variation of certificate pinning using the HSTS mechanism. They preload a specific set of public key hashes into this the HSTS configuration, which limits the valid certificates to only those which indicate the specified public key.

share|improve this answer
3  
Good answer, but it also depends on the browser; Google's Chrome browser pins the certificates for Google sites, so in your example, a Chrome browser would only trust specific google.com certificates known to be the correct ones (or the ones signed by the Google Internet Authority). –  KeithS Feb 5 '13 at 19:58
2  
@KeithS the principle is browser-independent. Google pins certificates it knows using a slightly different mechanism (public key hashes instead of certificate hashes), but it's still close enough that calling it "pinning" is still correct. –  tylerl Feb 5 '13 at 21:52
1  
So how is it done? Certificate Pinning, I mean –  user93353 Apr 28 '13 at 12:19
1  
@user93353 the certificate details are stored client-side and compared against those sent over the network. –  tylerl Apr 29 '13 at 22:49
1  
Fuller details of how it's done (or how it might be done when draft proposals are standardised): owasp.org/index.php/Certificate_and_Public_Key_Pinning tools.ietf.org/html/draft-ietf-websec-key-pinning tack.io/index.html imperialviolet.org/2011/05/04/pinning.html –  armb Sep 4 '13 at 9:22

It's ambiguous, but it refers to solutions for an issue in SSL certificate chain verification. Essentially, trust in SSL boils down to root certificates, the certificates your system trusts in to be genuine. Those either come with your OS or with your browser. If one of those is compromised, all certificates signed by this and transitivily signed certificates are to be treated as compromised.

  • TACK or Public Key Pinning Extension (referred to as cert pinning by chrome, apparantly) allows the admin of a server to "pin" a certificate authority's (CA) public key signature to a certificate, which is verfied by the client (delivered via SSL extension). If the CA certificate's key is different upon retrieval of the certificate chain, the CA certificate is likely to be compromised. Source

  • Cert pinning can also refer to importing a host's certificate in your trust store, rather than trusting CA certificates. This mitigates the risk of a CA cert being compromised but forces you to update certifcates if they expire manually. Source

share|improve this answer

SSL server certificates come from the X.509 world. The client verifies the validity of the server's certificate by validating a lot of cryptographic signatures from Certification Authorities. The beauty of the scheme is that it is stateless: a given server could change its certificate every five minutes, and it would still work with clients.

It has been argued that while supporting fast-revolving certificates is awesome but useless, because in practice a given server changes its certificate once per year; indeed, an early certificate switch is indicative of some ongoing fishy business. Certificate pinning is a way for a server to state that this should not happen under normal conditions, and that the client should raise a metaphorical eyebrow should an unexpected certificate switch occur. This is a protocol extension, suggested but not widely supported yet. Actually there seems to be several relatively similar, competing proposals.

See also Convergence, yet another protocol extension which can be thought of as "certificate pinning by trusted third parties". Convergence and the certificate pinning proposals all dance around the same core idea, which is to have some state in the client (or somewhere, at least), and trigger security warnings when certificates change too often or too early. Whether any of these proposals will ever reach wide acceptance (i.e. will be implemented in a compatible way by IE, Firefox, Chrome and Safari, and will be used by most SSL server sysadmins) is anyone's guess.

share|improve this answer
    
I'd claim that Convergence (or Perspectives) are not protocol extensions but a side channel for verifying that the host is using the same certificate when viewed from different locations around the globe and that this situation has around for a while. The core difference to other measures is that the host cannot affect this verification, unlike other cert pinning methods. –  Mikko Rantalainen Aug 29 '13 at 5:55

I think it is just a HSTS implementation to retain SSL certificates of browser clients when a MITM sslstrip attack is made against the web user

share|improve this answer
2  
Certificate pinning is different. At present HSTS doesn't provide any way to pin to a single certificate; instead, HSTS is a boolean that lets a site say "SSL only please" (but doesn't let the site restrict to a single certificate). Certificate pinning is an extension/different mechanism. –  D.W. Jun 27 '13 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.