HTTP Header Security (Slide)
HTTP Header Security (Slide)
HTTP Header Security (Slide)
Apache:
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload“
Nginx:
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
Microsoft IIS:
Name: Strict-Transport-Security
Value: max-age=31536000; includeSubDomains; preload
X-Frame-
Options
• An iFrame is an element that
allows a web app to be
nested within a parent web
app.
• Can be used maliciously for a
clickjacking attack or loading
a malicious website inside
the frame
Prevention:
• Frame busting
• X-Frame-Option Header
X-Frame-Options - Implementation
Syntax:
X-Frame-Options: deny
sameorigin
allow-from url (deprecated)
Apache:
Header always set X-Frame-Options “deny”
Nginx:
add_header X-Frame-Options “DENY”;
WordPress:
header('X-Frame-Options: DENY);
Microsoft IIS:
Name: X-Frame-Options
Value: DENY
Expect-CT
Apache:
Header set X-Content-Type-Options nosniff
Nginx:
add_header X-Content-Type-Options nosniff;
Microsoft IIS:
Name: X-Content-Type-Options
Value: nosniff
– Clickjacking
– iFrame injection
– Harlem shake
Demo Time
https://127.0.0.1/mutillidae/
Takeaways
• Enforce HTTPS using the Strict-Transport-Security header and add your
domain to Chrome’s preload list.
• Make your web app more robust against XSS by leveraging the X-XSS-
Protection header.
• Block clickjacking using the X-Frame-Options header.
• Leverage Content-Security-Policy to whitelist specific sources and
endpoints.
• Prevent MIME-sniffing attacks using the X-Content-Type-Options header.
Resources / Tools
• Check Website HTTP Response Header
– https://gf.dev/http-headers-test
• Secure Headers Test
– https://gf.dev/secure-headers-test
• Scott Helme – Security Header Scanner
– https://securityheaders.com
• HTTP Headers Reference
– https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
• HTTP Compatibility Among Browsers
– https://caniuse.com
References
• https://www.netsparker.com/whitepaper-http-
security-headers
• https://www.ntu.edu.sg/home/ehchua/programming/
webprogramming/HTTP_Basics.html
• https://owasp.org/www-chapter-ghana/#div-
pastevents
• https://www.keycdn.com/blog/http-security-headers
THANK YOU
Questions And Answers
Let’s Connect:
@egbordzor
linkedin.com/in/egbordzor
[email protected]