SlideShare a Scribd company logo
1 of 17
Demystifying CSP
Ilya Nesterov, Shape Security
mailto: ilya@nesterov.us
@ilya_online
What does CSP stand for?
Content Security Policy (CSP) - a mechanism web
applications can use to mitigate a broad class of
content injection vulnerabilities, such as XSS.
CSP Level 1
CSP Level 1
• Policy delivery via HTTP header only
• Multiple CSP headers allowed
• Sandbox directive is optional
• script-src governs workers
CSP Level 2
New in CSP Level 2
• Policy delivery via <meta>
• New directives: child-src, form-action, frame-
ancestors, base-uri, plugin-types
• Source-expression supports hash and nonce
• host-source can use path for matching
• SecurityPolicyViolationEvent
• Extended violation report
• child-src governs workers
CSP Level 3
New in CSP Level 3
• New directives: manifest-src, worker-src,
report-to, block-mixed-content, upgrade-
insecure-requests, require-sri-for
• frame-src undeprecated
• New in source-expression: 'strict-dynamic'
• Changes in url and source-expression matching
algorithms
• Additional changes to violation reports
Browser compatibility CSP level 1
Browser compatibility CSP level 2
CSP directives compatibility matrix
Alexa top 1 000 000 data
• 1 000 000 sites landing pages
• 4515 sites have CSP policies
• 2339 individual policies
• 116 sites have CSP-RO (25 policies)
• 986 sites send violation reports
• 1323 sites use only frame-ancestors
• 102 upgrade-insecure-requests
CSP policies closer look
Alexa top 1 000 000 data
• 72.7% CSP (default-src OR script-src AND
object-src)
• 7.52% CSP (no unsafe-inline)
–1.84% whitelist via nonce/hash
• 3.04% CSP (nonce/hash + unsafe inline)
How to build good CSP
• Define default-src or script-src and object-src
• Say NO to ‘unsafe-inline’
• Whitelist via nonce/hash
• Narrow down whitelist
• strict-dynamic
• Get continuous feedback via violation reports
CSP what is next?
• Decrease deployment friction:
–‘strict-dynamic’
–middleware to build CSP automatically
–support for legacy software (LB, RP)
• Faster adoption of new standards by
Browsers
• Education and documentation
• More tools!
Resources:
• https://cspvalidator.org
• https://csp-evaluator.withgoogle.com/
• https://csp.withgoogle.com
• https://github.com/shapesecurity/salvation
• https://report-uri.io
• https://www.w3.org/TR/CSP3/
• https://www.w3.org/2011/webappsec/

More Related Content

What's hot

Apache mod security 3.1
Apache mod security   3.1Apache mod security   3.1
Apache mod security 3.1Hai Dinh Tuan
 
QA: Базовое тестирование защищенности веб-приложений в рамках QA
QA: Базовое тестирование защищенности веб-приложений в рамках QAQA: Базовое тестирование защищенности веб-приложений в рамках QA
QA: Базовое тестирование защищенности веб-приложений в рамках QACodeFest
 
Non-Invasive Elimination of Logical Access Control Vulnerabilities in Web A...
Non-Invasive Elimination of  Logical Access Control  Vulnerabilities in Web A...Non-Invasive Elimination of  Logical Access Control  Vulnerabilities in Web A...
Non-Invasive Elimination of Logical Access Control Vulnerabilities in Web A...Denis Kolegov
 
Introducción a la Arquitectura de OpenLaszlo
Introducción a la Arquitectura de OpenLaszloIntroducción a la Arquitectura de OpenLaszlo
Introducción a la Arquitectura de OpenLaszloGuillermo Pizarro
 
امنیت پایگاه داده MongoDB
امنیت پایگاه داده MongoDBامنیت پایگاه داده MongoDB
امنیت پایگاه داده MongoDBAminM17
 
