CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno

Similar documents
Web Security: Web Application Security [continued]

Web Security: Web Application Security [continued]

CSE 484 / CSE M 584: Computer Security and Privacy. Web Security. Autumn Tadayoshi (Yoshi) Kohno

CSE 484 / CSE M 584: Computer Security and Privacy. Anonymity Mobile. Autumn Tadayoshi (Yoshi) Kohno

Web Security: Loose Ends

CSE 484 / CSE M 584: Computer Security and Privacy. Usable Security. Fall Franziska (Franzi) Roesner

Applications Security

User Authentication. Daniel Halperin Tadayoshi Kohno

Software Security: Buffer Overflow Attacks

Software Security Design Principles + Intro to Crypto

P2_L12 Web Security Page 1

Crypto meets Web Security: Certificates and SSL/TLS

Software Security and Intro to Cryptography

Application vulnerabilities and defences

User Authentication and Human Factors

Common Websites Security Issues. Ziv Perry

Authentication. Tadayoshi Kohno

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Copyright

OWASP Top 10 The Ten Most Critical Web Application Security Risks

Robust Defenses for Cross-Site Request Forgery

Computer Security and Privacy

Proving who you are. Passwords and TLS

User Authentication + Other Human Aspects

User Authentication + Human Aspects

Web Application Vulnerabilities: OWASP Top 10 Revisited

Software Security: Buffer Overflow Defenses

Robust Defenses for Cross-Site Request Forgery

WEB SECURITY: XSS & CSRF

C1: Define Security Requirements

Software Security: Misc and Principles

This slide shows the OWASP Top 10 Web Application Security Risks of 2017, which is a list of the currently most dangerous web vulnerabilities in


Introduction to Cryptography (cont.)

Cryptography: Symmetric Encryption (finish), Hash Functions, Message Authentication Codes

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

W e b A p p l i c a t i o n S e c u r i t y : T h e D e v i l i s i n t h e D e t a i l s

Cryptography [Symmetric Encryption]

User Authentication. Tadayoshi Kohno

CS 161 Computer Security

Cryptography: Symmetric Encryption [continued]

Application Layer Security

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Aguascalientes Local Chapter. Kickoff

COMP9321 Web Application Engineering

Perslink Security. Perslink Security. Eleonora Petridou Pascal Cuylaerts. System And Network Engineering University of Amsterdam.

Web Application Security. Philippe Bogaerts

Software Security: Buffer Overflow Attacks (continued)

Bank Infrastructure - Video - 1

Information Security CS 526 Topic 8

Authentication and Password CS166 Introduction to Computer Security 2/11/18 CS166 1

OWASP TOP Release. Andy Willingham June 12, 2018 OWASP Cincinnati

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Certified Secure Web Application Security Test Checklist

Web Security II. Slides from M. Hicks, University of Maryland

2/16/18. CYSE 411/AIT 681 Secure Software Engineering. Secure Coding. The Web. Topic #11. Web Security. Instructor: Dr. Kun Sun

1 About Web Security. What is application security? So what can happen? see [?]

COMP9321 Web Application Engineering

Exploiting and Defending: Common Web Application Vulnerabilities

Web Security [SSL/TLS and Browser Security Model]

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

GUI based and very easy to use, no security expertise required. Reporting in both HTML and RTF formats - Click here to view the sample report.

Security. CSC309 TA: Sukwon Oh

Cryptography: Symmetric Encryption (finish), Hash Functions, Message Authentication Codes

CIS 4360 Secure Computer Systems XSS

Web Security Symmetric Encryption & Authentication

Hacking Web Sites OWASP Top 10

Information Security CS 526 Topic 11

Solutions Business Manager Web Application Security Assessment

Welcome to the OWASP TOP 10

Backend IV: Authentication, Authorization and Sanitization. Tuesday, January 13, 15

Software Security: Buffer Overflow Defenses and Miscellaneous

CHAPTER 8 CONCLUSION AND FUTURE ENHANCEMENTS

2/16/18. Secure Coding. CYSE 411/AIT 681 Secure Software Engineering. Web Security Outline. The Web. The Web, Basically.

Cryptography (cont.)

Cryptography: Symmetric Encryption (finish), Hash Functions, Message Authentication Codes

Robust Defenses for Cross-Site Request Forgery Review

