SlideShare uma empresa Scribd logo
1 de 44
Baixar para ler offline
Web Security
A Primer for Web App DevelopersJune 21, 2017
Mike North
Fluent Conf
© 2017, Mike Works, Inc. All Rights Reserved
Web Security MICHAEL L NORTH
Addepar
Apple
Buffer
Checkmate
Dollar Shave
Club
Ericsson
Facebook
Freshbooks
Github
Google
Heroku
Intercom
Iora Health
LinkedIn
Microsoft
Netflix
Pagerduty
Pivotshare
Practice Fusion
Thoughtbot
Ticketfly
Travis-CI
Tumblr
Twitch
Yahoo
Zenefits
Teaching developers from…
Web Security MICHAEL L NORTH
We have a BIG problem
• Features & Deadlines vs. Security
• Web Developers have fallen behind
• Attacks are escalating in severity
• Barriers to staging an attack are lower than ever
Web Security MICHAEL L NORTH
Our Strawman
Strawbank
mike@mike.works
Checking ****7890 $10,000
Savings ****1234 $8,000
ACCOUNTS TRANSFERS
http://strawbank.com • Cookie-based "session"
authentication
• List of accounts
• Ability to lookup other
accounts & transfer funds
Web Security MICHAEL L NORTH
The Hacks
NETWORK
Man in the middle
HTTPS downgrading via SSLStrip
CLIENT SIDE ATTACKS
XSS
CSRF
Clickjacking
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Starbucks WiFi
HTTP HTTP
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Public WiFi: Trusted forever by default
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
WiFi Devices broadcast what they're looking for
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Router as DNS
Web Security
ATTACK
MICHAEL L NORTH
DNS Hijacking
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Starbucks WiFi
Airport Free WiFi
💥 💥 💥
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
WiFi Pineapple
• Linux
• 2x Wifi Cards
• High gain antennas
• "App store"
2000mw WiFi
9dB antenna
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Web Security
ATTACK
MICHAEL L NORTH
Man in the middle
Web Security MICHAEL L NORTH
Let's say you've locked down WiFi
Web Security
ATTACK
MICHAEL L NORTH
Femtocell
📱
📱
📱
📱
Web Security
DEFENSE
MICHAEL L NORTH
Man in the middle
Strawbank
mike@mike.works
Checking ****7890 $10,000
Savings ****1234 $8,000
ACCOUNTS TRANSFERS
https://strawbank.com🔒
• TLS not SSL
• Private key needed to read or
alter request/response
• Getting a cert requires
"Domain Validation"
Web Security MICHAEL L NORTH
~56% of the web uses HTTPS
% of
page
loads
over
HTTPS
Time
Web Security
ATTACK
MICHAEL L NORTH
Man in the Middle II
Web Security MICHAEL L NORTH
[1] https://arstechnica.com/security/2009/07/benign-security-warnings-have-trained-users-to-ignore-them/
[2] https://adrifelt.github.io/sslinterstitial-chi.pdf
[3] http://lorrie.cranor.org/pubs/bridging-gap-warnings.pdf
After extensive data-driven improvement to
Chrome warning messages, 42% of users ignore
them instead of over 70% [2]
42%
51%
Over 50% of users don't understand
eavesdropping vs. malware risk factors [3]
44%
"...at least 44 percent of the top 382,860
SSL-enabled websites had certificates that
would trigger warnings" [1]
Web Security
ATTACK
MICHAEL L NORTH
SSLStrip
🔒 HTTPS 🔒 HTTPS
🔒 HTTPSHTTP
Strawbank
Begins with downgrade to HTTP
Web Security
ATTACK
MICHAEL L NORTH
SSLStrip
🔒 HTTPS
🔒 HTTPSHTTP
Strawbank
Client continues with HTTP, Server is unaware
HTTP
Web Security
DEFENSE
MICHAEL L NORTH
HTTP Strict Transport Security
Strict-Transport-Security: max-age=31536000; includeSubDomains
Do not allow plain HTTP
• Failure to include subdomains permits a broad range of cookie-
related attacks
• There's still the issue of the first request
Web Security
DEFENSE
MICHAEL L NORTH
HSTS Preload
Web Security
DEFENSE
MICHAEL L NORTH
HSTS WARNING
DEFENSE
Web Security
WARNING
MICHAEL L NORTH
Treat Certificates With Care!
Web Security
WARNING
MICHAEL L NORTH
Treat Certificates With Care!
Web Security
WARNING
MICHAEL L NORTH
Treat Certificates With Care!
Web Security MICHAEL L NORTH
The Hacks
NETWORK
Man in the middle
HTTPS downgrading via SSLStrip
CLIENT SIDE ATTACKS
XSS
CSRF
Clickjacking
Web Security
ATTACK
MICHAEL L NORTH
Cross-Site Scripting (XSS)
Strawbank
mike@mike.works
ACCOUNTS TRANSFERS
From Acct
To Acct
Mike's Checking
Amount $8500
Transfer Funds
https://strawbank.com🔒
Lisa's Savings
<select>
<option value="1">
Mike's Checking
!</option>
<option value="2">
Lisa's Savings
!</option>
<option value="3">
Elliot's Checking
<script src="https:"//""...totally-fine.js
!</option>
!</select>
Web Security
ATTACK
MICHAEL L NORTH
Cross Site Scripting (XSS)
Web Security
DEFENSE
MICHAEL L NORTH
Cross-Site Scripting (XSS)
Strawbank
mike@mike.works
ACCOUNTS TRANSFERS
From Acct
To Acct
Mike's Checking
Amount $8500
Transfer Funds
https://strawbank.com🔒
<script src="http:
• Escape all user input
• Use a view layer that has
thorough built-in XSS
protection
• Don't forget about styles too!
<img src="javascript:alert('XSS!')"!/>
Web Security
WARNING
MICHAEL L NORTH
Cross-Site Scripting (XSS)
• How confident are you in the XSS protection of your OSS libraries?
• How carefully do people scrutinize browser plugins?
• If XSS happens, what's your exposure?
Web Security
ATTACK
MICHAEL L NORTH
Embedded Malware
Web Security
ATTACK
MICHAEL L NORTH
Embedded Malware
Web Security
DEFENSE
MICHAEL L NORTH
Embedded Malware
Never trust user-generated content
• Optimize all images (nearly always drops non-visual content)
• Avoid spreading "raw" attachments
• Limit file types for uploads
• Don't permit arbitrary HTML input
• Whitelist content that can be embedded
Web Security
ATTACK
MICHAEL L NORTH
Cross-Site Request Forgery
Strawbank
mike@mike.works
ACCOUNTS TRANSFERS
From Acct
To Acct
Mike's Checking
Amount $8500
Transfer Funds
https://strawbank.com🔒
Lisa's Savings
<form name="badform" method="post"
action="https:"//strawbank.com/api/transfer">
<input type="hidden"
name="destination" value="2" !/>
<input type="hidden"
name="amount" value="8500" !/>
!</form>
<script type="text/javascript">
document.badform.submit();
!</script>
Web Security
ATTACK
MICHAEL L NORTH
Cross-Site Request Forgery
• Exclusively targets state-changing requests
• Exploits browser "automatically" sending credentials
• A good reason to conform to RESTful HTTP verbs
• POST requests are also susceptible
<img src="https:"//strawbank.com/api/transfer?amount=8500&destination=12345">
Web Security
DEFENSE
MICHAEL L NORTH
Cross-Site Request Forgery
• Only Basic or cookie authentication schemes are vulnerable
• Exception: "Client side cookie"
• CSRF Token - non-predictable and per-request
• Ensure CORS headers are appropriately restrictive
Web Security
ATTACK
MICHAEL L NORTH
Clickjacking
https://strawbank.com-securebank.cc?tok=108...🔒
Proceed
StrawCard
You're approved!Strawbank
mike@mike.works
ACCOUNTS TRANSFERS
From Acct
To Acct
Mike's Checking
Amount $8500
Transfer Funds
https://strawbank.com?amount=8500&dest=185...🔒
Lisa's Savings
Web Security
DEFENSE
MICHAEL L NORTH
Clickjacking
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM https:"//strawbank.com/
Web Security MICHAEL L NORTH
The Hacks
NETWORK
Man in the middle
HTTPS downgrading via SSLStrip
CLIENT SIDE ATTACKS
XSS
CSRF
Clickjacking
Web Security MICHAEL L NORTH
But Wait""...There's more.
• SQL Injection
• Timing attacks
• Resource depletion attacks
• Session hijacking
• Execution after redirect
• Log Injection attacks
• Content Security Policy (CSP)
• Cache Poisoning
• Subresource Integrity (SRI)
• Sandboxing untrusted content
• Preventing attack escalation
• Encryption at rest: best practices
Web Security MICHAEL L NORTH
Thanks!
Want to know more?
Ask me about a
security workshop

