SlideShare a Scribd company logo
Secure HTTP Headers

    Akash Mahajan
     c0c0n 2011
Agenda
• Programmers should know about the new
  HTTP response headers

• Web security testers should be testing for
  these response headers as defenses

• All you Facebook/Google+ users should be
  aware of these as well
Overview of the Talk
• Cover all some of the new HTTP response
  headers

• Cover which attacks are mitigated by using
  these headers

• Build an case for upgrading to IE8/9, Firefox
  5+ or Chrome if that is your type
HTTP Response Headers
•   X-Frame-Options
•   X-XSS-Protection
•   X-Content-Type-Options
•   X-Content-Security-Policy
•   Set-Cookie
    – Secure
    – HttpOnly
X-Frame-Options
• Used to prevent Clickjacking

• Doesn’t allow page to be rendered in a frame

• DENY : Don’t render at all if inside a frame,
  SAMEORIGIN : Only if being served from the
  origin

• IE8+, FF4+, Chrome5+
X-XSS-Protection
• Used to prevent reflected XSS

• Doesn’t allow the page to be rendered if a
  reflected XSS attack is detected

• 0 is off, 1 is on, Additional mode = block

• IE8+, Chrome, No FF ( use noscript )
X-Content-Type-Options
• Used to prevent mime based attacks.

• Browser will not try to figure out content type
  if not sent to it in the response header
  – An image uploading site with script code is bad


• X-Content-Type-Options: nosniff

• IE8+
X-Content-Security-Policy: policy
• Used to define a whitelist of domains and
  actions which are allowed.
• Example usage
  – X-Content-Security-Policy:
              allow 'self';
              img-src *;
              object-src media1.com media2.com;
              script-src userscripts.example.com;
              allow https://payments.example.com

• FF4+
Set-Cookie with Secure and HTTPOnly

• With Secure keyword
  – Only allow cookie to travel with a secure
    connection
  – An attack where HTTP and HTTPs is mixed
• With HTTPOnly keyword
  – Scripts can’t read the cookie
  – Any attack where session cookie is stolen
• IE7+, Chrome12+, FF3+
Compatibility with browsers
                             MS Internet          Google        Mozilla
Headers / Browsers
                             Explorer             Chrome        Firefox
X-Frame-Options
                                     YES              YES           YES


X-XSS-Protection                     YES              YES           NO


X-Content-Type-Options               YES              NO            NO


X-Content-Security-Policy            NO               NO            YES


Set-Cookie Secure HttpOnly           YES              YES           YES


    This slide needs a lot more work. Specific versions, more browsers.
A logical argument for upgrading IE
• A ten year old browser ( IE6 ) just can’t keep
  up with the advanced web application
  attacks against users. The new crop of
  browsers are proactively adding support to
  stop the attacks at the browser level itself.

• Microsoft runs a http://ie6countdown.com
  with a mission of moving the world off
  Internet Explorer 6
Revisiting the attacks and headers
• X-Frame-Options
  – Especially useful against clickjacking


• X-XSS-Protection
  – Refelected XSS


• X-Content-Type-Options
  – Mime attacks for executing malicious scripts
Revisiting the attacks and headers
• Set-Cookie
  – Secure
     • No sniffing of user session cookie
  – HttpOnly
     • Not allowing javascript to read the session cookie


• X-Content-Security-Policy
  – Whitelisting of content domains for including in
    the page
My info while I answer your questions

       Akash Mahajan
           That Web Application Security Guy
 – Web Application Security Consultant
 – null Co-Founder, Bangalore Chapter Lead
 – Certified Ethical Hacker

         @makash | http://akashm.com |
     akashmahajan@gmail.com | 9980527182

More Related Content

PDF
Secure wordpress
Prabesh Thapa
 
PPTX
Browser Security by pratimesh Pathak ( Buldhana)
Pratimesh Pathak
 
PPS
Flash Security
Ferruh Mavituna
 
PDF
Protect from ransomware
Muneeb Kalathil
 
PDF
QA Fest 2016. Per Thorsheim. Website security 101
QAFest
 
PPT
GFGC CHIKKABASUR (WEB BROWSER)
GOVT FIRST GRADE COLLEGE CHIKKABASUR
 
