<s>
HTTP	B-Protocol
Public	I-Protocol
Key	I-Protocol
Pinning	I-Protocol
(	O
HPKP	B-Protocol
)	O
is	O
an	O
obsolete	O
Internet	B-Application
security	I-Application
mechanism	O
delivered	O
via	O
an	O
HTTP	B-Protocol
header	I-Protocol
which	O
allows	O
HTTPS	B-Protocol
websites	O
to	O
resist	O
impersonation	O
by	O
attackers	O
using	O
misissued	O
or	O
otherwise	O
fraudulent	O
digital	O
certificates	O
.	O
</s>
<s>
A	O
server	O
uses	O
it	O
to	O
deliver	O
to	O
the	O
client	B-Protocol
(	O
e.g.	O
</s>
<s>
web	B-Application
browser	I-Application
)	O
a	O
set	O
of	O
hashes	B-Algorithm
of	O
public	B-Application
keys	I-Application
that	O
must	O
appear	O
in	O
the	O
certificate	O
chain	O
of	O
future	O
connections	O
to	O
the	O
same	O
domain	O
name	O
.	O
</s>
<s>
For	O
example	O
,	O
attackers	O
might	O
compromise	O
a	O
certificate	B-Architecture
authority	I-Architecture
,	O
and	O
then	O
mis-issue	O
certificates	O
for	O
a	O
web	B-Protocol
origin	I-Protocol
.	O
</s>
<s>
To	O
combat	O
this	O
risk	O
,	O
the	O
HTTPS	B-Protocol
web	O
server	O
serves	O
a	O
list	O
of	O
“	O
pinned	O
”	O
public	B-Application
key	I-Application
hashes	B-Algorithm
valid	O
for	O
a	O
given	O
time	O
;	O
on	O
subsequent	O
connections	O
,	O
during	O
that	O
validity	O
time	O
,	O
clients	O
expect	O
the	O
server	O
to	O
use	O
one	O
or	O
more	O
of	O
those	O
public	B-Application
keys	I-Application
in	O
its	O
certificate	O
chain	O
.	O
</s>
<s>
The	O
technique	O
does	O
not	O
pin	O
certificates	O
,	O
but	O
public	B-Application
key	I-Application
hashes	B-Algorithm
.	O
</s>
<s>
This	O
means	O
that	O
one	O
can	O
use	O
the	O
key	B-Application
pair	I-Application
to	O
get	O
a	O
certificate	O
from	O
any	O
certificate	B-Architecture
authority	I-Architecture
,	O
when	O
one	O
has	O
access	O
to	O
the	O
private	B-Application
key	I-Application
.	O
</s>
<s>
Also	O
the	O
user	O
can	O
pin	O
public	B-Application
keys	I-Application
of	O
root	B-Protocol
or	O
intermediate	B-Architecture
certificates	I-Architecture
(	O
created	O
by	O
certificate	B-Architecture
authorities	I-Architecture
)	O
,	O
restricting	O
site	O
to	O
certificates	O
issued	O
by	O
the	O
said	O
certificate	B-Architecture
authority	I-Architecture
.	O
</s>
<s>
Due	O
to	O
HPKP	B-Protocol
mechanism	O
complexity	O
and	O
possibility	O
of	O
accidental	O
misuse	O
,	O
in	O
2017	O
browsers	B-Application
deprecated	O
and	O
removed	O
HPKP	B-Protocol
support	O
in	O
favor	O
of	O
Certificate	B-Protocol
Transparency	I-Protocol
and	O
its	O
Expect-CT	O
header	B-General_Concept
.	O
</s>
<s>
That	O
header	B-General_Concept
is	O
deprecated	O
by	O
now	O
as	O
well	O
.	O
</s>
<s>
Therefore	O
only	O
DNS	B-Protocol
Certification	I-Protocol
Authority	I-Protocol
Authorization	I-Protocol
can	O
now	O
be	O
used	O
to	O
restrict	O
which	O
certificate	B-Architecture
authorities	I-Architecture
can	O
issue	O
certificates	O
for	O
a	O
particular	O
domain	O
,	O
thus	O
reducing	O
chance	O
of	O
certificate	O
issue	O
errors	O
.	O
</s>
<s>
The	O
server	O
communicates	O
the	O
HPKP	B-Protocol
policy	O
to	O
the	O
user	O
agent	O
via	O
an	O
HTTP	B-Protocol
response	O
header	B-General_Concept
field	O
named	O
Public-Key-Pins	B-Protocol
(	O
or	O
Public-Key-Pins-Report-Only	O
for	O
reporting-only	O
purposes	O
)	O
.	O
</s>
<s>
The	O
HPKP	B-Protocol
policy	O
specifies	O
hashes	B-Algorithm
of	O
the	O
subject	O
public	B-Application
key	I-Application
info	O
of	O
one	O
of	O
the	O
certificates	O
in	O
the	O
website	O
's	O
authentic	O
X.509	O
public	B-Application
key	I-Application
certificate	O
chain	O
(	O
and	O
at	O
least	O
one	O
backup	O
key	O
)	O
in	O
pin-sha256	O
directives	O
,	O
and	O
a	O
period	O
of	O
time	O
during	O
which	O
the	O
user	O
agent	O
shall	O
enforce	O
public	B-Protocol
key	I-Protocol
pinning	I-Protocol
in	O
max-age	O
directive	O
,	O
optional	O
includeSubDomains	O
directive	O
to	O
include	O
all	O
subdomains	O
(	O
of	O
the	O
domain	O
that	O
sent	O
the	O
header	B-General_Concept
)	O
in	O
pinning	O
policy	O
and	O
optional	O
report-uri	O
directive	O
with	O
URL	O
where	O
to	O
send	O
pinning	O
violation	O
reports	O
.	O
</s>
<s>
At	O
least	O
one	O
of	O
the	O
public	B-Application
keys	I-Application
of	O
the	O
certificates	O
in	O
the	O
certificate	O
chain	O
needs	O
to	O
match	O
a	O
pinned	O
public	B-Application
key	I-Application
in	O
order	O
for	O
the	O
chain	O
to	O
be	O
considered	O
valid	O
by	O
the	O
user	O
agent	O
.	O
</s>
<s>
At	O
the	O
time	O
of	O
publishing	O
,	O
only	O
allowed	O
the	O
SHA-256	B-Algorithm
hash	B-Algorithm
algorithm	O
.	O
</s>
<s>
(	O
mentions	O
some	O
tools	O
and	O
required	O
arguments	O
that	O
can	O
be	O
used	O
to	O
produce	O
hashes	B-Algorithm
for	O
HPKP	B-Protocol
policies	O
.	O
)	O
</s>
<s>
A	O
website	O
operator	O
can	O
choose	O
to	O
either	O
pin	O
the	O
root	B-Protocol
certificate	I-Protocol
public	B-Application
key	I-Application
of	O
a	O
particular	O
root	B-Protocol
certificate	I-Protocol
authority	I-Protocol
,	O
allowing	O
only	O
that	O
certificate	B-Architecture
authority	I-Architecture
(	O
and	O
all	O
intermediate	O
authorities	O
signed	O
by	O
its	O
key	O
)	O
to	O
issue	O
valid	O
certificates	O
for	O
the	O
website	O
's	O
domain	O
,	O
and/or	O
to	O
pin	O
the	O
key(s )	O
of	O
one	O
or	O
more	O
intermediate	O
issuing	O
certificates	O
,	O
or	O
to	O
pin	O
the	O
end-entity	O
public	B-Application
key	I-Application
.	O
</s>
<s>
The	O
HPKP	B-Protocol
is	O
not	O
valid	O
without	O
this	O
backup	O
key	O
(	O
a	O
backup	O
key	O
is	O
defined	O
as	O
a	O
public	B-Application
key	I-Application
not	O
present	O
in	O
the	O
current	O
certificate	O
chain	O
)	O
.	O
</s>
<s>
HPKP	B-Protocol
is	O
standardized	O
in	O
RFC	O
7469	O
.	O
</s>
<s>
It	O
expands	O
on	O
static	O
certificate	B-Protocol
pinning	I-Protocol
,	O
which	O
hardcodes	O
public	B-Application
key	I-Application
hashes	B-Algorithm
of	O
well-known	O
websites	O
or	O
services	O
within	O
web	B-Application
browsers	I-Application
and	O
applications	O
.	O
</s>
<s>
Most	O
browsers	B-Application
disable	O
pinning	O
for	O
certificate	O
chains	O
with	O
private	O
root	B-Protocol
certificates	I-Protocol
to	O
enable	O
various	O
corporate	O
content	B-Protocol
inspection	I-Protocol
scanners	O
and	O
web	O
debugging	O
tools	O
(	O
such	O
as	O
mitmproxy	O
or	O
Fiddler	B-Application
)	O
.	O
</s>
<s>
The	O
RFC	O
7469	O
standard	O
recommends	O
disabling	O
pinning	O
violation	O
reports	O
for	O
"	O
user-defined	O
"	O
root	B-Protocol
certificates	I-Protocol
,	O
where	O
it	O
is	O
"	O
acceptable	O
"	O
for	O
the	O
browser	B-Application
to	O
disable	O
pin	O
validation	O
.	O
</s>
<s>
This	O
URI	O
may	O
be	O
served	O
via	O
HTTP	B-Protocol
or	O
HTTPS	B-Protocol
;	O
however	O
,	O
the	O
user	O
agent	O
cannot	O
send	O
HPKP	B-Protocol
violation	O
reports	O
to	O
an	O
HTTPS	B-Protocol
URI	O
in	O
the	O
same	O
domain	O
as	O
the	O
domain	O
for	O
which	O
it	O
is	O
reporting	O
the	O
violation	O
.	O
</s>
<s>
Hosts	O
may	O
either	O
use	O
HTTP	B-Protocol
for	O
the	O
report-uri	O
,	O
use	O
an	O
alternative	O
domain	O
,	O
or	O
use	O
a	O
reporting	O
service	O
.	O
</s>
<s>
Some	O
browsers	B-Application
also	O
support	O
the	O
Public-Key-Pins-Report-Only	O
,	O
which	O
only	O
triggers	O
this	O
reporting	O
while	O
not	O
showing	O
an	O
error	O
to	O
the	O
user	O
.	O
</s>
<s>
During	O
its	O
peak	O
adaptation	O
,	O
HPKP	B-Protocol
was	O
reported	O
to	O
be	O
used	O
by	O
3,500	O
of	O
top	O
1	O
million	O
internet	O
sites	O
,	O
a	O
figure	O
that	O
declined	O
to	O
650	O
around	O
the	O
end	O
of	O
2019	O
.	O
</s>
<s>
Criticism	O
and	O
concern	O
revolved	O
around	O
malicious	O
or	O
human	O
error	O
scenarios	O
known	O
as	O
HPKP	B-Protocol
Suicide	O
and	O
RansomPKP	O
.	O
</s>