DEFENSIVE PROGRAMMING. Lecture for EDA 263 Magnus Almgren Department of Computer Science and Engineering Chalmers University of Technology

OPEN WEB APPLICATION SECURITY PROJECT OWASP TOP 10 VULNERABILITIES

Is Browsing Safe? Web Browser Security. Subverting the Browser. Browser Security Model. XSS / Script Injection. 1. XSS / Script Injection

OWASP Top 10. Copyright 2017 Ergon Informatik AG 2/13

SECURITY STORY WE NEVER SEE, TOUCH NOR HOLD YOUR DATA

Network Security. Tadayoshi Kohno

COMP9321 Web Application Engineering

CSCD 303 Essential Computer Security Fall 2018

Web Vulnerabilities. And The People Who Love Them

Web basics: HTTP cookies

SECURITY TESTING. Towards a safer web world

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

Web basics: HTTP cookies

Lecture 17 Browser Security. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Some slides from Bailey's ECE 422

Lecture Overview. IN5290 Ethical Hacking

Lecture 6: Web hacking 2, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Session related attacks

Certified Secure Web Application Secure Development Checklist

NET 311 INFORMATION SECURITY

Web Security, Summer Term 2012

Web Security, Summer Term 2012

"Charting the Course to Your Success!" Securing.Net Web Applications Lifecycle Course Summary

Featuring. and. Göteborg. Ulf Larson Thursday, October 24, 13

Transcription:

CSE 484 / CSE M 584: Computer Security and Privacy Web Security Autumn 2018 Tadayoshi (Yoshi) Kohno yoshi@cs.washington.edu Thanks to Dan Boneh, Dieter Gollmann, Dan Halperin, Ada Lerner, John Manferdelli, John Mitchell, Franziska Roesner, Vitaly Shmatikov, Bennet Yee, and many others for sample slides and materials...

Admin HW2: Due Nov 7, 4:30pm Looking ahead, rough plan: Lab 2 out ~Nov 5, due ~Nov 19 (Quiz Section on Nov 8) HW 3 out ~Nov 19, due ~Nov 30 Lab 3 out ~Nov 26, due Dec 7 (Quiz Section on Nov 29) 11/3/2018 CSE 484 / CSE M 584 2

Admin Final Project Proposals: Nov 16 group member names and brief description Final Project Checkpoint: Nov 30 preliminary outline and references Final Project Presentation: Dec 10 12-15-minute video must be on time Explore something of interest to you, that could hopefully benefit you or your career in some way technical topics, current events, etc 11/3/2018 CSE 484 / CSE M 584 3

Next Week Monday (Nov 5): Lecture on Lab 2 Monday (Nov 5): No 11:30am office hours for me; TA office hours are happening Thursday (Nov 8): Quiz Sections -> Extended Lab 2 Office Hours 11/3/2018 CSE 484 / CSE M 584 - Fall 2017 4

Cross-Site Request Forgery (CSRF/XSRF) 11/3/2018 5

Cookies in Forged Requests Cookie: SessionID=523FA4cd2E User credentials automatically sent by browser 11/3/2018 6

Impact Hijack any ongoing session (if no protection) Netflix: change account settings, Gmail: steal contacts, Amazon: one-click purchase Reprogram the user s home router Login to the attacker s account 11/3/2018 7

Login XSRF: Attacker logs you in as them! User logged in as attacker Attacker s account reflects user s behavior 11/3/2018 9

Broader View of CSRF Abuse of cross-site data export SOP does not control data export Malicious webpage can initiates requests from the user s browser to an honest server Server thinks requests are part of the established session between the browser and the server (automatically sends cookies) 11/3/2018 10

XSRF Defenses Secret validation token <input type=hidden value=23a3af01b> Referer validation Referer: http://www.facebook.com/home.php 11/3/2018 11

Add Secret Token to Forms Synchronizer Token Pattern Include a secret challenge token as a hidden input in forms Token often based on user s session ID Server must verify correctness of token before executing sensitive operations Why does this work? <input type=hidden value=23a3af01b> Same-origin policy: attacker can t read token out of legitimate forms loaded in user s browser, so can t create fake forms with correct token 11/3/2018 12

Referer Validation? Referer: http://www.facebook.com/home.php Referer: http://www.evil.com/attack.html Referer: Lenient referer checking header is optional Strict referer checking header is required 11/3/2018 13