PPTX
Joomla! security jday2015
Shaiffulnizam Mohamad
 
PDF
8 Password Hygiene Tips to Protect You and Your Company
LogRhythm
 
Secure wordpress
Prabesh Thapa
 
Browser Security by pratimesh Pathak ( Buldhana)
Pratimesh Pathak
 
Flash Security
Ferruh Mavituna
 
Protect from ransomware
Muneeb Kalathil
 
QA Fest 2016. Per Thorsheim. Website security 101
QAFest
 
GFGC CHIKKABASUR (WEB BROWSER)
GOVT FIRST GRADE COLLEGE CHIKKABASUR
 
Joomla! security jday2015
Shaiffulnizam Mohamad
 
8 Password Hygiene Tips to Protect You and Your Company
LogRhythm
 

What's hot (8)

PPTX
Web security
Dosarrest007
 
PDF
Extending WordPress With Plugins
Evangelos Athanasiadis
 
PDF
HTTP Security Headers Every Java Developer Must Know
Ayoma Wijethunga
 
PPTX
Emerging Trends in Cybersecurity by Amar Prusty
Cysinfo Cyber Security Community
 
PDF
Browser Wars 2019 - Implementing a Content Security Policy
George Boobyer
 
PPTX
Bug Prevention of SQL Injection
Surabaya Blackhat
 
PPTX
HOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERS
Elsner Technologies Pvt Ltd
 
PPTX
Make money online with browsing
mahesh kumar
 
Web security
Dosarrest007
 
Extending WordPress With Plugins
Evangelos Athanasiadis
 
HTTP Security Headers Every Java Developer Must Know
Ayoma Wijethunga
 
Emerging Trends in Cybersecurity by Amar Prusty
Cysinfo Cyber Security Community
 
Browser Wars 2019 - Implementing a Content Security Policy
George Boobyer
 
Bug Prevention of SQL Injection
Surabaya Blackhat
 
HOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERS
Elsner Technologies Pvt Ltd
 
Make money online with browsing
mahesh kumar
 
Ad

Viewers also liked (12)

PDF
Csp and http headers
devObjective
 
PDF
List of useful security related http headers
한익 주
 
PDF
Security "for free" through HTTP headers
Andre N. Klingsheim
 