Mais conteúdo relacionado

Mais procurados

Web Security and Network Security
Web Security and Network SecurityWeb Security and Network Security
Web Security and Network Security
crussell79
 
Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-keary
drewz lin
 

Mais procurados (20)

Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)Top Ten Web Hacking Techniques (2008)
Top Ten Web Hacking Techniques (2008)
 
News Bytes - December 2015
News Bytes - December 2015News Bytes - December 2015
News Bytes - December 2015
 
Introduction to Web Server Security
Introduction to Web Server SecurityIntroduction to Web Server Security
Introduction to Web Server Security
 
Introduction to web security @ confess 2012
Introduction to web security @ confess 2012Introduction to web security @ confess 2012
Introduction to web security @ confess 2012
 
Starwest 2008
Starwest 2008Starwest 2008
Starwest 2008
 
4.Xss
4.Xss4.Xss
4.Xss
 
Web security
Web securityWeb security
Web security
 
Web Security and Network Security
Web Security and Network SecurityWeb Security and Network Security
Web Security and Network Security
 
Attack chaining for web exploitation
Attack chaining for web exploitationAttack chaining for web exploitation
Attack chaining for web exploitation
 
Hacking the Web
Hacking the WebHacking the Web
Hacking the Web
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by Default
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
Web Security
Web SecurityWeb Security
Web Security
 