Why Not Always Strict Checking? Why might the referer header be suppressed? Stripped by the organization s network filter Stripped by the local machine Stripped by the browser for HTTPS HTTP transitions User preference in browser Buggy browser Web applications can t afford to block these users Many web application frameworks include CSRF defenses today 11/3/2018 14

Injection 11/3/2018 15

Injection Attacks http://victim.com/copy.php?name=username copy.php includes system( cp temp.dat $name.dat ) User calls http://victim.com/copy.php?name= a; rm * copy.php executes system( cp temp.dat a; rm *.dat ); 11/3/2018 16

Basic Issues User-supplied data is not validated, filtered, or sanitized by application User input directly used or concatenated to a string that is used by an interpreter Common Injections: SQL, NoSQL, Object Relational Mapping (ORM), LDAP, Object Graph Navigation Library, 11/3/2018 17

More Examples SQL application uses untrusted data in this SQL call String query = "SELECT * FROM accounts WHERE custid='" + request.getparameter("id") + "'"; Also, be careful with frameworks, e.g., Hibernate Query Language (HQL) call Query HQLQuery = session.createquery("from accounts WHERE custid='" + request.getparameter("id") + "'"); Attacker sets id to ' or '1'='1 http://example.com/app/accountview?id=' or '1'='1 Result in both cases: return all records in database 11/3/2018 18

Defenses Use safe APIs, e.g., prepared statements in SQL with parameterized queries Define all the SQL code, then pass in each parameter Separates code from data Whitelist-based server-side input validation Escape special characters Use LIMIT (and other) SQL controls within queries to prevent mass disclosure of records Remember Defense in Depth, Least Privilege, etc. 11/3/2018 19

XML External Entities 11/3/2018 20

XML External Entities Consider a web application that accepts XML input, parses it, and outputs the result (or includes untrusted input in XML documents) <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY> <!ENTITY bar "World"> ]> <foo> Hello &bar; </foo> Parses as Hello World 11/3/2018 21

But What About Consider an attacker uploading this XML document <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///etc/passwd" >]> <foo>&xxe;</foo> Attacker attempting to extract information from server 11/3/2018 22

But What About Consider an attacker uploading this XML document <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "https://192.168.1.1/private" >]> <foo>&xxe;</foo> Attacker attempting to probe a private network 11/3/2018 23

But What About Consider an attacker uploading this XML document <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "file:///dev/random" >]> <foo>&xxe;</foo> Attacker attempting a DoS by including a potentially never-ending file 11/3/2018 24

Why Call Server Side Request Forgery? 11/3/2018 25

What to Do? Use less complex data formats, such as JSON Disable XML external entities and DTD processing in all XML parses Whitelist-based server-side input validation OWASP very useful source here as well 11/3/2018 26

Authentication Another Ten Most Critical Web Application Security Risks 11/3/2018 27

Basic Problem? How do you prove to someone that you are who you claim to be? Any system with access control must solve this problem. 11/3/2018 28

Many Ways to Prove Who You Are What you know Passwords Answers to questions that only you know Where you are IP address, geolocation What you are Biometrics What you have Secure tokens, mobile devices 11/3/2018 29

Passwords and Computer Security In 2012, 76% of network intrusions exploited weak or stolen credentials (username/password) Source: Verizon Data Breach Investigations Report First step after any successful intrusion: install sniffer or keylogger to steal more passwords Second step: run cracking tools on password files Cracking needed because modern systems usually do not store passwords in the clear (how are they stored?) In Mitnick s Art of Intrusion 8 out of 9 exploits involve password stealing and/or cracking 11/3/2018 30

Password Storage Recall discussions from crypto section Don t store plaintext passwords Don t use encrypted passwords Use hashed passwords Hash a salt along with the password, and store the salt and the hashed salt+password on the server 11/3/2018 38

Other Password Security Issues Keystroke loggers Hardware Software (spyware) Shoulder surfing Same password at multiple sites Broken implementations TENEX timing attack 11/3/2018 39

Examples from One Company 11/3/2018 CSE 484 / CSE M 584 - Fall 2017 40

Even More Issues Usability Hard-to-remember passwords? Carry a physical object all the time? Denial of service Attacker tries to authenticate as you, account locked after three failures Social engineering 11/3/2018 41