HTTP Security Header
HTTP Security Header
HEADERS
HTTP Security Headers
• HTTP Headers are a great booster for web security with easy implementation.
• Proper HTTP response headers can help prevent security vulnerabilities like Cross-
• HTTP Security Headers are HTTP response headers that your application can use to
increase the security of your web application by instructing browsers how to handle
your content.
• These are additional pieces of information included in the HTTP response headers
helping to protect web applications and users from various online threats and
vulnerabilities.
• By configuring these headers, web developers and administrators can bolster the
- Response headers hold additional information about the response, like its location
- Representation headers contain information about the body of the resource, like its
data, including content length and the encoding used for transport.
Different Types of Security Headers:
- CSP headers specify which sources of content are permitted to be loaded and
malicious scripts.
• X-Content-Type-Options:
- This header prevents browsers from interpreting files as different content types
than intended.
- This guards against Clickjacking attacks where attackers trick users into
• X-XSS-Protection:
XSS attacks.
- HSTS headers inform browsers to always use a secure (HTTPS) connection when
• Referrer Policy:
- Referrer Policy headers control what information is included in the HTTP Referer
header when navigating to external sites, enhancing user privacy and preventing
• Feature-Policy:
- Feature-Policy headers specify which browser features and APIs can be used on a
web page, offering control over capabilities to reduce the risk of security
vulnerabilities.
- CORS headers define which domains are allowed to access resources on a web
- The Set-Cookie HTTP response header is used to send a cookie from the server to
the user agent, so the user agent can send it back to the server later.
• Access-Control-Allow-Origin
header.
- This header indicates whether the response it is related to can be shared with
- Permissions-Policy allows you to control which origins can use which browser
• Server
- The Server header describes the software used by the origin server that handled
the request — that is, the server that generated the response.
web vulnerabilities such as XSS, CSRF, Clickjacking, and MIME type sniffing
• User Data Protection: They play a crucial role in protecting user data from
information.
• Preventing Data Leakage: Headers like CSP and Referrer Policy prevent the
and PCI DSS, recommend or require the use of specific security headers as part of
compliance efforts.
• Search Engine Ranking: Search engines may consider the security posture of a
website, including the presence of security headers, when ranking search results.
headers provide an adaptable and proactive defense mechanism, helping websites stay
1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
2. https://www.invicti.com/blog/web-security/http-security-headers/
3. https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html