Analysis of the Alexa Top 1M sites (Feb 2018)
Prior to the release of the Mozilla Observatory in June of 2016, I ran a scan of the Alexa Top 1M websites. Despite being available for years, the usage rates of modern defensive security technologies was frustratingly low. A lack of tooling combined with poor and scattered documentation had led to minimal awareness around countermeasures such as Content Security Policy (CSP), HTTP Strict Transport Security (HSTS), and Subresource Integrity (SRI).
Since then, a number of additional assessments have done, including in October 2016 and June 2017. Both of those surveys demonstrated clear and continual improvement in the state of internet security. But now that tools like the Mozilla Observatory, securityheaders.io and Hardenize have become more commonplace, has the excitement for improvement been tempered?
February 2018 Scan
|Technology||June 2017||February 2018||% Change
|Content Security Policy (CSP)||.018%2
|Cross-origin Resource Sharing (CORS)5||96.55%||96.89%||+.35%||+3.3%|
|HTTP → HTTPS Redirection||14.38%6
|Public Key Pinning (HPKP)||0.71%||1.07%||+51%||+148%|
|— HPKP Preloaded8||0.43%||0.70%||+63%||+71%|
|Strict Transport Security (HSTS)9||4.37%||6.03%||+38%||+245%|
|— HSTS Preloaded8||.337%||.631%||+87%||+299%|
|Subresource Integrity (SRI)||0.113%10||0.182%11||+61%||+1113%|
Improvement across the web appears to be continuing at a steady rate. Although a 19% increase in the number of sites that support HTTPS might seem small, the absolute numbers are quite large — it represents over 83,000 websites, a slight slowdown from the previous survey's 119,000 jump, but still a great sign of progress in encrypting the web's long tail.
Not only that, but an additional 97,000 of the top websites have chosen to be HTTPS by default, with another 16,000 of them forbidding any HTTP access at all through the use of HTTP Strict Transport Security (HSTS). Also notable is the jump in websites that have chosen to opt into being preloaded in major web browsers, via a process known as HSTS preloading. Until browsers switch to HTTPS by default, HSTS preloading is the best method for solving the trust-on-first-use problem in HSTS.
Content Security Policy (CSP) — one of the most important recent advances due to its ability to prevent cross-site scripting (XSS) attacks — continues to see strong growth. Growth is faster in policies that ignore inline stylesheets (CSS), perhaps reflecting the difficulties that many sites have with separating their presentation from their content. Nevertheless, improvements brought about by specification additions such as
'strict-dynamic' and policy generators such as the Mozilla Laboratory continue to push forward CSP adoption.
Mozilla Observatory Grading
Despite this progress, the vast majority of top websites around the web continue not to use Content Security Policy, Strict Transport Security, or Subresource Integrity. As these technologies — when properly used — can nearly eliminate huge classes of attacks against sites and their users, they are given a significant amount of weight in Observatory scans.
As a result of their low usage rates amongst top websites, they typically receive failing grades from the Observatory. But despite new tests and harsher grading, I continue to see improvements across the board:
|Grade||April 2016||October 2016||June 2017||February 2018||% Change|
As 976,930 scans were successfully completed in the last survey, a decrease in failing grades by 2.9% implies that over 27,000 of the top sites in the world have improved from a failing grade in the last eight months alone. Note that the drop in A grades is due to a recent change where extra credit points can no longer be used to move up to an A grade.
Thus far, over 140,000 websites around the web have directly used the Mozilla Observatory to improve their grades, indicated by making an improvement to their website after an initial scan. Of these 140,000 websites, over 2,800 have improved all the way from a failing grade to an A or A+ grade.
When I first built the Observatory at Mozilla, I had never imagined that it would see such widespread use. 6.6M scans across 2.3M unique domains later, it seems to have made a significant difference across the internet. I couldn't have done it without the support of Mozilla and the security researchers who have helped to improve it.
Please share the Mozilla Observatory so that the web can continue to see improvements over the years to come!
- Since April 2016
- Amongst sites that set cookies
- Disallows foreign origins from reading the domain's contents within user's context
- Redirects from HTTP to HTTPS on the same domain, which allows HSTS to be set
- Redirects from HTTP to HTTPS, regardless of the final domain
- As listed in the Chromium preload list
max-ageset to at least six months
- Percentage is of sites that load scripts from a foreign origin
- Percentage is of sites that load scripts
frame-ancestorsdirective is allowed in lieu of an XFO header
- Strong CSP policy forbidding
'unsafe-inline'is allowed in lieu of an XXSSP header