HTTPS is not always as secure as it seems. Vulnerabilities found in 5,5% of HTTPS sites

HTTPS is not always as secure as it seems. Vulnerabilities found in 5,5% of HTTPS sites
One of Alexa's top sites (central circle), secured by HTTPS, with subdomains (gray) and dependencies (white), among which there are vulnerable ones (dashed shading)

Nowadays, the HTTPS secure connection icon has become a standard and even a necessary attribute of any serious site. If certificate missing, almost all recent browsers show a warning that connection to the site is "not secure" and do not recommend transferring confidential information to it.

But it turns out that the presence of a "lock" in the address bar does not always guarantee protection. Checking 10 leading sites from the rating, Alexa showed that many of them are subject to critical vulnerabilities in the SSL / TLS protocols, usually through subdomains or dependencies. According to the authors of the study, the complexity of modern web applications greatly increases the attack surface.

Results of the study

The study was conducted by experts from the University of Venice Ca' Foscari (Italy) and the Vienna Technical University. They will present a detailed report at the 40th IEEE Symposium on Security and Privacy, which will be held May 20-22, 2019 in San Francisco.

The top 10 Alexa list HTTPS sites and 000 related hosts were tested. Vulnerable cryptographic configurations were detected on 90 hosts, that is, approximately 816% of the total:

  • 4818 vulnerable to MITM
  • 733 are vulnerable to full TLS decryption
  • 912 are vulnerable to partial TLS decryption

898 sites are completely open to hacking, that is, they allow the injection of extraneous scripts, and 977 sites load content from poorly protected pages that an attacker can interact with.

The researchers emphasize that among the 898 “completely compromised” resources are online stores, financial services and other large sites. 660 out of 898 sites download external scripts from vulnerable hosts: this is the main source of danger. According to the authors, the complexity of modern web applications greatly increases the attack surface.

Other problems were also found: 10% of authorization forms have problems with the secure transmission of information, which threatens to leak passwords, 412 sites allow interception of cookies and session hijacking, and 543 sites are subject to attacks on cookie integrity (through subdomains).

The problem is that in recent years in the SSL / TLS protocols and software identified a number of vulnerabilities: POODLE (CVE-2014-3566), BEAST (CVE-2011-3389), CRIME (CVE-2012-4929), BREACH (CVE-2013-3587), and Heartbleed (CVE-2014-0160). To protect against them, a number of settings are required on the server and client side to avoid using old vulnerable versions. But this is a rather non-trivial procedure, because such settings involve choosing from an extensive set of ciphers and protocols, which are quite difficult to understand. It is not always clear which cipher suites and protocols are considered “secure enough”.

Recommended settings

There is no one officially approved and agreed upon list of recommended HTTPS settings. So, Mozilla SSL Configuration Generator offers several configuration options, depending on the required level of protection. For example, here are the recommended settings for an nginx 1.14.0 server:

Modern Mode

Oldest supported clients: Firefox 27, Chrome 30, IE 11 on Windows 7, Edge, Opera 17, Safari 9, Android 5.0, and Java 8

server {
listen 80 default_server;
listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;


# modern configuration. tweak to your needs.
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_prefer_server_ciphers on;

# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
add_header Strict-Transport-Security max-age=15768000;

# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;

## verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

resolver <IP DNS resolver>;

....
}

Medium support

Oldest supported clients: Firefox 1, Chrome 1, IE 7, Opera 5, Safari 1, Windows XP IE8, Android 2.3, Java 7

server {
listen 80 default_server;
listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
ssl_dhparam /path/to/dhparam.pem;

# intermediate configuration. tweak to your needs.
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
ssl_prefer_server_ciphers on;

# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
add_header Strict-Transport-Security max-age=15768000;

# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;

## verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

resolver <IP DNS resolver>;

....
}

Old Support

Oldest supported clients: Windows XP IE6, Java 6

server {
listen 80 default_server;
listen [::]:80 default_server;

# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;

# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
ssl_dhparam /path/to/dhparam.pem;

# old configuration. tweak to your needs.
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:HIGH:SEED:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!RSAPSK:!aDH:!aECDH:!EDH-DSS-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!SRP';
ssl_prefer_server_ciphers on;

# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
add_header Strict-Transport-Security max-age=15768000;

# OCSP Stapling ---
# fetch OCSP records from URL in ssl_certificate and cache them
ssl_stapling on;
ssl_stapling_verify on;

## verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /path/to/root_CA_cert_plus_intermediates;

resolver <IP DNS resolver>;

....
}

It is recommended that you always use the full cipher suite and the latest version of OpenSSL. The cipher suite in the server settings specifies the priority in which they will be used, depending on the client settings.

Research shows that it's not enough to just install an HTTPS certificate. "While we don't handle cookies like we did in 2005, and 'decent TLS' has become commonplace, it turns out that these basic things aren't enough to secure a surprisingly large number of very popular sites," they say the authors of the work. To reliably protect the channel between the server and the client, you need to carefully monitor the infrastructure from your own subdomains and third-party hosts from which content for the site is supplied. Maybe it makes sense to order an audit from some third-party company that specializes in information security.

HTTPS is not always as secure as it seems. Vulnerabilities found in 5,5% of HTTPS sites

Source: habr.com