Eu 14 Selvi Bypassing HTTP Strict Transport Security WP
Eu 14 Selvi Bypassing HTTP Strict Transport Security WP
Eu 14 Selvi Bypassing HTTP Strict Transport Security WP
Jose Selvi
[email protected]
Abstract—For the last few years, some different attacks from the last HTTPS connection. After that, the policy outdates
against SSL/TLS have been released. Some of them based on and the browser returns to his usual behavior.
cryptography or protocol weaknesses such as BEAST, CRIME,
BREACH, etc, and some others, such as SSLStrip, based on An optional parameter in an HSTS is ’IncludeSubdomains’.
rewriting HTTPS links into HTTP ones and keep user com- If this parameter is set, then the HSTS policy applies to the
munications always in HTTP. In order to protect users against visited domain and all the subdomains as well. If not it only
SSLStrip attacks, a new protection called HTTP Strict Transport applies to the exact domain that the user has visited.
Security (HSTS) has been developed and it’s currently supported
by most widely used browsers. In addition, an HSTS policy prevents an user from ac-
cepting self-signed or abnormally signed certificates, since
However, under certain circumstances, an attacker could remember the certification authority (CA) that signed the
exploit an inter-operation vulnerability in order to bypass HTTP
previous seen certificate.
Strict Transport Security protection and use other well-known
attack techniques such as SSLStrip. In this paper, we review Unfortunately, HSTS is not a security feature that is
the HSTS strengths and weaknesses, and we go in-depth on this currently widely deployed in the Internet, since just a few
inter-operation vulnerability and how it could be exploited. websites use it. However, some reference companies such as
Twitter, Paypal or Google use this security feature.
I. B RIEF H ISTORY OF B YPASSING SSL
Most desktop browsers support this security feature as
SSL/TLS is certainly one of the most important protocols in well. Some of them share a ’Preloaded HSTS’ list [6][7]
the security field since on it relies our communications privacy that contains a domain list of hosts that should be configured
and security. Because of that, it’s a target for both attackers automatically even before the first HTTPS connection, so users
and security professionals. remain protected after a fresh install or after wiping out their
local state.
In the past few years some different techniques have been
presented. Some of them focused on design weaknesses such
as BEAST [1], CRIME [2] or BREACH [2], some other III. N ETWORK T IME P ROTOCOL (NTP)
based on exploting some implementations weaknesses such as The Operating Systems use the Internet for a big amount
HeartBleed or the famous Apple goto fail vulnerability. of internal tasks or features such as software updates, the
Moxie Marlinspike [4] presented one of the most used OS activation itself and so on. One of those features is the
techniques, based on stripping a previous HTTP connection Time Synchronization. By default, almost all the desktop
by rewriting all the HTTPS links into HTTP ones, changing operating systems automatically synchronize its time with In-
properties of cookies and other similar changes. Since users ternet Servers usually owned by the operating system provider
usually type only website name in his browser and not the full (for example ’time.windows.com’ for Microsoft operating sys-
URL, their fists connection would be an HTTP one, so it could tems).
be intercepted and stripped. All of them use different versions (v3 or v4) of the Network
Time Protocol (NTP) [8][9][10] that is widely used to provide
II. HTTP S TRICT T RANSPORT S ECURITY time synchronization between computers.
HTTP Strict Transport Security [5] (also known as HSTS or NTP messages are sent via UDP packets (123/UDP). The
STS) is the industry response for the Moxie’s stripping attacks message format is the same for both requests and responses,
and his tool SSLStrip. but each peer use a different set of fields and ignore the rest
of them.
HSTS protocol defines a new HTTP header called ’Strict-
Transport-Security’ that can be sent by a webserver to his Most important fields are:
clients in order to specify a new policy regarding how the
• Leap (LI): Leap is a warning indicator that should be
browser in going to handle the future connections.
usually set to zero. Clients often set this value to 3
There are two main parameters in an HSTS policy. One of (clock unsynchronized) when request time synchro-
them is ’max-age’ that represents the amount of seconds that nization.
the browser should connect in HTTPS-only mode. As a result,
• Version (VN): NTPv3 (3) or NTPv4 (4).
a browser that receive an HSTS policy with ’max-age:1000’
from ’mywebsite.com’ would stay using HTTPS if the user • Mode: Usually client (3) or server (4) depending if it is
clicks on HTTP links or even if the user type an HTTP link. a request or a response. Other values are also possible
That policy would be active for the following 1000 seconds but they are not used in by default NTP configuration.
Usage: delorean.py [options]
Options:
-h, --help show this help message and exit
-i INTERFACE, --interface=INTERFACE
Listening interface
-p PORT, --port=PORT Listening port
-n, --nobanner Not show Delorean banner
-s STEP, --force-step=STEP
Force the time step: 3m (minutes), 4d (days), 1M
(month)
-d DATE, --force-date=DATE
Force the date: YYYY-MM-DD hh:mm[:ss]
-k SKIM, --skim-step=SKIM
Skimming step: 3m (minutes), 4d (days), 1M (month)
-t THRESHOLD, --skim-threshold=THRESHOLD
Skimming Threshold: 3m (minutes), 4d (days), 1M
(month)
-r, --random-date Use random date each time
Fig. 1. NTP Packet
VIII. C ONCLUSION
We have reviewed how the major desktop operating sys-
tems work regarding its time synchronization and we have
found that, on certain systems and under certain circumstances,
an NTP MitM attack is possible and it could be used in order
to force HSTS policies to expire. We have developed a NTP
MitM tool, called Delorean, that could be used to perform the
proposed attacks.
R EFERENCES
[1] J.Rizzo and T.Duong, BEAST, Ekoparty 2011.
[2] J.Rizzo and T.Duong, CRIME, Ekoparty 2012.
[3] A.Prado, N.Harris and Y.Gluck, BREACH, Black Hat USA 2013.