PHP-MySQl Connectivity
PHP-MySQl ConnectivityPHP-MySQl Connectivity
PHP-MySQl Connectivitymehta_preeti
 
OWASP Top Ten 2017
OWASP Top Ten 2017OWASP Top Ten 2017
OWASP Top Ten 2017chw
 

What's hot (8)

Apache mod security 3.1
Apache mod security   3.1Apache mod security   3.1
Apache mod security 3.1
 
QA: Базовое тестирование защищенности веб-приложений в рамках QA
QA: Базовое тестирование защищенности веб-приложений в рамках QAQA: Базовое тестирование защищенности веб-приложений в рамках QA
QA: Базовое тестирование защищенности веб-приложений в рамках QA
 
Non-Invasive Elimination of Logical Access Control Vulnerabilities in Web A...
Non-Invasive Elimination of  Logical Access Control  Vulnerabilities in Web A...Non-Invasive Elimination of  Logical Access Control  Vulnerabilities in Web A...
Non-Invasive Elimination of Logical Access Control Vulnerabilities in Web A...
 
Introducción a la Arquitectura de OpenLaszlo
Introducción a la Arquitectura de OpenLaszloIntroducción a la Arquitectura de OpenLaszlo
Introducción a la Arquitectura de OpenLaszlo
 
امنیت پایگاه داده MongoDB
امنیت پایگاه داده MongoDBامنیت پایگاه داده MongoDB
امنیت پایگاه داده MongoDB
 
PHP-MySQl Connectivity
PHP-MySQl ConnectivityPHP-MySQl Connectivity
PHP-MySQl Connectivity
 
Web application security
Web application securityWeb application security
Web application security
 
OWASP Top Ten 2017
OWASP Top Ten 2017OWASP Top Ten 2017
OWASP Top Ten 2017
 

Viewers also liked

Managing Offshore Software Development
Managing Offshore Software DevelopmentManaging Offshore Software Development
Managing Offshore Software Developmentbicer
 
Surfer en toute legalite sur le net
Surfer en toute legalite sur le netSurfer en toute legalite sur le net
Surfer en toute legalite sur le netAAT's
 
Content Security Policy
Content Security PolicyContent Security Policy
Content Security PolicyRyan LaBouve
 
Content Security Policy - Lessons learned at Yahoo
Content Security Policy - Lessons learned at YahooContent Security Policy - Lessons learned at Yahoo
Content Security Policy - Lessons learned at YahooBinu Ramakrishnan
 
Preventing XSS with Content Security Policy
Preventing XSS with Content Security PolicyPreventing XSS with Content Security Policy
Preventing XSS with Content Security PolicyKsenia Peguero
 
Formation expliquer internet et la loi par Vincent Ruy
Formation expliquer internet et la loi par Vincent Ruy Formation expliquer internet et la loi par Vincent Ruy
Formation expliquer internet et la loi par Vincent Ruy RUY
 
W3C Content Security Policy
W3C Content Security PolicyW3C Content Security Policy
W3C Content Security PolicyMarkus Wichmann
 
Getting Browsers to Improve the Security of Your Webapp
Getting Browsers to Improve the Security of Your WebappGetting Browsers to Improve the Security of Your Webapp
Getting Browsers to Improve the Security of Your WebappFrancois Marier
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity George Boobyer
 
Health Care Project Testing Process
Health Care Project Testing ProcessHealth Care Project Testing Process
Health Care Project Testing ProcessH2Kinfosys
 
Health Care Domain & Testing Challenges
Health Care Domain & Testing ChallengesHealth Care Domain & Testing Challenges
Health Care Domain & Testing ChallengesMindfire Solutions
 
Testing in the healthcare domain
Testing in the healthcare domainTesting in the healthcare domain
Testing in the healthcare domainQAI Global
 
Healthcare domain PPT
Healthcare domain PPTHealthcare domain PPT
Healthcare domain PPTDivya Tadi
 
