SlideShare uma empresa Scribd logo
1 de 14
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

Mais conteúdo relacionado

Mais procurados

Browser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security PolicyBrowser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security Policy
George Boobyer
 

Mais procurados (9)

Web security
Web securityWeb security
Web security
 
Introduction to Modern Identity with Auth0's Developer
 Introduction to Modern Identity with Auth0's Developer Introduction to Modern Identity with Auth0's Developer
Introduction to Modern Identity with Auth0's Developer
 
Extending WordPress With Plugins
Extending WordPress With PluginsExtending WordPress With Plugins
Extending WordPress With Plugins
 
HTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must KnowHTTP Security Headers Every Java Developer Must Know
HTTP Security Headers Every Java Developer Must Know
 
Emerging Trends in Cybersecurity by Amar Prusty
Emerging Trends in Cybersecurity by Amar PrustyEmerging Trends in Cybersecurity by Amar Prusty
Emerging Trends in Cybersecurity by Amar Prusty
 
Browser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security PolicyBrowser Wars 2019 - Implementing a Content Security Policy
Browser Wars 2019 - Implementing a Content Security Policy
 
Bug Prevention of SQL Injection
Bug Prevention of SQL InjectionBug Prevention of SQL Injection
Bug Prevention of SQL Injection
 
HOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERS
HOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERSHOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERS
HOW TO PROTECT YOUR WORDPRESS WEBSITE FROM HACKERS
 
Make money online with browsing
Make money online with browsingMake money online with browsing
Make money online with browsing
 

Destaque

Security "for free" through HTTP headers
Security "for free" through HTTP headersSecurity "for free" through HTTP headers
Security "for free" through HTTP headers
Andre N. Klingsheim
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
Frank Kim
 
[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers
OWASP
 

Destaque (12)

Csp and http headers
Csp and http headersCsp and http headers
Csp and http headers
 
List of useful security related http headers
List of useful security related http headersList of useful security related http headers
List of useful security related http headers
 
Security "for free" through HTTP headers
Security "for free" through HTTP headersSecurity "for free" through HTTP headers
Security "for free" through HTTP headers
 
Protecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP HeadersProtecting Java EE Web Apps with Secure HTTP Headers
Protecting Java EE Web Apps with Secure HTTP Headers
 
[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers[Wroclaw #2] Web Application Security Headers
[Wroclaw #2] Web Application Security Headers
 
HTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English versionHTTP Strict Transport Security (HSTS), English version
HTTP Strict Transport Security (HSTS), English version
 
Securing your web application through HTTP headers
Securing your web application through HTTP headersSecuring your web application through HTTP headers
Securing your web application through HTTP headers
 
WhiteHat Security Presentation
WhiteHat Security PresentationWhiteHat Security Presentation
WhiteHat Security Presentation
 
Analysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in TurkeyAnalysis of HTTP Security Headers in Turkey
Analysis of HTTP Security Headers in Turkey
 
How to secure your web applications with NGINX
How to secure your web applications with NGINXHow to secure your web applications with NGINX
How to secure your web applications with NGINX
 
Security HTTP Headers
Security HTTP HeadersSecurity HTTP Headers
Security HTTP Headers
 
Web Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORSWeb Security - Cookies, Domains and CORS
Web Security - Cookies, Domains and CORS
 

Semelhante a Secure HTTP Headers c0c0n 2011 Akash Mahajan

15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt
shatrutrial44
 

Semelhante a Secure HTTP Headers c0c0n 2011 Akash Mahajan (20)

10 things I’ve learnt about web application security
10 things I’ve learnt about web application security10 things I’ve learnt about web application security
10 things I’ve learnt about web application security
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitation
 
Browser security — ROOTS
Browser security — ROOTSBrowser security — ROOTS
Browser security — ROOTS
 
Future of Web Security Opened up by CSP
Future of Web Security Opened up by CSPFuture of Web Security Opened up by CSP
Future of Web Security Opened up by CSP
 
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) HackableCollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
 
http security response headers for web security
http security response headers for web securityhttp security response headers for web security
http security response headers for web security
 
15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt15_526_topic11 for topics for students.ppt
15_526_topic11 for topics for students.ppt
 
Http only cookie
Http only cookieHttp only cookie
Http only cookie
 
Devouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site ScriptingDevouring Security Insufficient data validation risks Cross Site Scripting
Devouring Security Insufficient data validation risks Cross Site Scripting
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
 
14_526_topic11.ppt
14_526_topic11.ppt14_526_topic11.ppt
14_526_topic11.ppt
 
Hacking Google Chrome OS
Hacking Google Chrome OSHacking Google Chrome OS
Hacking Google Chrome OS
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
Attacking Web Proxies
Attacking Web ProxiesAttacking Web Proxies
Attacking Web Proxies
 
Tsc summit #2 - HTTP Header Security
Tsc summit #2  - HTTP Header SecurityTsc summit #2  - HTTP Header Security
Tsc summit #2 - HTTP Header Security
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
Chrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasuresChrome extensions threat analysis and countermeasures
Chrome extensions threat analysis and countermeasures
 
HTML5 - The Promise & The Peril
HTML5 - The Promise & The PerilHTML5 - The Promise & The Peril
HTML5 - The Promise & The Peril
 
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
Why Traditional Web Security Technologies no Longer Suffice to Keep You SafeWhy Traditional Web Security Technologies no Longer Suffice to Keep You Safe
Why Traditional Web Security Technologies no Longer Suffice to Keep You Safe
 
Rails and Content Security Policies
Rails and Content Security PoliciesRails and Content Security Policies
Rails and Content Security Policies
 

Mais de Akash Mahajan

Hackers versus Developers and Secure Web Programming
Hackers versus Developers and Secure Web ProgrammingHackers versus Developers and Secure Web Programming
Hackers versus Developers and Secure Web Programming
Akash Mahajan
 
Web application security
Web application securityWeb application security
Web application security
Akash Mahajan
 
Web application security
Web application securityWeb application security
Web application security
Akash Mahajan
 
Web application security
Web application securityWeb application security
Web application security
Akash Mahajan
 

Mais de Akash Mahajan (17)

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

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

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 | akashmahajan@gmail.com | 9980527182

Notas do Editor

  1. The onus of sending the correct content type is on the web app developer to ensure their css, script, generated image is rendered correctly