SlideShare a Scribd company logo
Web app security essentials
Web app security essentials
Süddeutsche Zeitung
 German for South German Newspaper
 One of the largest german daily newspapers
 Created in 1945
 In early 2015 they received ~ 2.6TB dataset. After over one year of research first
stories was published and scandal was named Panama Papers
Panama papers leak
 Leaked from Mossack Fonseca
 11.5 million documents dated back as far as 1970s
 Over 200 000 offshore entities
 Researched by 107 media organizations in 80 countries
 Hundreds of famous names appeared in leak (ie. Donald Trump, Emma Watson,
Stanley Kubrick, Willian Borges da Silva, Jackie Chan)
 Over 1 200 000 000 USD recouped after 3 years
 Investigations started in over 80 countries
Web app security essentials
Known vulnerabilities
 Three year old, vulnerable version of Drupal
 Oracle fork of Apache which allowed to access directory structure by default
 Insecure network architecture
 Some part of site was running on Wordpress with vulnerable plugin
 Part of CMS was vulnerable to SQL Injection
Web app security essentials
Essential Security Measures in Web
Applications
Rafał Hryniewski
@r_hryniewski
fb.me/hryniewskinet
.NET Dev
Blogger
Speaker
Community leader
https://hryniewski.net
rafal@hryniewski.net
Web app security essentials
Essential Security Measures in Web
Applications
Agenda
 What could happen if you’re careless
 Most common vulnerabilities
 Some easy ways to defend your applications
 Web application security FAQ
Web app security essentials
OWASP Top 10 - 2017
1. Injection
2. Broken Authentication
3. Sensitive Data Exposure
4. XML External Entities (XXE)
5. Broken Access Control
6. Security Misconfiguration
7. Cross-Site Scripting (XSS)
8. Insecure Deserialization
9. Using Components with Known Vulnerabilities
10. Insufficient Logging & Monitoring
Web app security essentials
1. Injection
Injection – Are you vulnerable?
 Do you concatenate strings in order to build database queries or OS commands?
 Does your ORM protect you from injection?
 Do you validate internal and external inputs?
2. Broken authentication
Broken authentication – are you
vulnerable?
 Do you have any brute force protection on sign in form?
 Do you indicate that account exists while someone post wrong password?
 Is it possible to steal your session token? Does EVERY request goes through
HTTPS?
 Are your session cookies protected with secure flag?
 Do you use multi factor authentication?
 How long is your session timeout?
3. Sensitive Data Exposure
Sensitive Data Exposure – are you
vulnerable?
 Can any request be made without encryption?
 Do you store any sensitive and not encrypted data?
 Do you use obsolete and weak cryptography algorithms?
Sensitive Data Exposure – how it
should’ve been done
4. XML External Entities
XML External Entities – are you
vulnerable?
 Do you use XML at all?
 Do you sanitize your inputs?
 Do you use whitelists for input validations?
5. Broken Access Control
Broken Access Control – are you
vulnerable?
 Are you checking permissions at all?
 Do you handle permissions on frontend?
 Can you access endpoints you shouldn’t by modifying URLs or cookies?
6. Security Misconfiguration
Security Misconfiguration – are you
vulnerable?
 Do you have any default accounts active?
 Is it possible to see error and stack traces in your application when exception
happen?
 Did you disabled security features because they were annoying and/or
inconvenient?
 Does your application use any security headers?
7. Cross-Site Scripting (XSS)
XSS – are you vulnerable?
 Does your application return values like „Results for phrase X”?
 Do you store text with HTML tags for display purposes?
 Can I upload SVG file to your system and it’ll render it?
 Do you sanitize your inputs?
8. Insecure Deserialization
Insecure Deserialization – are you
vulnerable?
 Can you change sensitive application state or behavior (ie. Authorization) by
sending modified, serialized value?
 Can you modify type in which object will deserialize?
 Do you validate field types after deserialization?
9. Using Components with Known
Vulnerabilities
9. Using Components with Known
Vulnerabilities – are you vulnerable?
 Did you ever check you components against vulnerabilities?
 Do you use updated libraries and frameworks?
 Do you use automated tools for checking components you’re using?
 Do you know EXACTLY what are ALL dependencies of your application?