Web Security Automation: Spend Less Time Securing your Applications
 	  Web Security Automation: Spend Less Time Securing your Applications 	  Web Security Automation: Spend Less Time Securing your Applications
Web Security Automation: Spend Less Time Securing your ApplicationsAmazon Web Services
 
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...CNIL ..
 
Intervention CNIL : droit des internautes et obligations des e-marchands
Intervention CNIL : droit des internautes et obligations des e-marchandsIntervention CNIL : droit des internautes et obligations des e-marchands
Intervention CNIL : droit des internautes et obligations des e-marchandsNet Design
 

Viewers also liked (19)

Managing Offshore Software Development
Managing Offshore Software DevelopmentManaging Offshore Software Development
Managing Offshore Software Development
 
Surfer en toute legalite sur le net
Surfer en toute legalite sur le netSurfer en toute legalite sur le net
Surfer en toute legalite sur le net
 
Content Security Policy
Content Security PolicyContent Security Policy
Content Security Policy
 
Web Apps Security
Web Apps SecurityWeb Apps Security
Web Apps Security
 
Content Security Policy - Lessons learned at Yahoo
Content Security Policy - Lessons learned at YahooContent Security Policy - Lessons learned at Yahoo
Content Security Policy - Lessons learned at Yahoo
 
Preventing XSS with Content Security Policy
Preventing XSS with Content Security PolicyPreventing XSS with Content Security Policy
Preventing XSS with Content Security Policy
 
Formation expliquer internet et la loi par Vincent Ruy
Formation expliquer internet et la loi par Vincent Ruy Formation expliquer internet et la loi par Vincent Ruy
Formation expliquer internet et la loi par Vincent Ruy
 
Content security policy
Content security policyContent security policy
Content security policy
 
W3C Content Security Policy
W3C Content Security PolicyW3C Content Security Policy
W3C Content Security Policy
 
Getting Browsers to Improve the Security of Your Webapp
Getting Browsers to Improve the Security of Your WebappGetting Browsers to Improve the Security of Your Webapp
Getting Browsers to Improve the Security of Your Webapp
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity
 
Health Care Project Testing Process
Health Care Project Testing ProcessHealth Care Project Testing Process
Health Care Project Testing Process
 
Health Care Domain & Testing Challenges
Health Care Domain & Testing ChallengesHealth Care Domain & Testing Challenges
Health Care Domain & Testing Challenges
 
Testing in the healthcare domain
Testing in the healthcare domainTesting in the healthcare domain
Testing in the healthcare domain
 
Healthcare domain PPT
Healthcare domain PPTHealthcare domain PPT
Healthcare domain PPT
 
Web Security Automation: Spend Less Time Securing your Applications
 	  Web Security Automation: Spend Less Time Securing your Applications 	  Web Security Automation: Spend Less Time Securing your Applications
Web Security Automation: Spend Less Time Securing your Applications
 
Security HTTP Headers
Security HTTP HeadersSecurity HTTP Headers
Security HTTP Headers
 
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...
BAROMETRE 2016 | Les pratiques numériques et la maîtrise des données personne...
 
Intervention CNIL : droit des internautes et obligations des e-marchands
Intervention CNIL : droit des internautes et obligations des e-marchandsIntervention CNIL : droit des internautes et obligations des e-marchands
Intervention CNIL : droit des internautes et obligations des e-marchands
 

Similar to Demystifying CSP: An SEO-Optimized Guide

How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?Ksenia Peguero
 
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 CSPMuneaki Nishimura
 
Code-Camp-Rest-Principles
Code-Camp-Rest-PrinciplesCode-Camp-Rest-Principles
Code-Camp-Rest-PrinciplesKnoldus Inc.
 
Railsplitter: Simplify Your CRUD
Railsplitter: Simplify Your CRUDRailsplitter: Simplify Your CRUD
Railsplitter: Simplify Your CRUDFlurry, Inc.
 
Azure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalkAzure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalkShailesh Dwivedi
 
A project on spring framework by rohit malav
A project on spring framework by rohit malavA project on spring framework by rohit malav
A project on spring framework by rohit malavRohit malav
 
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...Vietnam Open Infrastructure User Group
 
Introduction to the COAR Notify project
Introduction to the COAR Notify projectIntroduction to the COAR Notify project
Introduction to the COAR Notify projectPaul Walk
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAnswerModules
 
Openstack Summit: Networking and policies across Containers and VMs
Openstack Summit: Networking and policies across Containers and VMsOpenstack Summit: Networking and policies across Containers and VMs
Openstack Summit: Networking and policies across Containers and VMsSanjeev Rampal
 
Achieve AI-Powered API Privacy using Open Source
Achieve AI-Powered API Privacy using Open SourceAchieve AI-Powered API Privacy using Open Source
Achieve AI-Powered API Privacy using Open SourceGianluca Brigandi
 
microservice architecture public education v2
microservice architecture public education v2microservice architecture public education v2
microservice architecture public education v2uEngine Solutions
 
Evolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service meshEvolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service meshChristian Posta
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling ResolutionDEEPAK KHETAWAT
 

Similar to Demystifying CSP: An SEO-Optimized Guide (20)

Web Security - CSP & Web Cryptography
Web Security - CSP & Web CryptographyWeb Security - CSP & Web Cryptography
Web Security - CSP & Web Cryptography
 
How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?How do JavaScript frameworks impact the security of applications?
How do JavaScript frameworks impact the security of applications?
 
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
 
Code-Camp-Rest-Principles
Code-Camp-Rest-PrinciplesCode-Camp-Rest-Principles
Code-Camp-Rest-Principles
 
About HTTP and REST
About HTTP and RESTAbout HTTP and REST
About HTTP and REST
 
Railsplitter: Simplify Your CRUD
Railsplitter: Simplify Your CRUDRailsplitter: Simplify Your CRUD
Railsplitter: Simplify Your CRUD
 
Azure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalkAzure API Manegement Introduction and Integeration with BizTalk
Azure API Manegement Introduction and Integeration with BizTalk
 
A project on spring framework by rohit malav
A project on spring framework by rohit malavA project on spring framework by rohit malav
A project on spring framework by rohit malav
 
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...
Room 1 - 6 - Trần Quốc Sang - Autoscaling for multi cloud platform based on S...
 
Introduction to the COAR Notify project
Introduction to the COAR Notify projectIntroduction to the COAR Notify project
Introduction to the COAR Notify project
 
Micro service architecture
Micro service architectureMicro service architecture
Micro service architecture
 
Rajasekhar Raju
Rajasekhar RajuRajasekhar Raju
Rajasekhar Raju
 
REST != WebAPI
REST != WebAPIREST != WebAPI
REST != WebAPI
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuite
 
Openstack Summit: Networking and policies across Containers and VMs
Openstack Summit: Networking and policies across Containers and VMsOpenstack Summit: Networking and policies across Containers and VMs
Openstack Summit: Networking and policies across Containers and VMs
 
Achieve AI-Powered API Privacy using Open Source
Achieve AI-Powered API Privacy using Open SourceAchieve AI-Powered API Privacy using Open Source
Achieve AI-Powered API Privacy using Open Source
 
microservice architecture public education v2
microservice architecture public education v2microservice architecture public education v2
microservice architecture public education v2
 
Evolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service meshEvolution of integration and microservices patterns with service mesh
Evolution of integration and microservices patterns with service mesh
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Rest and Sling Resolution
Rest and Sling ResolutionRest and Sling Resolution
Rest and Sling Resolution
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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)wesley chun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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 Processorsdebabhi2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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.pdfUK Journal
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 

