--- title: Web security slug: Web/Security tags: - Landing - NeedsTranslation - Security - TopicStub - Web translation_of: Web/Security ---
Ensuring that your website or open web application is secure is critical. Even simple bugs in your code can result in private information being leaked, and bad people are out there trying to find ways to steal data. The web security-oriented articles listed here provide information that may help you secure your site and its code from attacks and data theft.
Strict-Transport-Security:
HTTP header lets a website specify that it may only be accessed using HTTPS.Window
or Worker
for which there is reasonable confidence that the content has been delivered securely (via HTTPS/TLS), and for which the potential for communication with contexts that are not secure is limited. Many Web APIs and features are accessible only in a secure context. The primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful APIs that could further compromise the victim of an attack.Window
object's Window.localStorage
property is a way for servers to store data on a client that is persistent across sessions.Access-Control-Allow-Origin
response header indicates whether the response can be shared with requesting code from the given origin.The X-Content-Type-Options
response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type
headers should not be changed and be followed. This is a way to opt-out of MIME type sniffing, or, in other words, to say that the MIME types are deliberately configured.
In clickjacking, a user is fooled into clicking on a UI element that performs some action other than what the user expects.
X-Frame-Options
HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>
, <iframe>
, <embed>
or <object>
. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.Content-Security-Policy
(CSP) frame-ancestors
directive specifies valid parents that may embed a page using <frame>
, <iframe>
, <object>
, <embed>
, or <applet>
.:visited
selector allowed websites to uncover a user's browsing history and figure out what sites the user had visited. To mitigate this problem, browsers have limited the amount of information that can be obtained from visited links.{{Glossary("Block cipher mode of operation")}}
{{Glossary("Certificate authority")}}
{{Glossary("challenge", "Challenge-response authentication")}}
{{Glossary("Cipher")}}
{{Glossary("Cipher suite")}}
{{Glossary("Ciphertext")}}
{{Glossary("CORS")}}
{{Glossary("CORS-safelisted request header")}}
{{Glossary("CORS-safelisted response header")}}
{{Glossary("Cross-site scripting")}}
{{Glossary("Cryptanalysis")}}
{{Glossary("Cryptographic hash function")}}
{{Glossary("Cryptography")}}
{{Glossary("CSP")}}
{{Glossary("CSRF")}}
{{Glossary("Decryption")}}
{{Glossary("Digital certificate")}}
{{Glossary("DTLS")}}
{{Glossary("Encryption")}}
{{Glossary("Forbidden header name")}}
{{Glossary("Forbidden response header name")}}
{{Glossary("Hash")}}
{{Glossary("HMAC")}}
{{Glossary("HPKP")}}
{{Glossary("HSTS")}}
{{Glossary("HTTPS")}}
{{Glossary("Key")}}
{{Glossary("MitM")}}
{{Glossary("OWASP")}}
{{Glossary("Preflight request")}}
{{Glossary("Public-key cryptography")}}
{{Glossary("Reporting directive")}}
{{Glossary("Robots.txt")}}
{{Glossary("Same-origin policy")}}
{{Glossary("Session hijacking")}}
{{Glossary("SQL injection")}}
{{Glossary("Symmetric-key cryptography")}}
{{Glossary("TOFU")}}
{{Glossary("TLS")}}
{{QuickLinksWithSubpages}}