Web security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-kearyWeb security-–-everything-we-know-is-wrong-eoin-keary
Web security-–-everything-we-know-is-wrong-eoin-keary
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012
 
Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018Introduction to Web Application Security - Blackhoodie US 2018
Introduction to Web Application Security - Blackhoodie US 2018
 
Web Hacking
Web HackingWeb Hacking
Web Hacking
 
Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYANBEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
 

Semelhante a Web Security: A Primer for Developers

Hack miami emiliocasbas
Hack miami emiliocasbasHack miami emiliocasbas
Hack miami emiliocasbas
Emilio Casbas
 
CSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_GrossmanCSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_Grossman
guestdb261a
 
Cloud mz cto_roundtable
Cloud mz cto_roundtableCloud mz cto_roundtable
Cloud mz cto_roundtable
eaiti
 

Semelhante a Web Security: A Primer for Developers (20)

Devbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityDevbeat Conference - Developer First Security
Devbeat Conference - Developer First Security
 
Get Ready for Web Application Security Testing
Get Ready for Web Application Security TestingGet Ready for Web Application Security Testing
Get Ready for Web Application Security Testing
 
Mitigating Malware Presentation Jkd 11 10 08 Aitp
Mitigating Malware Presentation Jkd 11 10 08 AitpMitigating Malware Presentation Jkd 11 10 08 Aitp
Mitigating Malware Presentation Jkd 11 10 08 Aitp
 
Solvay secure application layer v2015 seba
Solvay secure application layer v2015   sebaSolvay secure application layer v2015   seba
Solvay secure application layer v2015 seba
 
Dissecting ssl threats
Dissecting ssl threatsDissecting ssl threats
Dissecting ssl threats
 
Hack miami emiliocasbas
Hack miami emiliocasbasHack miami emiliocasbas
Hack miami emiliocasbas
 
Cisco Web and Email Security Overview
Cisco Web and Email Security OverviewCisco Web and Email Security Overview
Cisco Web and Email Security Overview
 
Why Security Matters for Marketers
Why Security Matters for MarketersWhy Security Matters for Marketers
Why Security Matters for Marketers
 
Discovering the Value of Verifying Web Application Security Using IBM Rationa...
Discovering the Value of Verifying Web Application Security Using IBM Rationa...Discovering the Value of Verifying Web Application Security Using IBM Rationa...
Discovering the Value of Verifying Web Application Security Using IBM Rationa...
 
Jean pier talbot - web is the battlefield - atlseccon2011
Jean pier talbot - web is the battlefield - atlseccon2011Jean pier talbot - web is the battlefield - atlseccon2011
Jean pier talbot - web is the battlefield - atlseccon2011
 
CSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_GrossmanCSRF_RSA_2008_Jeremiah_Grossman
CSRF_RSA_2008_Jeremiah_Grossman
 
Developing Secure Applications and Defending Against Common Attacks
Developing Secure Applications and Defending Against Common AttacksDeveloping Secure Applications and Defending Against Common Attacks
Developing Secure Applications and Defending Against Common Attacks
 
Web & Cloud Security in the real world
Web & Cloud Security in the real worldWeb & Cloud Security in the real world
Web & Cloud Security in the real world
 
Protecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry RansomwareProtecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry Ransomware
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 
CSI2008 Gunter Ollmann Man-in-the-browser
CSI2008 Gunter Ollmann Man-in-the-browserCSI2008 Gunter Ollmann Man-in-the-browser
CSI2008 Gunter Ollmann Man-in-the-browser
 
Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008Top Ten Web Hacking Techniques – 2008
Top Ten Web Hacking Techniques – 2008
 
Cloud mz cto_roundtable
Cloud mz cto_roundtableCloud mz cto_roundtable
Cloud mz cto_roundtable
 
Top 10 mobile security risks - Khổng Văn Cường
Top 10 mobile security risks - Khổng Văn CườngTop 10 mobile security risks - Khổng Văn Cường
Top 10 mobile security risks - Khổng Văn Cường
 
Cyber security presentation
Cyber security presentationCyber security presentation
Cyber security presentation
 

Mais de Mike North

Enemy of the state
Enemy of the stateEnemy of the state
Enemy of the state
Mike North
 

Mais de Mike North (19)

A Debugging Adventure: Journey through Ember.js Glue
A Debugging Adventure: Journey through Ember.js GlueA Debugging Adventure: Journey through Ember.js Glue
A Debugging Adventure: Journey through Ember.js Glue
 
Anatomy of a Progressive Web App
Anatomy of a Progressive Web AppAnatomy of a Progressive Web App
Anatomy of a Progressive Web App
 
Web and Native: Bridging the Gap
Web and Native: Bridging the GapWeb and Native: Bridging the Gap
Web and Native: Bridging the Gap
 
The Road to Native Web Components
The Road to Native Web ComponentsThe Road to Native Web Components
The Road to Native Web Components
 
Enemy of the state
Enemy of the stateEnemy of the state
Enemy of the state
 
Phoenix for Rubyists - Rubyconf Brazil 2016
Phoenix for Rubyists - Rubyconf Brazil 2016Phoenix for Rubyists - Rubyconf Brazil 2016
Phoenix for Rubyists - Rubyconf Brazil 2016
 
Phoenix for Rubyists
Phoenix for RubyistsPhoenix for Rubyists
Phoenix for Rubyists
 
Write Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js MunichWrite Once, Run Everywhere - Ember.js Munich
Write Once, Run Everywhere - Ember.js Munich
 
Delightful UX for Distributed Systems
Delightful UX for Distributed SystemsDelightful UX for Distributed Systems
Delightful UX for Distributed Systems
 
Modern, Scalable, Ambitious apps with Ember.js
Modern, Scalable, Ambitious apps with Ember.jsModern, Scalable, Ambitious apps with Ember.js
Modern, Scalable, Ambitious apps with Ember.js
 
Ember addons, served three ways
Ember addons, served three waysEmber addons, served three ways
Ember addons, served three ways
 
CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page Apps
 
User percieved performance
User percieved performanceUser percieved performance
User percieved performance
 
User-percieved performance
User-percieved performanceUser-percieved performance
User-percieved performance
 
Write Once, Run Everywhere
Write Once, Run EverywhereWrite Once, Run Everywhere
Write Once, Run Everywhere
 
Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)Compose all the things (Wicked Good Ember 2015)
Compose all the things (Wicked Good Ember 2015)
 
Async JavaScript in ES7
Async JavaScript in ES7Async JavaScript in ES7
Async JavaScript in ES7
 
Test like a pro with Ember.js
Test like a pro with Ember.jsTest like a pro with Ember.js
Test like a pro with Ember.js
 
