SlideShare une entreprise Scribd logo
1  sur  82
Photo: https://www.pinterest.ca/pin/176203404146573009/
Is it safe?
Essential security measures
in ASP.NET MVC
Rafał Hryniewski
@r_hryniewskifb.me/hryniewskinet
Agenda
• Glossary
• Should developer be responsible for security?
• OWASP Top 10
• A little bit more of security stuff
• Summary
• Questions
Glossary
• Vulnerability
• OWASP – Open Web Application Security Project
• CWE – Common Weakness Enumeration
• CVE - Common Vulnerability Enumeration
• ASVS – Application Security Verification Standard
Systems have vulnerabilities…
Photo: https://www.flickfilosopher.com/2010/06/doctor-who-blogging-the-lodger.html
…and some people have bad intentions
Photo: https://tookapic.com/photos/25299
“Oops” in security can cost fuckton of money…
Photo: https://www.youtube.com/watch?v=PJpr7L7N2Ho
…so security experts earn shitload of money
Photo: https://gif-free.com/278-breaking-bad-money.html
But do you need to be security expert to secure
your product?
Photo: http://favoritememes.com/news/mom_trust_me_i_m_a_professional/2014-07-29-395
TL;DR
Vid. https://www.youtube.com/watch?v=cAhvfRZZpPk
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
Injection
Photo:
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?
Injection - Example
var productName = "userInput";
var sql = "SELECT * FROM [dbo].[Products]
WHERE [Name] = '" + productName + "'";
Injection - Example
var productName = "userInput";
var sql = "SELECT * FROM [dbo].[Products]
WHERE [Name] = @productName";
var result =
ctx.Database.SqlQuery<Product>(sql,
new SqlParameter("productName",
productName))
.ToList();
Injection – Dos and don’ts
Do
• Validate inputs
• Whitelist inputs
• Use named parameters
• Use parametrized functions
and procedures
Don’t
• Trust exernal inputs
• Trust internal inputs
• Concatenate dynamic queries
and commands
• Use privileged accounts in
connection strings
Injection - Demo
Photo: http://fr.memegenerator.net/instance/46889228/mchammer-stop-demo-time
Broken authentication
Photo: http://skillprogramming.com/recent/you-entered-joe-smiths-password-may-be-your-email-is-joesmithgmailcom-1136832
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?
Broken authentication – Dos and don’ts
Do
• Require strong passwords
• Use Multi Factor
Authentication
• Check if password was
present in any data leak
(haveibeenpwned.com)
• Log and monitor
authentication failures
Don’t
• Allow for infinite sign in
attempts
• Send or display passwords in
any way
• Use long session timeouts
Broken authentication - demo
Photo: https://makeameme.org/meme/brace-yourself-demo
Sensitive Data Exposure
Photo: https://memegenerator.net/instance/74308018/what-if-i-told-you-what-if-i-told-you-ill-never-stop-talking-about-sensitive-data
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 – Dos and don’ts
Do
• Use HTTPS and HSTS
• Encrypt sensitive data
• Identify which data should be
considered sensitive
Don’t
• Store and/or send sensitive
data in plain text
• Allow for non-SSL browsing
• Use weak encryption
algorithms (SHA1 etc.)
XML External Entities
Photo: https://dev.to/rionmonster/hello-xml-my-old-friend-ive-come-to-encode-you-again-3iip
XML External Entities – are you vulnerable?
• Do you use XML at all?
• Do you sanitize your inputs?
• Do you use whitelists for input validations?
XML External Entities – Dos and don’ts
Do
• Use HTTPS and HSTS
• Encrypt sensitive data
• Know which data should be
considered sensitive
Don’t
• Store and/or send sensitive
data in plain text
• Allow for non-SSL browsing
• Use weak encryption
algorithms (SHA1 etc.)
Broken Access Control
Photo: https://imgflip.com/memetemplate/70001743/You-Shall-Not-Pass
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?
Broken Access Control – Dos and don’ts
Do
• Use role based access
control
• Handle permissions on
server-side
• Always check if someone is
allowed to do something
Don’t
• Think someone will never
guess your unsecured admin
route
• Allow changing of application
state to unauthorized user
Broken Access Control – demo
Photo: https://imgflip.com/i/21acb2
Security Misconfiguration
Photo: https://www.jeffgeerling.com/blogs/jeff-geerling/devops-server-deployment-and
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?
• Have you disabled security features because they were
annoying an d/or inconvenient?
• Does your application use any security headers?
Security Misconfiguration – Dos and don’ts
Do
• Remove or change any
default credentials
• Use accounts with least
needed privileges
• Use security headers
• Configure and turn on
framework/server/etc.
Security features
Don’t
• Use the same credentials on
test, dev and prod
environments
• Install or turn on any features
you don’t need
• Reveal error messages and
sensitive system informations
• Remove security features
because they bother you
Security Misconfiguration – examples
Security Misconfiguration – examples
Screenshot: https://packetstormsecurity.com/files/111277/Microsoft-ASP.NET-Forms-Authentication-Bypass.html
Security Misconfiguration – web.config examples
<customheaders>
<remove name="X-Powered-By" />
</customheaders>
<system.web>
<httpRuntime targetFramework="4.5" enableVersionHeader="false"/>
<httpCookies requireSSL="true"/>
</system.web>
Security Misconfiguration – global.asax examples
Security Misconfiguration – fixed!
Security Misconfiguration – or not!
Security Misconfiguration – always!
<customErrors mode=“On" />
Cross-Site Scripting (XSS)
Photo: https://memegenerator.net/instance/35924967/evil-doc-found-a-textbox-lets-try-script-alert-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?
XSS – Dos and don’ts
Do
• Sanitize/escape untrusted
inputs
• Use Content Security Policy
header
• Use X-XSS-Protection header
• Use HTTPOnly flag on
sensitive cookies that
shouldn’t be used by JS
Don’t
• Allow users to upload SVG
files, if necessary – sanitize
them.
• Render user provided HTML -
formatted strings
• Return ContentType –
text/html if it’s JSON
XSS – Stored XSS
Case when you store insecure values in some kind of persistent
storage and render it afterwards (ie. comments)
XSS – Reflected XSS
Case when you return and render some kind of user input back
(ie. Search results for phrase: ‘<script>alert(“XSS”)</script>’
XSS – demo
Insecure Deserialization
Photo: https://github.com/tgockel/json-voorhees/blob/master/README.md
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?
Insecure Deserialization – Dos and don’ts
Do
• Validate inputs
• Keep important data on the
backend
Don’t
• Send and receive mutable,
sensitive data.
• Compile and execute
received code on server side
Using Components with Known Vulnerabilities
Photo: https://devrant.com/rants/760537/heaviest-objects-in-the-universe
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?
Using Components with Known Vulnerabilities –
Dos and don’ts
Do
• Use automated tools like
retire.js
• Always look for vulnerabilities
in stuff you install
• Perform regular updates
Don’t
• Ignore new versions of
libraries you’re using
• Use obsolete components
Using Components with Known Vulnerabilities –
not scary?
Screenshot: https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2017/3214296
Insufficient Logging & Monitoring
Photo: https://apreed.wordpress.com/2018/04/13/day-136-discursive-essay-1-1984-pt-2-due-wed/amazing-all-the-things-meme-generator-the-roleplay-
cafe-roleplaying-and-writing-memes-just/
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?
Insufficient Logging & Monitoring– Dos and don’ts
Do
• Log any potential security
breaches or even attempts
• Use alerts
• Detect anomalies
Don’t
• Just store logs
• Wait for someone to read
gigabytes of logs
But it’s all simple stuff so far…
Screenshot: https://stackoverflow.com/questions/43249998/chrome-err-blocked-by-xss-auditor-details#
…and yet there’s still a lot of vulnerable
applications out there
Screenshot: https://stackoverflow.com/questions/43249998/chrome-err-blocked-by-xss-auditor-details#
Breaking stuff is easy because we haven’t made it
hard enough
Photo: http://www.dumpaday.com/funny-pictures/funny-i-dont-even-know-what-im-doing-30-pics/
More
Photo: http://knowyourmeme.com/memes/moar
HTTP Strict Transport Security
Photo: http://www.memegen.com/meme/g1sdfc
HTTP Strict Transport Security – Why?
• So, all your HTTP requests are redirected to HTTPS?
• But the first one is still not secure.
HTTP Strict Transport Security – what?
• It has great browser support and comes with preload list.
• All it takes is making your site secure and adding Strict-
Transport-Security header
• You can submit to preload list manually on
https://hstspreload.org
HTTP Strict Transport Security – Preload list
HTTP Strict Transport Security – Browser support
Content-Security-Policy
Photo: https://imgflip.com/i/pfov8
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
Content-Security-Policy – Browser Support for L1
Content-Security-Policy – Browser Support for L2
Preparation for security audit
Photo: https://imgflip.com/memegenerator
Application Security Verification Standard - ASVS
• ASVS on OWASP site
• 3 levels
• Also has versions for mobile apps, IoT
• Basically a big checklist
Some tools
• Kali Linux
• W3af
• Zed Attack Proxy
• Sqlmap
• XSS Rays(browser extension)
Summary
Photo: https://makeameme.org/meme/we-are-ready-xaufwk
Resources
• OWASP Top 10 Report
• ASVS
• CWE
• Troy Hunt
• Rozwal.to
Samples, links, slides
bit.ly/rh-sec-es
Questions?
Photo: https://imgur.com/gallery/sFBxW3i
@r_hryniewskifb.me/hryniewskinet

Contenu connexe

Tendances

OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersLewis Ardern
 
Automated Security Testing
Automated Security TestingAutomated Security Testing
Automated Security Testingseleniumconf
 
Manual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A BugManual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A BugLewis Ardern
 
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...Denim Group
 
Security guidelines
Security guidelinesSecurity guidelines
Security guidelineskarthz
 
CodeMash 2.0.1.5 - Practical iOS App Attack & Defense
CodeMash 2.0.1.5 - Practical iOS App Attack & DefenseCodeMash 2.0.1.5 - Practical iOS App Attack & Defense
CodeMash 2.0.1.5 - Practical iOS App Attack & DefenseSeth Law
 
[Wroclaw #5] OWASP Projects: beyond Top 10
[Wroclaw #5] OWASP Projects: beyond Top 10[Wroclaw #5] OWASP Projects: beyond Top 10
[Wroclaw #5] OWASP Projects: beyond Top 10OWASP
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Masoud Kalali
 
The Joy of Proactive Security
The Joy of Proactive SecurityThe Joy of Proactive Security
The Joy of Proactive SecurityAndy Hoernecke
 
Hacker Proof web app using Functional tests
Hacker Proof web  app using Functional testsHacker Proof web  app using Functional tests
Hacker Proof web app using Functional testsAnkita Gupta
 
Shmoocon 2015 - httpscreenshot
Shmoocon 2015 - httpscreenshotShmoocon 2015 - httpscreenshot
Shmoocon 2015 - httpscreenshotjstnkndy
 
[OWASP Poland Day] Application frameworks' vulnerabilities
[OWASP Poland Day] Application frameworks' vulnerabilities[OWASP Poland Day] Application frameworks' vulnerabilities
[OWASP Poland Day] Application frameworks' vulnerabilitiesOWASP
 
SecDevOps - The Operationalisation of Security
SecDevOps -  The Operationalisation of SecuritySecDevOps -  The Operationalisation of Security
SecDevOps - The Operationalisation of SecurityDinis Cruz
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best PracticesRobert Vidal
 
Client-Side Penetration Testing Presentation
Client-Side Penetration Testing PresentationClient-Side Penetration Testing Presentation
Client-Side Penetration Testing PresentationChris Gates
 
WTF is Penetration Testing
WTF is Penetration TestingWTF is Penetration Testing
WTF is Penetration TestingNetSPI
 
CactusCon - Practical iOS App Attack and Defense
CactusCon - Practical iOS App Attack and DefenseCactusCon - Practical iOS App Attack and Defense
CactusCon - Practical iOS App Attack and DefenseSeth Law
 
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay Bhargav
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay BhargavOWASP AppSec EU - SecDevOps, a view from the trenches - Abhay Bhargav
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay BhargavAbhay Bhargav
 
Web Application Security And Getting Into Bug Bounties
Web Application Security And Getting Into Bug BountiesWeb Application Security And Getting Into Bug Bounties
Web Application Security And Getting Into Bug Bountieskunwaratul hax0r
 
Web Application Penetration Testing - 101
Web Application Penetration Testing - 101Web Application Penetration Testing - 101
Web Application Penetration Testing - 101Andrea Hauser
 

Tendances (20)

OWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript DevelopersOWASP Portland - OWASP Top 10 For JavaScript Developers
OWASP Portland - OWASP Top 10 For JavaScript Developers
 
Automated Security Testing
Automated Security TestingAutomated Security Testing
Automated Security Testing
 
Manual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A BugManual JavaScript Analysis Is A Bug
Manual JavaScript Analysis Is A Bug
 
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...
The ABCs of Source-Assisted Web Application Penetration Testing With OWASP ZA...
 
Security guidelines
Security guidelinesSecurity guidelines
Security guidelines
 
CodeMash 2.0.1.5 - Practical iOS App Attack & Defense
CodeMash 2.0.1.5 - Practical iOS App Attack & DefenseCodeMash 2.0.1.5 - Practical iOS App Attack & Defense
CodeMash 2.0.1.5 - Practical iOS App Attack & Defense
 
[Wroclaw #5] OWASP Projects: beyond Top 10
[Wroclaw #5] OWASP Projects: beyond Top 10[Wroclaw #5] OWASP Projects: beyond Top 10
[Wroclaw #5] OWASP Projects: beyond Top 10
 
Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881Slides for the #JavaOne Session ID: CON11881
Slides for the #JavaOne Session ID: CON11881
 
The Joy of Proactive Security
The Joy of Proactive SecurityThe Joy of Proactive Security
The Joy of Proactive Security
 
Hacker Proof web app using Functional tests
Hacker Proof web  app using Functional testsHacker Proof web  app using Functional tests
Hacker Proof web app using Functional tests
 
Shmoocon 2015 - httpscreenshot
Shmoocon 2015 - httpscreenshotShmoocon 2015 - httpscreenshot
Shmoocon 2015 - httpscreenshot
 
[OWASP Poland Day] Application frameworks' vulnerabilities
[OWASP Poland Day] Application frameworks' vulnerabilities[OWASP Poland Day] Application frameworks' vulnerabilities
[OWASP Poland Day] Application frameworks' vulnerabilities
 
SecDevOps - The Operationalisation of Security
SecDevOps -  The Operationalisation of SecuritySecDevOps -  The Operationalisation of Security
SecDevOps - The Operationalisation of Security
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best Practices
 
Client-Side Penetration Testing Presentation
Client-Side Penetration Testing PresentationClient-Side Penetration Testing Presentation
Client-Side Penetration Testing Presentation
 
WTF is Penetration Testing
WTF is Penetration TestingWTF is Penetration Testing
WTF is Penetration Testing
 
CactusCon - Practical iOS App Attack and Defense
CactusCon - Practical iOS App Attack and DefenseCactusCon - Practical iOS App Attack and Defense
CactusCon - Practical iOS App Attack and Defense
 
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay Bhargav
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay BhargavOWASP AppSec EU - SecDevOps, a view from the trenches - Abhay Bhargav
OWASP AppSec EU - SecDevOps, a view from the trenches - Abhay Bhargav
 
Web Application Security And Getting Into Bug Bounties
Web Application Security And Getting Into Bug BountiesWeb Application Security And Getting Into Bug Bounties
Web Application Security And Getting Into Bug Bounties
 
Web Application Penetration Testing - 101
Web Application Penetration Testing - 101Web Application Penetration Testing - 101
Web Application Penetration Testing - 101
 

Similaire à Essential security measures in ASP.NET MVC

Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Michael Pirnat
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishMarkus Eisele
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFBrian Huff
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile WorldDavid Lindner
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a DatabaseJohn Ashmead
 
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins
 
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程Duran Hsieh
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecLalit Kale
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - TrivadisTechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - TrivadisTrivadis
 
Writing Secure SharePoint Code - SharePoint Saturday Toronto
Writing Secure SharePoint Code - SharePoint Saturday TorontoWriting Secure SharePoint Code - SharePoint Saturday Toronto
Writing Secure SharePoint Code - SharePoint Saturday TorontoEli Robillard
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Denim Group
 
Fragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppFragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppAppsecco
 
Top Azure security fails and how to avoid them
Top Azure security fails and how to avoid themTop Azure security fails and how to avoid them
Top Azure security fails and how to avoid themKarl Ots
 
Owasp tds
Owasp tdsOwasp tds
Owasp tdssnyff
 
Alexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementAlexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementDefconRussia
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrichdrewz lin
 
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017Philippe Gamache
 
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017 OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017 Philippe Gamache
 

Similaire à Essential security measures in ASP.NET MVC (20)

Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
Java EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFishJava EE 6 Security in practice with GlassFish
Java EE 6 Security in practice with GlassFish
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
 
AppSec in an Agile World
AppSec in an Agile WorldAppSec in an Agile World
AppSec in an Agile World
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a Database
 
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja WarriorsRyan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
Ryan Elkins - Simple Security Defense to Thwart an Army of Cyber Ninja Warriors
 
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程
DevSecOps 實踐與 GitHub 進階安全: 建立安全的開發流程
 
For Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSecFor Business's Sake, Let's focus on AppSec
For Business's Sake, Let's focus on AppSec
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - TrivadisTechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
TechEvent 2019: Security 101 für Web Entwickler; Roland Krüger - Trivadis
 
Writing Secure SharePoint Code - SharePoint Saturday Toronto
Writing Secure SharePoint Code - SharePoint Saturday TorontoWriting Secure SharePoint Code - SharePoint Saturday Toronto
Writing Secure SharePoint Code - SharePoint Saturday Toronto
 
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
Threat Modeling the CI/CD Pipeline to Improve Software Supply Chain Security ...
 
Fragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your AppFragments-Plug the vulnerabilities in your App
Fragments-Plug the vulnerabilities in your App
 
Top Azure security fails and how to avoid them
Top Azure security fails and how to avoid themTop Azure security fails and how to avoid them
Top Azure security fails and how to avoid them
 
Owasp tds
Owasp tdsOwasp tds
Owasp tds
 
Alexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implementAlexey Sintsov- SDLC - try me to implement
Alexey Sintsov- SDLC - try me to implement
 
Owasp2013 johannesullrich
Owasp2013 johannesullrichOwasp2013 johannesullrich
Owasp2013 johannesullrich
 
Security testing
Security testingSecurity testing
Security testing
 
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
 
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017 OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
 

Plus de Rafał Hryniewski

DevSecOps - security all the way
DevSecOps - security all the wayDevSecOps - security all the way
DevSecOps - security all the wayRafał Hryniewski
 
DevSecOps - Security all the way
DevSecOps - Security all the wayDevSecOps - Security all the way
DevSecOps - Security all the wayRafał Hryniewski
 
Large scale, distributed and reliable messaging with Kafka
Large scale, distributed and reliable messaging with KafkaLarge scale, distributed and reliable messaging with Kafka
Large scale, distributed and reliable messaging with KafkaRafał Hryniewski
 
Meet Gremlin – your guide through graphs in Cosmos DB
Meet Gremlin – your guide through graphs in Cosmos DBMeet Gremlin – your guide through graphs in Cosmos DB
Meet Gremlin – your guide through graphs in Cosmos DBRafał Hryniewski
 
Shit happens – achieve extensibility, modularity and loosely coupled architec...
Shit happens – achieve extensibility, modularity and loosely coupled architec...Shit happens – achieve extensibility, modularity and loosely coupled architec...
Shit happens – achieve extensibility, modularity and loosely coupled architec...Rafał Hryniewski
 
Public speaking - why am I doing this to myself and why you should too?
Public speaking - why am I doing this to myself and why you should too?Public speaking - why am I doing this to myself and why you should too?
Public speaking - why am I doing this to myself and why you should too?Rafał Hryniewski
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerRafał Hryniewski
 
ORM – The tip of an iceberg
ORM – The tip of an icebergORM – The tip of an iceberg
ORM – The tip of an icebergRafał Hryniewski
 
Quick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowQuick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowRafał Hryniewski
 

Plus de Rafał Hryniewski (17)

Azure messaging
Azure messagingAzure messaging
Azure messaging
 
Azure developer
Azure developerAzure developer
Azure developer
 
Great webapis
Great webapisGreat webapis
Great webapis
 
DevSecOps - security all the way
DevSecOps - security all the wayDevSecOps - security all the way
DevSecOps - security all the way
 
DevSecOps - Security all the way
DevSecOps - Security all the wayDevSecOps - Security all the way
DevSecOps - Security all the way
 
Anchor modeling
Anchor modelingAnchor modeling
Anchor modeling
 
Large scale, distributed and reliable messaging with Kafka
Large scale, distributed and reliable messaging with KafkaLarge scale, distributed and reliable messaging with Kafka
Large scale, distributed and reliable messaging with Kafka
 
Meet Gremlin – your guide through graphs in Cosmos DB
Meet Gremlin – your guide through graphs in Cosmos DBMeet Gremlin – your guide through graphs in Cosmos DB
Meet Gremlin – your guide through graphs in Cosmos DB
 
Shit happens – achieve extensibility, modularity and loosely coupled architec...
Shit happens – achieve extensibility, modularity and loosely coupled architec...Shit happens – achieve extensibility, modularity and loosely coupled architec...
Shit happens – achieve extensibility, modularity and loosely coupled architec...
 
Web app security essentials
Web app security essentialsWeb app security essentials
Web app security essentials
 
Public speaking - why am I doing this to myself and why you should too?
Public speaking - why am I doing this to myself and why you should too?Public speaking - why am I doing this to myself and why you should too?
Public speaking - why am I doing this to myself and why you should too?
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL Server
 
Blazor
BlazorBlazor
Blazor
 
Shodan
ShodanShodan
Shodan
 
.NET, Alexa and me
.NET, Alexa and me.NET, Alexa and me
.NET, Alexa and me
 
ORM – The tip of an iceberg
ORM – The tip of an icebergORM – The tip of an iceberg
ORM – The tip of an iceberg
 
Quick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to knowQuick trip around the Cosmos - Things every astronaut supposed to know
Quick trip around the Cosmos - Things every astronaut supposed to know
 

Dernier

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Dernier (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Essential security measures in ASP.NET MVC

  • 4.
  • 5.
  • 6.
  • 7. Agenda • Glossary • Should developer be responsible for security? • OWASP Top 10 • A little bit more of security stuff • Summary • Questions
  • 8. Glossary • Vulnerability • OWASP – Open Web Application Security Project • CWE – Common Weakness Enumeration • CVE - Common Vulnerability Enumeration • ASVS – Application Security Verification Standard
  • 9. Systems have vulnerabilities… Photo: https://www.flickfilosopher.com/2010/06/doctor-who-blogging-the-lodger.html
  • 10. …and some people have bad intentions Photo: https://tookapic.com/photos/25299
  • 11. “Oops” in security can cost fuckton of money… Photo: https://www.youtube.com/watch?v=PJpr7L7N2Ho
  • 12. …so security experts earn shitload of money Photo: https://gif-free.com/278-breaking-bad-money.html
  • 13. But do you need to be security expert to secure your product? Photo: http://favoritememes.com/news/mom_trust_me_i_m_a_professional/2014-07-29-395
  • 15. 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?
  • 18. Injection - Example var productName = "userInput"; var sql = "SELECT * FROM [dbo].[Products] WHERE [Name] = '" + productName + "'";
  • 19. Injection - Example var productName = "userInput"; var sql = "SELECT * FROM [dbo].[Products] WHERE [Name] = @productName"; var result = ctx.Database.SqlQuery<Product>(sql, new SqlParameter("productName", productName)) .ToList();
  • 20. Injection – Dos and don’ts Do • Validate inputs • Whitelist inputs • Use named parameters • Use parametrized functions and procedures Don’t • Trust exernal inputs • Trust internal inputs • Concatenate dynamic queries and commands • Use privileged accounts in connection strings
  • 21. Injection - Demo Photo: http://fr.memegenerator.net/instance/46889228/mchammer-stop-demo-time
  • 23. 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?
  • 24. Broken authentication – Dos and don’ts Do • Require strong passwords • Use Multi Factor Authentication • Check if password was present in any data leak (haveibeenpwned.com) • Log and monitor authentication failures Don’t • Allow for infinite sign in attempts • Send or display passwords in any way • Use long session timeouts
  • 25. Broken authentication - demo Photo: https://makeameme.org/meme/brace-yourself-demo
  • 26. Sensitive Data Exposure Photo: https://memegenerator.net/instance/74308018/what-if-i-told-you-what-if-i-told-you-ill-never-stop-talking-about-sensitive-data
  • 27. 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?
  • 28. Sensitive Data Exposure – Dos and don’ts Do • Use HTTPS and HSTS • Encrypt sensitive data • Identify which data should be considered sensitive Don’t • Store and/or send sensitive data in plain text • Allow for non-SSL browsing • Use weak encryption algorithms (SHA1 etc.)
  • 29. XML External Entities Photo: https://dev.to/rionmonster/hello-xml-my-old-friend-ive-come-to-encode-you-again-3iip
  • 30. XML External Entities – are you vulnerable? • Do you use XML at all? • Do you sanitize your inputs? • Do you use whitelists for input validations?
  • 31. XML External Entities – Dos and don’ts Do • Use HTTPS and HSTS • Encrypt sensitive data • Know which data should be considered sensitive Don’t • Store and/or send sensitive data in plain text • Allow for non-SSL browsing • Use weak encryption algorithms (SHA1 etc.)
  • 32. Broken Access Control Photo: https://imgflip.com/memetemplate/70001743/You-Shall-Not-Pass
  • 33. 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?
  • 34. Broken Access Control – Dos and don’ts Do • Use role based access control • Handle permissions on server-side • Always check if someone is allowed to do something Don’t • Think someone will never guess your unsecured admin route • Allow changing of application state to unauthorized user
  • 35. Broken Access Control – demo Photo: https://imgflip.com/i/21acb2
  • 37. 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? • Have you disabled security features because they were annoying an d/or inconvenient? • Does your application use any security headers?
  • 38. Security Misconfiguration – Dos and don’ts Do • Remove or change any default credentials • Use accounts with least needed privileges • Use security headers • Configure and turn on framework/server/etc. Security features Don’t • Use the same credentials on test, dev and prod environments • Install or turn on any features you don’t need • Reveal error messages and sensitive system informations • Remove security features because they bother you
  • 40. Security Misconfiguration – examples Screenshot: https://packetstormsecurity.com/files/111277/Microsoft-ASP.NET-Forms-Authentication-Bypass.html
  • 41. Security Misconfiguration – web.config examples <customheaders> <remove name="X-Powered-By" /> </customheaders> <system.web> <httpRuntime targetFramework="4.5" enableVersionHeader="false"/> <httpCookies requireSSL="true"/> </system.web>
  • 42. Security Misconfiguration – global.asax examples
  • 45. Security Misconfiguration – always! <customErrors mode=“On" />
  • 46. Cross-Site Scripting (XSS) Photo: https://memegenerator.net/instance/35924967/evil-doc-found-a-textbox-lets-try-script-alert-xss
  • 47. 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?
  • 48. XSS – Dos and don’ts Do • Sanitize/escape untrusted inputs • Use Content Security Policy header • Use X-XSS-Protection header • Use HTTPOnly flag on sensitive cookies that shouldn’t be used by JS Don’t • Allow users to upload SVG files, if necessary – sanitize them. • Render user provided HTML - formatted strings • Return ContentType – text/html if it’s JSON
  • 49. XSS – Stored XSS Case when you store insecure values in some kind of persistent storage and render it afterwards (ie. comments)
  • 50. XSS – Reflected XSS Case when you return and render some kind of user input back (ie. Search results for phrase: ‘<script>alert(“XSS”)</script>’
  • 53. 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?
  • 54. Insecure Deserialization – Dos and don’ts Do • Validate inputs • Keep important data on the backend Don’t • Send and receive mutable, sensitive data. • Compile and execute received code on server side
  • 55. Using Components with Known Vulnerabilities Photo: https://devrant.com/rants/760537/heaviest-objects-in-the-universe
  • 56. 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?
  • 57. Using Components with Known Vulnerabilities – Dos and don’ts Do • Use automated tools like retire.js • Always look for vulnerabilities in stuff you install • Perform regular updates Don’t • Ignore new versions of libraries you’re using • Use obsolete components
  • 58. Using Components with Known Vulnerabilities – not scary? Screenshot: https://docs.microsoft.com/en-us/security-updates/SecurityAdvisories/2017/3214296
  • 59. Insufficient Logging & Monitoring Photo: https://apreed.wordpress.com/2018/04/13/day-136-discursive-essay-1-1984-pt-2-due-wed/amazing-all-the-things-meme-generator-the-roleplay- cafe-roleplaying-and-writing-memes-just/
  • 60. 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?
  • 61. Insufficient Logging & Monitoring– Dos and don’ts Do • Log any potential security breaches or even attempts • Use alerts • Detect anomalies Don’t • Just store logs • Wait for someone to read gigabytes of logs
  • 62. But it’s all simple stuff so far… Screenshot: https://stackoverflow.com/questions/43249998/chrome-err-blocked-by-xss-auditor-details#
  • 63. …and yet there’s still a lot of vulnerable applications out there Screenshot: https://stackoverflow.com/questions/43249998/chrome-err-blocked-by-xss-auditor-details#
  • 64. Breaking stuff is easy because we haven’t made it hard enough Photo: http://www.dumpaday.com/funny-pictures/funny-i-dont-even-know-what-im-doing-30-pics/
  • 66. HTTP Strict Transport Security Photo: http://www.memegen.com/meme/g1sdfc
  • 67. HTTP Strict Transport Security – Why? • So, all your HTTP requests are redirected to HTTPS? • But the first one is still not secure.
  • 68. HTTP Strict Transport Security – what? • It has great browser support and comes with preload list. • All it takes is making your site secure and adding Strict- Transport-Security header • You can submit to preload list manually on https://hstspreload.org
  • 69. HTTP Strict Transport Security – Preload list
  • 70. HTTP Strict Transport Security – Browser support
  • 72. 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
  • 75. Preparation for security audit Photo: https://imgflip.com/memegenerator
  • 76. Application Security Verification Standard - ASVS • ASVS on OWASP site • 3 levels • Also has versions for mobile apps, IoT • Basically a big checklist
  • 77. Some tools • Kali Linux • W3af • Zed Attack Proxy • Sqlmap • XSS Rays(browser extension)
  • 79. Resources • OWASP Top 10 Report • ASVS • CWE • Troy Hunt • Rozwal.to