HTTP Strict Transport Security (HSTS) header on the invalid certificate chain

Published on 19 Jun 2022
1 min read
Vulnerability
HSTS

The most used web security policy mechanism is HTTP Strict Transport Security (HSTS). This header protects web applications against protocol downgrade attacks and cookie hijacking. This header also restricts the application from using only HTTPS communication. The header won’t allow communications via the insecure HTTP protocol. There are many servers with an invalid certificate chain. A man-in-the-middle attacker can intercept traffic from a victim user using an invalid certificate. The Strict-Transport-Security header is ignored by the browser when the website is accessed using HTTP. The browser does this because an attacker may intercept HTTP connections and inject the header or remove it. If the website is accessed over HTTPS and if the website doesn’t have any certificate errors, the browser knows your site is HTTPS capable and will use the Strict-Transport-Security header.

Example

The following is the example of strict transport security header.

        Strict-Transport-Security: max-age=31536000

    

Impact

The main impact under this vulnerability:-

As the application doesn’t have strict-transport-security header, the communication will be done via HTTP. HTTP protocols are vulnerable to man in the middle attack.

Mitigation / Precaution

Beagle recommends the following:-

  • Make sure to set a proper HTTP Strict Transport Security
        Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

    
Prathap
Written by
Co-founder, Director

Prathap has around 20 years of experience and has worked on various projects in leading companies like Hitachi, Toshiba, Schneider Electric, ABB, Panasonic, and MicroFuzzy. His expertise lies in architecting, designing, and developing secure projects covering various aspects of software development, processes, and methodology.

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo