HTTP Public Key Pinning

2015 - 2019
dead
after a dutch certificate authority was breached in 2011 and used to forge google certificates, the web wanted a way for a site to tell browsers which keys to accept for it. rfc 7469 was that answer, and it turned out to be more dangerous than the attack it was built against. a wrong pin or an expired one took your own domain offline for exactly as long as the header had said, and there was nobody to call. chrome dropped it in january 2019 and the web did not notice, because hardly anyone had dared switch it on.

~ the last words ~

HTTPS has a structural weakness that most people never think about. Your browser ships with a root store holding several hundred certificate authorities, and any one of them can issue a valid certificate for any domain on earth. The lock icon means some authority vouched for the site. It does not mean the right one did.

That stopped being theoretical in 2011, when the Dutch authority DigiNotar was compromised and certificates for google.com were forged and used to read the mail of Iranian users. Key pinning was the answer the web reached for. A site would send a header listing cryptographic fingerprints of the public keys it intended to use, and for as long as that header said, browsers would refuse any certificate for that domain outside the list. RFC 7469 published the mechanism in April 2015 under the header name Public-Key-Pins.

The failure mode was visible from the start to anyone who read the spec closely. A pin is a promise made to every browser that saw it, and the browser keeps the promise whether or not you can still honor it. Lose the key, let a certificate authority rotate its intermediate chain, set max-age to a year and then change hosting providers, and every returning visitor got a connection error that no server-side fix could clear, leaving you to wait out the clock you had set yourself.

I have never set this header on anything, and that is not distance so much as it is having read the instructions. Every write-up that explained how to turn pinning on spent more words on how to survive turning it on than on the attack it stopped, which is a strong signal about a piece of infrastructure. Almost nobody ran it in enforcing mode, and the adoption figures bear that out.

~ the record ~

BornApril 2015, RFC 7469, written by three engineers at Google
PeakSupported in Chrome and Firefox, deployed on well under 1% of HTTPS sites
Killed30 January 2019, when Chrome 72 shipped without it
LifespanJust under 4 years as a published standard
Made byThe IETF, from a Google proposal
Killed byThe lockout risk, plus Certificate Transparency doing the job safely

~ what the header did ~

The syntax was short. You listed one or more base64 SHA-256 hashes of subject public key info, set a max-age in seconds, optionally added includeSubDomains, and optionally pointed report-uri at something that would collect violations. The spec required at least one backup pin for a key you were not currently serving, which was the whole recovery plan: if the live key died, you would already have published a fingerprint for its replacement.

In practice the backup pin was the part people got wrong, because it asks you to generate a key you will not use for years and then still have it on the day you need it. Chrome also shipped a Public-Key-Pins-Report-Only variant that collected violation reports without enforcing anything, and that mode was most of the real-world deployment.

~ the lockout problem ~

Two scenarios got names. The first was HPKP suicide: an operator pins keys, loses them or lets the chain change, and takes their own domain down for the pin lifetime. The second was hostile pinning, sometimes called RansomPKP, where an attacker with brief write access to your server sets a long pin for keys they control. You detect the intrusion and rebuild the box, and your visitors still cannot reach you, because their browsers are keeping a promise the attacker made on your behalf.

Neither scenario had a recovery path that did not involve waiting. There is no revocation channel for a pin and no support line for a browser cache. Adoption stayed accordingly tiny, which meant the feature carried browser maintenance cost and attack surface while protecting a rounding error of the web.

~ what took over ~

Certificate Transparency replaced it with the opposite shape. Instead of a site declaring in advance which keys to trust, every certificate gets logged publicly and anyone can audit what has been issued for their domain after the fact. Paired with CAA records, which let a domain name the authorities permitted to issue for it, that covers most of what pinning promised without handing site owners a loaded foot-gun. Chrome removed Public-Key-Pins in Chrome 72 on 30 January 2019; Mozilla deprecated it in Firefox 72 in January 2020 and finished the removal in Firefox 78 on 30 June 2020, citing Chrome's departure as the reason to stop carrying it.

~ leave a rose ~

an anonymous tribute. one rose per visitor per day.

@}-->-- ... roses left here

~ leave a wreath ~

a rose fades by morning. a wreath stays on this grave for good, with your name on it.

paid once through stripe. payments are handled by OÜ Lakeview, the small company that keeps rip.so running. the money pays for the hosting and the nightly digging. adopt it and the headstone reads "maintained in memory by" you. the groundskeeper plants new wreaths at the next tending, usually within a day.

» one email a week: new graves and the anniversaries of the dead. subscribe

~ leave a note ~

visitors before you have left these graveside notes. anonymous welcome.

other protocols: wiki.vg, CoralCDN, Solipsis, POWDER

also died in 2015-2019: Fuhu, Roku SoundBridge, GiveForward

« previous  ·  random  ·  next »