Misconfigured Strict-Transport-Security

TLDR: Misconfigured Strict-Transport-Security (HSTS), introduced in 2012, can undermine the security of HTTPS connections, exposing users to man-in-the-middle attacks and insecure content delivery. Issues such as missing directives, insufficient max-age settings, or failure to preload domains compromise the benefits of enforcing strict secure communication. Proper configuration of HSTS is critical for ensuring the confidentiality and integrity of web traffic.

https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

One common issue with misconfigured HSTS is the use of inadequate `max-age` values. For example, setting a low duration like 10 seconds instead of a recommended value of at least one year (31,536,000 seconds) significantly reduces the policy's effectiveness. Additionally, failing to include the `includeSubDomains` directive leaves subdomains unprotected, potentially exposing them to downgrade attacks. Another issue is the omission of domain registration in the HSTS preload list, which ensures that browsers enforce HSTS policies before the initial visit.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security

To avoid these misconfigurations, administrators should implement a robust HSTS header with an appropriate `max-age` value, include the `includeSubDomains` directive, and submit domains for the HSTS preload list. Regular testing using tools like SSL Labs and monitoring for misconfigured responses ensures policy compliance and security. Adhering to these best practices protects users from insecure connections and enhances overall application trustworthiness.

https://hstspreload.org/