Demystifying CSP: An SEO-Optimized Guide

  • 1. Demystifying CSP Ilya Nesterov, Shape Security mailto: ilya@nesterov.us @ilya_online
  • 2. What does CSP stand for? Content Security Policy (CSP) - a mechanism web applications can use to mitigate a broad class of content injection vulnerabilities, such as XSS.
  • 4. CSP Level 1 • Policy delivery via HTTP header only • Multiple CSP headers allowed • Sandbox directive is optional • script-src governs workers
  • 6. New in CSP Level 2 • Policy delivery via <meta> • New directives: child-src, form-action, frame- ancestors, base-uri, plugin-types • Source-expression supports hash and nonce • host-source can use path for matching • SecurityPolicyViolationEvent • Extended violation report • child-src governs workers
  • 8. New in CSP Level 3 • New directives: manifest-src, worker-src, report-to, block-mixed-content, upgrade- insecure-requests, require-sri-for • frame-src undeprecated • New in source-expression: 'strict-dynamic' • Changes in url and source-expression matching algorithms • Additional changes to violation reports
  • 12. Alexa top 1 000 000 data • 1 000 000 sites landing pages • 4515 sites have CSP policies • 2339 individual policies • 116 sites have CSP-RO (25 policies) • 986 sites send violation reports • 1323 sites use only frame-ancestors • 102 upgrade-insecure-requests
  • 14. Alexa top 1 000 000 data • 72.7% CSP (default-src OR script-src AND object-src) • 7.52% CSP (no unsafe-inline) –1.84% whitelist via nonce/hash • 3.04% CSP (nonce/hash + unsafe inline)
  • 15. How to build good CSP • Define default-src or script-src and object-src • Say NO to ‘unsafe-inline’ • Whitelist via nonce/hash • Narrow down whitelist • strict-dynamic • Get continuous feedback via violation reports
  • 16. CSP what is next? • Decrease deployment friction: –‘strict-dynamic’ –middleware to build CSP automatically –support for legacy software (LB, RP) • Faster adoption of new standards by Browsers • Education and documentation • More tools!
  • 17. Resources: • https://cspvalidator.org • https://csp-evaluator.withgoogle.com/ • https://csp.withgoogle.com • https://github.com/shapesecurity/salvation • https://report-uri.io • https://www.w3.org/TR/CSP3/ • https://www.w3.org/2011/webappsec/

Editor's Notes

  1. CSP 1.1 working draft latest 11 February 2014 https://www.w3.org/TR/2014/WD-CSP11-20140211/ which evolved to CSP level 2
  2. CSP level 1 - 11 November 2012
  3. CSP level 2 - 21 July 2015
  4. CSP level 3 - 13 September 2016 (latest working draft)
  5. CSP level 1 is supported by major browsers, but it the issue is that CSP 1 missing support whitelisting inline scripts by nonce and hash which makes integrations hard for sites. Also as we discussed before it is missing many others important features. So let’s take a look on CSP level 2 browser compatibility matrix.
  6. So, as you can see CSP level 2 support is missing or not fully implemented in many browsers. Despite it is fully supported in Chrome (which is great), but in summary other browsers have good piece of market, which we can see do not fully support CSP 2. But it is not that bad! The great news, that main pieces, like support for hash and digest in source expression and delivery in meta element is implemented in almost all browsers (new iOS and mac OS will close that spot or already closed,), but as all we know devil is in the details.
  7. Many applications deployed for different domains like com, net .us etc and have the same policies, so I have to deduplicate them in a data set to not pollute results 116 sites have CSP-RO (25 individual non empty policy) and only 23 have report-uri Only 986 sites want’s to analyze their policy violation reports, but when you drill down it came to 746 individual policies which uses 418 different endpoints Another interesting data point is frame-ancestors directive which seems getting more attention because of better flexibility (you can whitelist different origins). Remember that this is CSP2 directive and is not supported by all browsers, so if you look on how many of sites have similar X-frame-options-data you’ll get following