PDF
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
PPTX
[Wroclaw #2] Web Application Security Headers
OWASP
 
ODP
HTTP Strict Transport Security (HSTS), English version
Michal Špaček
 
PDF
Securing your web application through HTTP headers
Andre N. Klingsheim
 
PPT
WhiteHat Security Presentation
markgmeyer
 
PPTX
Analysis of HTTP Security Headers in Turkey
Dr. Emin İslam Tatlı
 
PDF
How to secure your web applications with NGINX
Wallarm
 
PDF
Security HTTP Headers
Chang Yu-Sheng
 
PPTX
Web Security - Cookies, Domains and CORS
Perfectial, LLC
 
Csp and http headers
devObjective
 
List of useful security related http headers
한익 주
 
Security "for free" through HTTP headers
Andre N. Klingsheim
 
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
[Wroclaw #2] Web Application Security Headers
OWASP
 
HTTP Strict Transport Security (HSTS), English version
Michal Špaček
 
Securing your web application through HTTP headers
Andre N. Klingsheim
 
WhiteHat Security Presentation
markgmeyer
 
Analysis of HTTP Security Headers in Turkey
Dr. Emin İslam Tatlı
 
How to secure your web applications with NGINX
Wallarm
 
Security HTTP Headers
Chang Yu-Sheng
 
Web Security - Cookies, Domains and CORS
Perfectial, LLC
 
Ad

Similar to Secure HTTP Headers c0c0n 2011 Akash Mahajan (20)

PDF
Tsc summit #2 - HTTP Header Security
Mikal Villa
 
PPTX
Browser Security ppt.pptx
AjaySahre
 
PPTX
HTTP basics in relation to Applicaiton Security - OWASP
Eoin Keary
 
PDF
DefCamp 2013 - Http header analysis
DefCamp
 
PDF
http security response headers for web security
Olatunji Adetunji
 
PPTX
Seguridad Corporativa Con Internet Explorer 8(1)
Microsoft Argentina y Uruguay [Official Space]
 
PPTX
A Practical Guide to Securing Modern Web Applications
Manish Shekhawat
 
PPT
IWMW 1999: Browser management
IWMW
 
PDF
HTTP_Header_Security.pdf
ksudhakarreddy5
 
PPTX
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
 
PPTX
Lesson 6 web based attacks
Frank Victory
 
PDF
Web Application Security 2nd Edition (Early Release) Andrew Hoffman
dirosochaniz
 
PDF
Web Application Security 2nd Edition (Early Release) Andrew Hoffman
haskgeilyn
 
PDF
SYN 321: Securing the Published Browser
Citrix
 
PPTX
Burp Suite is a powerful and widely-used tool
waudit1
 
PDF
Internet Explorer 8
Eduardo Castro
 
PPTX
HTML5 - The Promise & The Peril
Security Innovation
 
PPTX
Web browsertico
tico3195
 
PDF
Ch 3: Web Application Technologies
Sam Bowne
 
PPTX
Gopher & Search Engines.pptx
ApurvSingh65
 
Tsc summit #2 - HTTP Header Security
Mikal Villa
 
Browser Security ppt.pptx
AjaySahre
 
HTTP basics in relation to Applicaiton Security - OWASP
Eoin Keary
 
DefCamp 2013 - Http header analysis
DefCamp
 
http security response headers for web security
Olatunji Adetunji
 
Seguridad Corporativa Con Internet Explorer 8(1)
Microsoft Argentina y Uruguay [Official Space]
 
A Practical Guide to Securing Modern Web Applications
Manish Shekhawat
 
IWMW 1999: Browser management
IWMW
 
HTTP_Header_Security.pdf
ksudhakarreddy5
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
Darren Duke
 
Lesson 6 web based attacks
Frank Victory
 
Web Application Security 2nd Edition (Early Release) Andrew Hoffman
dirosochaniz
 
Web Application Security 2nd Edition (Early Release) Andrew Hoffman
haskgeilyn
 
SYN 321: Securing the Published Browser
Citrix
 
Burp Suite is a powerful and widely-used tool
waudit1
 
Internet Explorer 8
Eduardo Castro
 
HTML5 - The Promise & The Peril
Security Innovation
 
Web browsertico
tico3195
 
Ch 3: Web Application Technologies
Sam Bowne
 
Gopher & Search Engines.pptx
ApurvSingh65
 

More from Akash Mahajan (17)

PDF
On Writing Well - A talk given at WinjaBlogs Session
Akash Mahajan
 
PDF
App sec in the time of docker containers
Akash Mahajan
 
PPTX
Venom vulnerability Overview and a basic demo
Akash Mahajan
 
PPTX
Security in the cloud Workshop HSTC 2014
Akash Mahajan
 
ODP
INCOMPLETE - OUTLINE for RootConf 2014 - The little-servcie-which-wasn't-there
Akash Mahajan
 
PPTX
The real incident of stealing a droid app+data
Akash Mahajan
 
PPTX
Believe It Or Not SSL Attacks
Akash Mahajan
 
PPTX
I haz your mouse clicks and key strokes
Akash Mahajan
 
PPTX
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
PPTX
Php security
Akash Mahajan
 
PPTX
Secure passwords-theory-and-practice
Akash Mahajan
 
PDF
Top 10 web application security risks akash mahajan
Akash Mahajan
 
PDF
Web application security
Akash Mahajan
 
PPTX
Web application security
Akash Mahajan
 
PPTX
Web application security
Akash Mahajan
 
PPTX
Secure Programming In Php
Akash Mahajan
 
PPT
Startups Security
Akash Mahajan
 
On Writing Well - A talk given at WinjaBlogs Session
Akash Mahajan
 
App sec in the time of docker containers
Akash Mahajan
 
Venom vulnerability Overview and a basic demo
Akash Mahajan
 
Security in the cloud Workshop HSTC 2014
Akash Mahajan
 
INCOMPLETE - OUTLINE for RootConf 2014 - The little-servcie-which-wasn't-there
Akash Mahajan
 
The real incident of stealing a droid app+data
Akash Mahajan
 
Believe It Or Not SSL Attacks
Akash Mahajan
 
I haz your mouse clicks and key strokes
Akash Mahajan
 
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
Php security
Akash Mahajan
 
Secure passwords-theory-and-practice
Akash Mahajan
 
Top 10 web application security risks akash mahajan
Akash Mahajan
 
Web application security
Akash Mahajan
 
Web application security
Akash Mahajan
 
Web application security
Akash Mahajan
 
Secure Programming In Php
Akash Mahajan
 
Startups Security
Akash Mahajan
 

Recently uploaded (20)

PDF
Doc9.....................................
SofiaCollazos
 
PDF
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Doc9.....................................
SofiaCollazos
 
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 

Secure HTTP Headers c0c0n 2011 Akash Mahajan

  • 1. Secure HTTP Headers Akash Mahajan c0c0n 2011
  • 2. Agenda • Programmers should know about the new HTTP response headers • Web security testers should be testing for these response headers as defenses • All you Facebook/Google+ users should be aware of these as well
  • 3. Overview of the Talk • Cover all some of the new HTTP response headers • Cover which attacks are mitigated by using these headers • Build an case for upgrading to IE8/9, Firefox 5+ or Chrome if that is your type
  • 4. HTTP Response Headers • X-Frame-Options • X-XSS-Protection • X-Content-Type-Options • X-Content-Security-Policy • Set-Cookie – Secure – HttpOnly
  • 5. X-Frame-Options • Used to prevent Clickjacking • Doesn’t allow page to be rendered in a frame • DENY : Don’t render at all if inside a frame, SAMEORIGIN : Only if being served from the origin • IE8+, FF4+, Chrome5+
  • 6. X-XSS-Protection • Used to prevent reflected XSS • Doesn’t allow the page to be rendered if a reflected XSS attack is detected • 0 is off, 1 is on, Additional mode = block • IE8+, Chrome, No FF ( use noscript )
  • 7. X-Content-Type-Options • Used to prevent mime based attacks. • Browser will not try to figure out content type if not sent to it in the response header – An image uploading site with script code is bad • X-Content-Type-Options: nosniff • IE8+
  • 8. X-Content-Security-Policy: policy • Used to define a whitelist of domains and actions which are allowed. • Example usage – X-Content-Security-Policy: allow 'self'; img-src *; object-src media1.com media2.com; script-src userscripts.example.com; allow https://payments.example.com • FF4+
  • 9. Set-Cookie with Secure and HTTPOnly • With Secure keyword – Only allow cookie to travel with a secure connection – An attack where HTTP and HTTPs is mixed • With HTTPOnly keyword – Scripts can’t read the cookie – Any attack where session cookie is stolen • IE7+, Chrome12+, FF3+
  • 10. Compatibility with browsers MS Internet Google Mozilla Headers / Browsers Explorer Chrome Firefox X-Frame-Options YES YES YES X-XSS-Protection YES YES NO X-Content-Type-Options YES NO NO X-Content-Security-Policy NO NO YES Set-Cookie Secure HttpOnly YES YES YES This slide needs a lot more work. Specific versions, more browsers.
  • 11. A logical argument for upgrading IE • A ten year old browser ( IE6 ) just can’t keep up with the advanced web application attacks against users. The new crop of browsers are proactively adding support to stop the attacks at the browser level itself. • Microsoft runs a http://ie6countdown.com with a mission of moving the world off Internet Explorer 6
  • 12. Revisiting the attacks and headers • X-Frame-Options – Especially useful against clickjacking • X-XSS-Protection – Refelected XSS • X-Content-Type-Options – Mime attacks for executing malicious scripts
  • 13. Revisiting the attacks and headers • Set-Cookie – Secure • No sniffing of user session cookie – HttpOnly • Not allowing javascript to read the session cookie • X-Content-Security-Policy – Whitelisting of content domains for including in the page
  • 14. My info while I answer your questions Akash Mahajan That Web Application Security Guy – Web Application Security Consultant – null Co-Founder, Bangalore Chapter Lead – Certified Ethical Hacker @makash | http://akashm.com | [email protected] | 9980527182

Editor's Notes

  • #8: The onus of sending the correct content type is on the web app developer to ensure their css, script, generated image is rendered correctly