10. Insufficient Logging & Monitoring
Insufficient Logging & Monitoring – are
you vulnerable?
 Will you know when someone will try to bruteforce your users password?
 Do you use any kind of anomaly detection?
 Do you need to read your logs to know about attempts to breach your security or
you’ll receive instant alert?
Web app security essentials
Web app security essentials
OWASP ASVS - Application Security
Verification Standard
 Basically a security requirements checklist
 Divided into 3 levels
 ASVS Level 1 is for low assurance levels, and is completely penetration testable
 ASVS Level 2 is for applications that contain sensitive data, which requires
protection and is the recommended level for most apps
 ASVS Level 3 is for the most critical applications - applications that perform high
value transactions, contain sensitive medical data, or any application that requires
the highest level of trust.
 https://github.com/OWASP/ASVS/raw/master/4.0/OWASP%20Application%20Sec
urity%20Verification%20Standard%204.0-en.pdf
CVE – Common Vulnerabilities and
Exposures
 Knowledge base about common, existing vulnerabilities
 https://cve.mitre.org/
 https://www.cvedetails.com/
Web app security essentials
Web app security essentials
HSTS
If you have HTTPS redirect/rewrite
 All your requests are redirected to secure domain…
 …but first request still doesn’t have SSL
HTTP Strict Transport Security (HSTS)
 There is a preload list present in most browsers
 You can submit to preload list manually on https://hstspreload.org
 All it takes is making your site secure and adding Strict-Transport-Security header
Web app security essentials
HSTS uses Internal Redirect (307)
Web app security essentials
CSP – Content Security Policy
Content-Security-Policy
 A lot of various directives ie. Whitelisting script or styles files sources, upgrading
insecure urls, hide referrer etc.
 Allows to report CSP violations by HTTP request
 Directives reference - https://content-security-policy.com
scripts.js
Web app security essentials
Add CSP header
Content-Security-Policy: default-src 'self'
Web app security essentials
Add reporting
Content-Security-Policy: default-src 'self'; report-uri https://rhtest.report-
uri.com/r/d/csp/enforce
Web app security essentials
Add whitelist
Content-Security-Policy: default-src 'self’;
script-src 'self' code.angularjs.org;
style-src 'self' 'unsafe-inline’;
img-src 'self' via.placeholder.com;
connect-src 'self' jsonplaceholder.typicode.com;
report-uri https://rhtest.report-uri.com/r/d/csp/enforce
Web app security essentials
Report only
Content-Security-Policy-Report-Only: default-src 'self’;
script-src 'self' code.angularjs.org;
style-src 'self' 'unsafe-inline’;
img-src 'self' via.placeholder.com;
connect-src 'self' jsonplaceholder.typicode.com;
report-uri https://rhtest.report-uri.com/r/d/csp/enforce
Web app security essentials
Web app security essentials
Web app security essentials
Web app security essentials
Web app security essentials
Auditing npm dependencies
npm audit
Web app security essentials
Auditing nuget dependencies
Install-Package SafeNuGet
Auditing Container dependencies
Use private registry with automated auditing
Web app security essentials
Web app security essentials
Circle1.svg
Circle2.svg
Web app security essentials
Circle3.svg
Web app security essentials
Circle3.svg
Web app security essentials
Web app security essentials
Web app security essentials
Default passwords
Don’t expose info about your system
Web app security essentials
Web app security essentials
Web app security essentials
Some basic tools
 Kali Linux
 W3af
 Zed Attack Proxy
 Sqlmap
 XSS Rays(browser extension)
Resources
 OWASP Top 10 Report
 ASVS
 CWE
 Troy Hunt
 Rozwal.to
 Michał Bentkowski - "XSS - why is it noteworthy? - live hacking“
 Peter Kim - The Hacker Playbook 3: Practical Guide To Penetration Testing
Web app security essentials
Why would someone attack my website?
When should I worry about security?
Are automated tests good enough?
Should I fix all vulnerabilities?
How to ensure safety of my application
and organization?
What’s a bug bounty?
bit.ly/rh-websec
Questions?
@r_hryniewskifb.me/hryniewskinet

More Related Content

