<s>
HTTP	B-Protocol
Strict	I-Protocol
Transport	I-Protocol
Security	I-Protocol
(	O
HSTS	O
)	O
is	O
a	O
policy	O
mechanism	O
that	O
helps	O
to	O
protect	O
websites	O
against	O
man-in-the-middle	O
attacks	O
such	O
as	O
protocol	B-Protocol
downgrade	I-Protocol
attacks	I-Protocol
and	O
cookie	B-Protocol
hijacking	I-Protocol
.	O
</s>
<s>
It	O
allows	O
web	B-Application
servers	I-Application
to	O
declare	O
that	O
web	B-Application
browsers	I-Application
(	O
or	O
other	O
complying	O
user	B-Protocol
agents	I-Protocol
)	O
should	O
automatically	O
interact	O
with	O
it	O
using	O
only	O
HTTPS	B-Protocol
connections	O
,	O
which	O
provide	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS/SSL	B-Protocol
)	O
,	O
unlike	O
the	O
insecure	O
HTTP	B-Protocol
used	O
alone	O
.	O
</s>
<s>
The	O
HSTS	O
Policy	O
is	O
communicated	O
by	O
the	O
server	O
to	O
the	O
user	B-Protocol
agent	I-Protocol
via	O
an	O
HTTP	B-Protocol
response	O
header	B-Protocol
field	O
named	O
"	O
Strict-Transport-Security	B-Protocol
"	O
.	O
</s>
<s>
HSTS	O
Policy	O
specifies	O
a	O
period	O
of	O
time	O
during	O
which	O
the	O
user	B-Protocol
agent	I-Protocol
should	O
only	O
access	O
the	O
server	O
in	O
a	O
secure	O
fashion	O
.	O
</s>
<s>
Websites	O
using	O
HSTS	O
often	O
do	O
not	O
accept	O
clear	O
text	O
HTTP	B-Protocol
,	O
either	O
by	O
rejecting	O
connections	O
over	O
HTTP	B-Protocol
or	O
systematically	O
redirecting	O
users	O
to	O
HTTPS	B-Protocol
(	O
though	O
this	O
is	O
not	O
required	O
by	O
the	O
specification	O
)	O
.	O
</s>
<s>
The	O
consequence	O
of	O
this	O
is	O
that	O
a	O
user-agent	B-Protocol
not	O
capable	O
of	O
doing	O
TLS	B-Protocol
will	O
not	O
be	O
able	O
to	O
connect	O
to	O
the	O
site	O
.	O
</s>
<s>
The	O
way	O
this	O
protection	O
works	O
is	O
that	O
a	O
user	O
entering	O
or	O
selecting	O
a	O
URL	O
to	O
the	O
site	O
that	O
specifies	O
HTTP	B-Protocol
,	O
will	O
automatically	O
upgrade	O
to	O
HTTPS	B-Protocol
,	O
without	O
making	O
an	O
HTTP	B-Protocol
request	O
,	O
which	O
prevents	O
the	O
HTTP	B-Protocol
man-in-the-middle	O
attack	O
from	O
occurring	O
.	O
</s>
<s>
With	O
the	O
conversion	O
to	O
an	O
Internet	O
Draft	O
,	O
the	O
specification	O
name	O
was	O
altered	O
from	O
"	O
Strict	B-Protocol
Transport	I-Protocol
Security	I-Protocol
"	O
(	O
STS	O
)	O
to	O
"	O
HTTP	B-Protocol
Strict	I-Protocol
Transport	I-Protocol
Security	I-Protocol
"	O
,	O
because	O
the	O
specification	O
applies	O
only	O
to	O
HTTP	B-Protocol
.	I-Protocol
</s>
<s>
The	O
HTTP	B-Protocol
response	O
header	B-Protocol
field	O
defined	O
in	O
the	O
HSTS	O
specification	O
however	O
remains	O
named	O
"	O
Strict-Transport-Security	B-Protocol
"	O
.	O
</s>
<s>
A	O
server	O
implements	O
an	O
HSTS	O
policy	O
by	O
supplying	O
a	O
header	B-Protocol
over	O
an	O
HTTPS	B-Protocol
connection	O
(	O
HSTS	O
headers	O
over	O
HTTP	B-Protocol
are	O
ignored	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
server	O
could	O
send	O
a	O
header	B-Protocol
such	O
that	O
future	O
requests	O
to	O
the	O
domain	O
for	O
the	O
next	O
year	O
(	O
max-age	O
is	O
specified	O
in	O
seconds	O
;	O
31,536,000	O
is	O
equal	O
to	O
one	O
non-leap	O
year	O
)	O
use	O
only	O
HTTPS	B-Protocol
:	O
Strict-Transport-Security	B-Protocol
:	O
max-age	O
=	O
31536000	O
.	O
</s>
<s>
When	O
a	O
web	O
application	O
issues	O
HSTS	O
Policy	O
to	O
user	B-Protocol
agents	I-Protocol
,	O
conformant	O
user	B-Protocol
agents	I-Protocol
behave	O
as	O
follows	O
(	O
RFC	O
6797	O
)	O
:	O
</s>
<s>
http://example.com/some/page/	O
will	O
be	O
modified	O
to	O
https://example.com/some/page/	O
accessing	O
the	O
server	O
)	O
.	O
</s>
<s>
the	O
server	O
's	O
TLS	B-Protocol
certificate	O
is	O
not	O
trusted	O
)	O
,	O
the	O
user	B-Protocol
agent	I-Protocol
must	O
terminate	O
the	O
connection	O
(	O
RFC	O
6797	O
section	O
8.4	O
,	O
Errors	O
in	O
Secure	O
Transport	O
Establishment	O
)	O
and	O
should	O
not	O
allow	O
the	O
user	O
to	O
access	O
the	O
web	O
application	O
(	O
section	O
12.1	O
,	O
No	O
User	O
Recourse	O
)	O
.	O
</s>
<s>
The	O
SSL	O
(	O
and	O
TLS	B-Protocol
)	O
stripping	O
attack	O
works	O
by	O
transparently	O
converting	O
a	O
secure	O
HTTPS	B-Protocol
connection	O
into	O
a	O
plain	O
HTTP	B-Protocol
connection	O
.	O
</s>
<s>
At	O
the	O
time	O
of	O
Marlinspike	O
's	O
talk	O
,	O
many	O
websites	O
did	O
not	O
use	O
TLS/SSL	B-Protocol
,	O
therefore	O
there	O
was	O
no	O
way	O
of	O
knowing	O
(	O
without	O
prior	O
knowledge	O
)	O
whether	O
the	O
use	O
of	O
plain	O
HTTP	B-Protocol
was	O
due	O
to	O
an	O
attack	O
,	O
or	O
simply	O
because	O
the	O
website	O
had	O
not	O
implemented	O
TLS/SSL	B-Protocol
.	O
</s>
<s>
HSTS	O
addresses	O
this	O
problem	O
by	O
informing	O
the	O
browser	O
that	O
connections	O
to	O
the	O
site	O
should	O
always	O
use	O
TLS/SSL	B-Protocol
.	O
</s>
<s>
The	O
HSTS	O
header	B-Protocol
can	O
be	O
stripped	O
by	O
the	O
attacker	O
if	O
this	O
is	O
the	O
user	O
's	O
first	O
visit	O
.	O
</s>
<s>
Google	B-Application
Chrome	I-Application
,	O
Mozilla	B-Application
Firefox	I-Application
,	O
Internet	B-Application
Explorer	I-Application
and	O
Microsoft	B-Application
Edge	I-Application
attempt	O
to	O
limit	O
this	O
problem	O
by	O
including	O
a	O
"	O
pre-loaded	O
"	O
list	O
of	O
HSTS	O
sites	O
.	O
</s>
<s>
HSTS	O
can	O
also	O
help	O
to	O
prevent	O
having	O
one	O
's	O
cookie-based	O
website	O
login	O
credentials	O
stolen	O
by	O
widely	O
available	O
tools	O
such	O
as	O
Firesheep	B-Operating_System
.	O
</s>
<s>
using	O
false	O
NTP	B-Protocol
packets	O
.	O
</s>
<s>
The	O
initial	O
request	O
remains	O
unprotected	O
from	O
active	O
attacks	O
if	O
it	O
uses	O
an	O
insecure	O
protocol	O
such	O
as	O
plain	O
HTTP	B-Protocol
or	O
if	O
the	O
URI	B-Protocol
for	O
the	O
initial	O
request	O
was	O
obtained	O
over	O
an	O
insecure	O
channel	O
.	O
</s>
<s>
Google	B-Application
Chrome	I-Application
,	O
Mozilla	B-Application
Firefox	I-Application
and	O
Internet	O
Explorer/Microsoft	O
Edge	O
address	O
this	O
limitation	O
by	O
implementing	O
a	O
"	O
HSTS	O
preloaded	O
list	O
"	O
,	O
which	O
is	O
a	O
list	O
that	O
contains	O
known	O
sites	O
supporting	O
HSTS	O
.	O
</s>
<s>
This	O
list	O
is	O
distributed	O
with	O
the	O
browser	O
so	O
that	O
it	O
uses	O
HTTPS	B-Protocol
for	O
the	O
initial	O
request	O
to	O
the	O
listed	O
sites	O
as	O
well	O
.	O
</s>
<s>
A	O
potential	O
solution	O
might	O
be	O
achieved	O
by	O
using	O
DNS	B-Protocol
records	O
to	O
declare	O
HSTS	O
Policy	O
,	O
and	O
accessing	O
them	O
securely	O
via	O
DNSSEC	B-Protocol
,	O
optionally	O
with	O
certificate	O
fingerprints	O
to	O
ensure	O
validity	O
(	O
which	O
requires	O
running	O
a	O
validating	O
resolver	O
to	O
avoid	O
last	B-Protocol
mile	I-Protocol
issues	O
)	O
.	O
</s>
<s>
Junade	O
Ali	O
has	O
noted	O
that	O
HSTS	O
is	O
ineffective	O
against	O
the	O
use	O
of	O
phony	O
domains	O
;	O
by	O
using	O
DNS-based	O
attacks	O
,	O
it	O
is	O
possible	O
for	O
a	O
man-in-the-middle	O
interceptor	O
to	O
serve	O
traffic	O
from	O
an	O
artificial	O
domain	O
which	O
is	O
not	O
on	O
the	O
HSTS	O
Preload	O
list	O
,	O
this	O
can	O
be	O
made	O
possible	O
by	O
DNS	B-Protocol
Spoofing	O
Attacks	O
,	O
or	O
simply	O
a	O
domain	O
name	O
that	O
misleadingly	O
resembles	O
the	O
real	O
domain	O
name	O
such	O
as	O
www.example.org	O
instead	O
of	O
www.example.com	O
.	O
</s>
<s>
Even	O
with	O
an	O
HSTS	O
preloaded	O
list	O
,	O
HSTS	O
cannot	O
prevent	O
advanced	O
attacks	O
against	O
TLS	B-Protocol
itself	O
,	O
such	O
as	O
the	O
BEAST	O
or	O
CRIME	B-General_Concept
attacks	I-General_Concept
introduced	O
by	O
Juliano	O
Rizzo	O
and	O
Thai	O
Duong	O
.	O
</s>
<s>
Attacks	O
against	O
TLS	B-Protocol
itself	O
are	O
orthogonal	O
to	O
HSTS	O
policy	O
enforcement	O
.	O
</s>
<s>
Neither	O
can	O
it	O
protect	O
against	O
attacks	O
on	O
the	O
server	O
-	O
if	O
someone	O
compromises	O
it	O
,	O
it	O
will	O
happily	O
serve	O
any	O
content	O
over	O
TLS	B-Protocol
.	O
</s>
<s>
HSTS	O
can	O
be	O
used	O
to	O
near-indelibly	O
tag	O
visiting	O
browsers	O
with	O
recoverable	O
identifying	O
data	O
(	O
supercookies	O
)	O
which	O
can	O
persist	O
in	O
and	O
out	O
of	O
browser	O
"	O
incognito	B-Protocol
"	O
privacy	B-Protocol
modes	I-Protocol
.	O
</s>
<s>
By	O
creating	O
a	O
web	O
page	O
that	O
makes	O
multiple	O
HTTP	B-Protocol
requests	I-Protocol
to	O
selected	O
domains	O
,	O
for	O
example	O
,	O
if	O
twenty	O
browser	O
requests	O
to	O
twenty	O
different	O
domains	O
are	O
used	O
,	O
theoretically	O
over	O
one	O
million	O
visitors	O
can	O
be	O
distinguished	O
(	O
220	O
)	O
due	O
to	O
the	O
resulting	O
requests	O
arriving	O
via	O
HTTP	B-Protocol
vs.	O
HTTPS	B-Protocol
;	O
the	O
latter	O
being	O
the	O
previously	O
recorded	O
binary	O
"	O
bits	O
"	O
established	O
earlier	O
via	O
HSTS	O
headers	O
.	O
</s>
<s>
Firefox	B-Application
since	O
version	O
4	O
;	O
with	O
Firefox	B-Application
17	O
,	O
Mozilla	B-Operating_System
integrates	O
a	O
list	O
of	O
websites	O
supporting	O
HSTS	O
.	O
</s>
<s>
BlackBerry	B-Application
10	I-Application
Browser	O
and	O
since	O
BlackBerry	O
OS	O
10.3.3	O
.	O
</s>
<s>
cookie	B-Application
injection	O
attacks	O
)	O
that	O
can	O
be	O
avoided	O
by	O
following	O
best	O
practices	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
HSTS	O
host	O
at	O
https://sub.example.com	O
should	O
also	O
answer	O
with	O
the	O
HSTS	O
header	B-Protocol
at	O
https://example.com	O
.	O
</s>
<s>
The	O
header	B-Protocol
should	O
specify	O
the	O
includeSubDomains	O
directive	O
.	O
</s>
<s>
In	O
addition	O
to	O
HSTS	O
deployment	O
,	O
a	O
host	O
for	O
https://www.example.com	O
should	O
include	O
a	O
request	O
to	O
a	O
resource	O
from	O
https://example.com	O
to	O
make	O
sure	O
that	O
HSTS	O
for	O
the	O
parent	O
domain	O
is	O
set	O
and	O
protects	O
the	O
user	O
from	O
potential	O
cookie	B-Application
injection	O
attacks	O
performed	O
by	O
a	O
MITM	O
that	O
would	O
inject	O
a	O
reference	O
to	O
the	O
parent	O
domain	O
(	O
or	O
even	O
http://nonexistentpeer.example.com	O
)	O
,	O
which	O
the	O
attacker	O
then	O
would	O
answer	O
.	O
</s>
