Thanks to the ‘Trust on First Use’ approach, HPKP immediately sets out to create a connection with the client from its first point of contact. However, the first point of contact, in which the server transmits the pinned key, is not actually protected. Usually this small gap only leads to problems in isolated cases, and a large number of unintentional attacks on your websites’ SSL/TLS connections is almost impossible. The main criticism brought against public key spinning is the following attack scenario, which is only possible through pinning technology:
- An attacker gets access to your server.
- They install a new SSL/TLS certificate and then create their own set of keys.
- It also generates the appropriate hash value for the public key, and places this value in the appropriate area of the certificate pinning header, instead of your pins.
- Users or clients who call your website for the first time will receive the wrong PIN and subsequently cannot establish a secure connection to your server.
- If the attacker deletes the certificate from your server again, these users will be denied access to your page until the validity of the incorrect pin expires.
- In addition to inflicting damage through the resulting loss of traffic, the attacker also has the opportunity to demand money to unblock the incorrect certificate, and can blackmail you.
Even though this scenario is theoretically possible, it is by no means an argument against the use of HTTP public key pinning, because the attacker could set up the extension of the HTTP protocol as soon as he has access to the server. The problem ultimately proves just how important it is to protect your website against hacker attacks. If you are using pins, you should also make sure that your monitoring software has been alerted to promptly inform you when changes are made in the HPKP headers, to be able to intervene in time. Another possible approach to a solution on the clients’ part would be pin-reset mechanisms that regularly delete known ‘malicious’ pins.
Other negative criticisms mostly regard the low level of distribution and complexity associated with the configuration of public key pinning. The reasons for this are probably the fact that the standard is often poorly known or not known at all.