PPT
Owasp Top 10 - Owasp Pune Chapter - January 2008
PPTX
Application Security Vulnerabilities: OWASP Top 10 -2007
PDF
OWASP Top 10 - 2017
PDF
Web Application Security and Awareness
PPTX
Web Application Security 101
PPTX
4 . future uni presentation
PPTX
A5: Security Misconfiguration
PPTX
Owasp top 10 security threats
Owasp Top 10 - Owasp Pune Chapter - January 2008
Application Security Vulnerabilities: OWASP Top 10 -2007
OWASP Top 10 - 2017
Web Application Security and Awareness
Web Application Security 101
4 . future uni presentation
A5: Security Misconfiguration
Owasp top 10 security threats

What's hot (20)

PDF
Web Application Security 101
PDF
Introduction to Security Testing
PPTX
security misconfigurations
PDF
Web App Security Presentation by Ryan Holland - 05-31-2017
PDF
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
PDF
A5-Security misconfiguration-OWASP 2013
PPTX
3. backup file artifacts - mazin ahmed
PPTX
Web application security
PPTX
OWASP Top 10 Vulnerabilities 2017- AppTrana
PPTX
Basics of getting Into Bug Bounty Hunting
PPT
Ethical hacking-ppt-download4575
PDF
owasp_meetup_12_10
PDF
The New OWASP Top Ten: Let's Cut to the Chase
PPTX
Ethical Hacking
PPTX
Introduction to security testing
PDF
Security in the cloud protecting your cloud apps
PPT
Computer security and malware by shahzad younas
PDF
OWASP Top 10 and Securing Rails - Sean Todd - PayNearMe.com
PPTX
Owasp top 10 vulnerabilities
PDF
Complete Ethical Hacking Course | Ethical Hacking Training for Beginners | Ed...
Web Application Security 101
Introduction to Security Testing
security misconfigurations
Web App Security Presentation by Ryan Holland - 05-31-2017
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
A5-Security misconfiguration-OWASP 2013
3. backup file artifacts - mazin ahmed
Web application security
OWASP Top 10 Vulnerabilities 2017- AppTrana
Basics of getting Into Bug Bounty Hunting
Ethical hacking-ppt-download4575
owasp_meetup_12_10
The New OWASP Top Ten: Let's Cut to the Chase
Ethical Hacking
Introduction to security testing
Security in the cloud protecting your cloud apps
Computer security and malware by shahzad younas
OWASP Top 10 and Securing Rails - Sean Todd - PayNearMe.com
Owasp top 10 vulnerabilities
Complete Ethical Hacking Course | Ethical Hacking Training for Beginners | Ed...
Ad

Similar to Web app security essentials (20)

ODP
Break it while you make it: writing (more) secure software
PDF
Secure coding guidelines
PPT
Andrews whitakrer lecture18-security.ppt
PPTX
Continuous security testing - sharing responsibility
PDF
Web Security
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
PPT
Cyber security
PDF
PPT
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
DOCX
Unit 5 Web Application and Hacking Techniques.docx
PPTX
Security Threats and Vulnerabilities-2.pptx
PPT
Survey Presentation About Application Security
PPTX
Application security
PDF
Top 20 certified ethical hacker interview questions and answer
PPTX
Development lifecycle and principals of Security
PPTX
OWASP -Top 5 Jagjit
PPTX
PDF
Best Practices for Developing Secure Web Applications
PDF
Web Application Penetration Testing
PDF
How to Secure Web Apps — A Web App Security Checklist
Break it while you make it: writing (more) secure software
Secure coding guidelines
Andrews whitakrer lecture18-security.ppt
Continuous security testing - sharing responsibility
Web Security
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Cyber security
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Unit 5 Web Application and Hacking Techniques.docx
Security Threats and Vulnerabilities-2.pptx
Survey Presentation About Application Security
Application security
Top 20 certified ethical hacker interview questions and answer
Development lifecycle and principals of Security
OWASP -Top 5 Jagjit
Best Practices for Developing Secure Web Applications
Web Application Penetration Testing
How to Secure Web Apps — A Web App Security Checklist
Ad

More from Rafał Hryniewski (17)

