HTTP Strict Transport Security (HSTS) header set to less than six months

Published on 22 Jun 2022
1 min read
Vulnerability
HSTS

The HTTP Strict-Transport-Security response header is a header used in a website to notify a browser that it should only be accessed using HTTPS, instead of using HTTP. HTTP Strict Transport Security (HSTS) header’s max-age value is lower than the recommended value. It is only set to six months. 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

        Strict-Transport-Security: max-age=31536000; includeSubDomains

    

Impact

The main impact under this vulnerability:-

  • As the header is expired, the comm unication will continue in HTTP. The HTTP protocol is vulnerable to attacks like Man in the middle attack (MITM).

Mitigation / Precaution

  • set max-age to a big value like 31536000 (12 months) or 63072000 (24 months)
        Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

    
Febna V M
Written by
Cyber Security Engineer

Febna once spent an entire evening arguing with an AI chatbot just to prove that machines can be confidently wrong. The debate ended with no clear winner, but it did spark her curiosity for the fascinating world of artificial intelligence. Today, she works at the intersection of AI and cybersecurity, helping build smarter systems while making sure they don’t become too smart for their own good. When she’s not exploring the future of technology, she’s probably asking “but what if?” one more time.

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