Definition
HTTP Strict Transport Security (HSTS) is a web security policy mechanism that helps protect websites against protocol downgrade attacks and cookie hijacking. It instructs web browsers to only interact with a website using secure HTTPS connections, never plain HTTP. When a browser encounters an HSTS enabled website, it automatically upgrades any HTTP requests to HTTPS before sending them. This is crucial for preventing man-in-the-middle attacks and ensuring data integrity during transmission. For instance, if you visit your bank's website, HSTS ensures your connection remains encrypted even if you accidentally type http instead of https. Unlike simple redirects, HSTS is enforced by the browser itself, making it a more robust security measure. This concept is frequently tested on certifications like CompTIA Security+ and CySA+.