PDF
Azure messaging
PDF
Azure developer
PDF
Great webapis
PPTX
DevSecOps - security all the way
PPTX
DevSecOps - Security all the way
PPTX
Anchor modeling
PPTX
Large scale, distributed and reliable messaging with Kafka
PPTX
Meet Gremlin – your guide through graphs in Cosmos DB
PPTX
Shit happens – achieve extensibility, modularity and loosely coupled architec...
PPTX
Public speaking - why am I doing this to myself and why you should too?
PPTX
Azure SQL - more or/and less than SQL Server
PPTX
PPTX
PPTX
Essential security measures in ASP.NET MVC
PPTX
.NET, Alexa and me
PPTX
ORM – The tip of an iceberg
PPTX
Quick trip around the Cosmos - Things every astronaut supposed to know
Azure messaging
Azure developer
Great webapis
DevSecOps - security all the way
DevSecOps - Security all the way
Anchor modeling
Large scale, distributed and reliable messaging with Kafka
Meet Gremlin – your guide through graphs in Cosmos DB
Shit happens – achieve extensibility, modularity and loosely coupled architec...
Public speaking - why am I doing this to myself and why you should too?
Azure SQL - more or/and less than SQL Server
Essential security measures in ASP.NET MVC
.NET, Alexa and me
ORM – The tip of an iceberg
Quick trip around the Cosmos - Things every astronaut supposed to know

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Machine learning based COVID-19 study performance prediction
PDF
KodekX | Application Modernization Development
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
MIND Revenue Release Quarter 2 2025 Press Release
Machine learning based COVID-19 study performance prediction
KodekX | Application Modernization Development
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25 Week I
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation

Web app security essentials

  • 3. Süddeutsche Zeitung  German for South German Newspaper  One of the largest german daily newspapers  Created in 1945  In early 2015 they received ~ 2.6TB dataset. After over one year of research first stories was published and scandal was named Panama Papers
  • 4. Panama papers leak  Leaked from Mossack Fonseca  11.5 million documents dated back as far as 1970s  Over 200 000 offshore entities  Researched by 107 media organizations in 80 countries  Hundreds of famous names appeared in leak (ie. Donald Trump, Emma Watson, Stanley Kubrick, Willian Borges da Silva, Jackie Chan)  Over 1 200 000 000 USD recouped after 3 years  Investigations started in over 80 countries
  • 6. Known vulnerabilities  Three year old, vulnerable version of Drupal  Oracle fork of Apache which allowed to access directory structure by default  Insecure network architecture  Some part of site was running on Wordpress with vulnerable plugin  Part of CMS was vulnerable to SQL Injection
  • 8. Essential Security Measures in Web Applications
  • 9. Rafał Hryniewski @r_hryniewski fb.me/hryniewskinet .NET Dev Blogger Speaker Community leader https://hryniewski.net rafal@hryniewski.net
  • 11. Essential Security Measures in Web Applications
  • 12. Agenda  What could happen if you’re careless  Most common vulnerabilities  Some easy ways to defend your applications  Web application security FAQ
  • 14. OWASP Top 10 - 2017 1. Injection 2. Broken Authentication 3. Sensitive Data Exposure 4. XML External Entities (XXE) 5. Broken Access Control 6. Security Misconfiguration 7. Cross-Site Scripting (XSS) 8. Insecure Deserialization 9. Using Components with Known Vulnerabilities 10. Insufficient Logging & Monitoring
  • 17. Injection – Are you vulnerable?  Do you concatenate strings in order to build database queries or OS commands?  Does your ORM protect you from injection?  Do you validate internal and external inputs?
  • 19. Broken authentication – are you vulnerable?  Do you have any brute force protection on sign in form?  Do you indicate that account exists while someone post wrong password?  Is it possible to steal your session token? Does EVERY request goes through HTTPS?  Are your session cookies protected with secure flag?  Do you use multi factor authentication?  How long is your session timeout?
  • 20. 3. Sensitive Data Exposure
  • 21. Sensitive Data Exposure – are you vulnerable?  Can any request be made without encryption?  Do you store any sensitive and not encrypted data?  Do you use obsolete and weak cryptography algorithms?
  • 22. Sensitive Data Exposure – how it should’ve been done
  • 23. 4. XML External Entities
  • 24. XML External Entities – are you vulnerable?  Do you use XML at all?  Do you sanitize your inputs?  Do you use whitelists for input validations?
  • 25. 5. Broken Access Control
  • 26. Broken Access Control – are you vulnerable?  Are you checking permissions at all?  Do you handle permissions on frontend?  Can you access endpoints you shouldn’t by modifying URLs or cookies?
  • 28. Security Misconfiguration – are you vulnerable?  Do you have any default accounts active?  Is it possible to see error and stack traces in your application when exception happen?  Did you disabled security features because they were annoying and/or inconvenient?  Does your application use any security headers?
  • 30. XSS – are you vulnerable?  Does your application return values like „Results for phrase X”?  Do you store text with HTML tags for display purposes?  Can I upload SVG file to your system and it’ll render it?  Do you sanitize your inputs?
  • 32. Insecure Deserialization – are you vulnerable?  Can you change sensitive application state or behavior (ie. Authorization) by sending modified, serialized value?  Can you modify type in which object will deserialize?  Do you validate field types after deserialization?
  • 33. 9. Using Components with Known Vulnerabilities
  • 34. 9. Using Components with Known Vulnerabilities – are you vulnerable?  Did you ever check you components against vulnerabilities?  Do you use updated libraries and frameworks?  Do you use automated tools for checking components you’re using?  Do you know EXACTLY what are ALL dependencies of your application?
  • 35. 10. Insufficient Logging & Monitoring
  • 36. Insufficient Logging & Monitoring – are you vulnerable?  Will you know when someone will try to bruteforce your users password?  Do you use any kind of anomaly detection?  Do you need to read your logs to know about attempts to breach your security or you’ll receive instant alert?
  • 39. OWASP ASVS - Application Security Verification Standard  Basically a security requirements checklist  Divided into 3 levels  ASVS Level 1 is for low assurance levels, and is completely penetration testable  ASVS Level 2 is for applications that contain sensitive data, which requires protection and is the recommended level for most apps  ASVS Level 3 is for the most critical applications - applications that perform high value transactions, contain sensitive medical data, or any application that requires the highest level of trust.  https://github.com/OWASP/ASVS/raw/master/4.0/OWASP%20Application%20Sec urity%20Verification%20Standard%204.0-en.pdf
  • 40. CVE – Common Vulnerabilities and Exposures  Knowledge base about common, existing vulnerabilities  https://cve.mitre.org/  https://www.cvedetails.com/
  • 43. HSTS
  • 44. If you have HTTPS redirect/rewrite  All your requests are redirected to secure domain…  …but first request still doesn’t have SSL
  • 45. HTTP Strict Transport Security (HSTS)  There is a preload list present in most browsers  You can submit to preload list manually on https://hstspreload.org  All it takes is making your site secure and adding Strict-Transport-Security header
  • 47. HSTS uses Internal Redirect (307)
  • 49. CSP – Content Security Policy
  • 50. Content-Security-Policy  A lot of various directives ie. Whitelisting script or styles files sources, upgrading insecure urls, hide referrer etc.  Allows to report CSP violations by HTTP request  Directives reference - https://content-security-policy.com
  • 55. Add reporting Content-Security-Policy: default-src 'self'; report-uri https://rhtest.report- uri.com/r/d/csp/enforce
  • 57. Add whitelist Content-Security-Policy: default-src 'self’; script-src 'self' code.angularjs.org; style-src 'self' 'unsafe-inline’; img-src 'self' via.placeholder.com; connect-src 'self' jsonplaceholder.typicode.com; report-uri https://rhtest.report-uri.com/r/d/csp/enforce
  • 59. Report only Content-Security-Policy-Report-Only: default-src 'self’; script-src 'self' code.angularjs.org; style-src 'self' 'unsafe-inline’; img-src 'self' via.placeholder.com; connect-src 'self' jsonplaceholder.typicode.com; report-uri https://rhtest.report-uri.com/r/d/csp/enforce
  • 68. Auditing Container dependencies Use private registry with automated auditing
  • 81. Don’t expose info about your system
  • 85. Some basic tools  Kali Linux  W3af  Zed Attack Proxy  Sqlmap  XSS Rays(browser extension)
  • 86. Resources  OWASP Top 10 Report  ASVS  CWE  Troy Hunt  Rozwal.to  Michał Bentkowski - "XSS - why is it noteworthy? - live hacking“  Peter Kim - The Hacker Playbook 3: Practical Guide To Penetration Testing
  • 88. Why would someone attack my website?
  • 89. When should I worry about security?
  • 90. Are automated tests good enough?
  • 91. Should I fix all vulnerabilities?
  • 92. How to ensure safety of my application and organization?
  • 93. What’s a bug bounty?