Modern Web UI - Web components
Modern Web UI - Web componentsModern Web UI - Web components
Modern Web UI - Web components
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Web Security: A Primer for Developers

  • 1. Web Security A Primer for Web App DevelopersJune 21, 2017 Mike North Fluent Conf © 2017, Mike Works, Inc. All Rights Reserved
  • 2. Web Security MICHAEL L NORTH Addepar Apple Buffer Checkmate Dollar Shave Club Ericsson Facebook Freshbooks Github Google Heroku Intercom Iora Health LinkedIn Microsoft Netflix Pagerduty Pivotshare Practice Fusion Thoughtbot Ticketfly Travis-CI Tumblr Twitch Yahoo Zenefits Teaching developers from…
  • 3. Web Security MICHAEL L NORTH We have a BIG problem • Features & Deadlines vs. Security • Web Developers have fallen behind • Attacks are escalating in severity • Barriers to staging an attack are lower than ever
  • 4. Web Security MICHAEL L NORTH Our Strawman Strawbank mike@mike.works Checking ****7890 $10,000 Savings ****1234 $8,000 ACCOUNTS TRANSFERS http://strawbank.com • Cookie-based "session" authentication • List of accounts • Ability to lookup other accounts & transfer funds
  • 5. Web Security MICHAEL L NORTH The Hacks NETWORK Man in the middle HTTPS downgrading via SSLStrip CLIENT SIDE ATTACKS XSS CSRF Clickjacking
  • 6. Web Security ATTACK MICHAEL L NORTH Man in the middle Starbucks WiFi HTTP HTTP
  • 7. Web Security ATTACK MICHAEL L NORTH Man in the middle Public WiFi: Trusted forever by default
  • 8. Web Security ATTACK MICHAEL L NORTH Man in the middle WiFi Devices broadcast what they're looking for
  • 9. Web Security ATTACK MICHAEL L NORTH Man in the middle Router as DNS
  • 10. Web Security ATTACK MICHAEL L NORTH DNS Hijacking
  • 11. Web Security ATTACK MICHAEL L NORTH Man in the middle Starbucks WiFi Airport Free WiFi 💥 💥 💥
  • 12. Web Security ATTACK MICHAEL L NORTH Man in the middle WiFi Pineapple • Linux • 2x Wifi Cards • High gain antennas • "App store" 2000mw WiFi 9dB antenna
  • 13. Web Security ATTACK MICHAEL L NORTH Man in the middle
  • 14. Web Security ATTACK MICHAEL L NORTH Man in the middle
  • 15. Web Security MICHAEL L NORTH Let's say you've locked down WiFi
  • 16. Web Security ATTACK MICHAEL L NORTH Femtocell 📱 📱 📱 📱
  • 17. Web Security DEFENSE MICHAEL L NORTH Man in the middle Strawbank mike@mike.works Checking ****7890 $10,000 Savings ****1234 $8,000 ACCOUNTS TRANSFERS https://strawbank.com🔒 • TLS not SSL • Private key needed to read or alter request/response • Getting a cert requires "Domain Validation"
  • 18. Web Security MICHAEL L NORTH ~56% of the web uses HTTPS % of page loads over HTTPS Time
  • 19. Web Security ATTACK MICHAEL L NORTH Man in the Middle II
  • 20. Web Security MICHAEL L NORTH [1] https://arstechnica.com/security/2009/07/benign-security-warnings-have-trained-users-to-ignore-them/ [2] https://adrifelt.github.io/sslinterstitial-chi.pdf [3] http://lorrie.cranor.org/pubs/bridging-gap-warnings.pdf After extensive data-driven improvement to Chrome warning messages, 42% of users ignore them instead of over 70% [2] 42% 51% Over 50% of users don't understand eavesdropping vs. malware risk factors [3] 44% "...at least 44 percent of the top 382,860 SSL-enabled websites had certificates that would trigger warnings" [1]
  • 21. Web Security ATTACK MICHAEL L NORTH SSLStrip 🔒 HTTPS 🔒 HTTPS 🔒 HTTPSHTTP Strawbank Begins with downgrade to HTTP
  • 22. Web Security ATTACK MICHAEL L NORTH SSLStrip 🔒 HTTPS 🔒 HTTPSHTTP Strawbank Client continues with HTTP, Server is unaware HTTP
  • 23. Web Security DEFENSE MICHAEL L NORTH HTTP Strict Transport Security Strict-Transport-Security: max-age=31536000; includeSubDomains Do not allow plain HTTP • Failure to include subdomains permits a broad range of cookie- related attacks • There's still the issue of the first request
  • 24. Web Security DEFENSE MICHAEL L NORTH HSTS Preload
  • 25. Web Security DEFENSE MICHAEL L NORTH HSTS WARNING DEFENSE
  • 26. Web Security WARNING MICHAEL L NORTH Treat Certificates With Care!
  • 27. Web Security WARNING MICHAEL L NORTH Treat Certificates With Care!
  • 28. Web Security WARNING MICHAEL L NORTH Treat Certificates With Care!
  • 29. Web Security MICHAEL L NORTH The Hacks NETWORK Man in the middle HTTPS downgrading via SSLStrip CLIENT SIDE ATTACKS XSS CSRF Clickjacking
  • 30. Web Security ATTACK MICHAEL L NORTH Cross-Site Scripting (XSS) Strawbank mike@mike.works ACCOUNTS TRANSFERS From Acct To Acct Mike's Checking Amount $8500 Transfer Funds https://strawbank.com🔒 Lisa's Savings <select> <option value="1"> Mike's Checking !</option> <option value="2"> Lisa's Savings !</option> <option value="3"> Elliot's Checking <script src="https:"//""...totally-fine.js !</option> !</select>
  • 31. Web Security ATTACK MICHAEL L NORTH Cross Site Scripting (XSS)
  • 32. Web Security DEFENSE MICHAEL L NORTH Cross-Site Scripting (XSS) Strawbank mike@mike.works ACCOUNTS TRANSFERS From Acct To Acct Mike's Checking Amount $8500 Transfer Funds https://strawbank.com🔒 <script src="http: • Escape all user input • Use a view layer that has thorough built-in XSS protection • Don't forget about styles too! <img src="javascript:alert('XSS!')"!/>
  • 33. Web Security WARNING MICHAEL L NORTH Cross-Site Scripting (XSS) • How confident are you in the XSS protection of your OSS libraries? • How carefully do people scrutinize browser plugins? • If XSS happens, what's your exposure?
  • 34. Web Security ATTACK MICHAEL L NORTH Embedded Malware
  • 35. Web Security ATTACK MICHAEL L NORTH Embedded Malware
  • 36. Web Security DEFENSE MICHAEL L NORTH Embedded Malware Never trust user-generated content • Optimize all images (nearly always drops non-visual content) • Avoid spreading "raw" attachments • Limit file types for uploads • Don't permit arbitrary HTML input • Whitelist content that can be embedded
  • 37. Web Security ATTACK MICHAEL L NORTH Cross-Site Request Forgery Strawbank mike@mike.works ACCOUNTS TRANSFERS From Acct To Acct Mike's Checking Amount $8500 Transfer Funds https://strawbank.com🔒 Lisa's Savings <form name="badform" method="post" action="https:"//strawbank.com/api/transfer"> <input type="hidden" name="destination" value="2" !/> <input type="hidden" name="amount" value="8500" !/> !</form> <script type="text/javascript"> document.badform.submit(); !</script>
  • 38. Web Security ATTACK MICHAEL L NORTH Cross-Site Request Forgery • Exclusively targets state-changing requests • Exploits browser "automatically" sending credentials • A good reason to conform to RESTful HTTP verbs • POST requests are also susceptible <img src="https:"//strawbank.com/api/transfer?amount=8500&destination=12345">
  • 39. Web Security DEFENSE MICHAEL L NORTH Cross-Site Request Forgery • Only Basic or cookie authentication schemes are vulnerable • Exception: "Client side cookie" • CSRF Token - non-predictable and per-request • Ensure CORS headers are appropriately restrictive
  • 40. Web Security ATTACK MICHAEL L NORTH Clickjacking https://strawbank.com-securebank.cc?tok=108...🔒 Proceed StrawCard You're approved!Strawbank mike@mike.works ACCOUNTS TRANSFERS From Acct To Acct Mike's Checking Amount $8500 Transfer Funds https://strawbank.com?amount=8500&dest=185...🔒 Lisa's Savings
  • 41. Web Security DEFENSE MICHAEL L NORTH Clickjacking X-Frame-Options: DENY X-Frame-Options: SAMEORIGIN X-Frame-Options: ALLOW-FROM https:"//strawbank.com/
  • 42. Web Security MICHAEL L NORTH The Hacks NETWORK Man in the middle HTTPS downgrading via SSLStrip CLIENT SIDE ATTACKS XSS CSRF Clickjacking
  • 43. Web Security MICHAEL L NORTH But Wait""...There's more. • SQL Injection • Timing attacks • Resource depletion attacks • Session hijacking • Execution after redirect • Log Injection attacks • Content Security Policy (CSP) • Cache Poisoning • Subresource Integrity (SRI) • Sandboxing untrusted content • Preventing attack escalation • Encryption at rest: best practices
  • 44. Web Security MICHAEL L NORTH Thanks! Want to know more? Ask me about a security workshop