340 likes | 439 Views
Web Security. Sankar Roy. Acknowledgement. While preparing the presentation slides and the demo, I received help from Professor Eugene Vasserman Professor Simon Ou Professor Gurdip Singh Alex Bardas and Yuping Li. Web Activities. Why do we browse Internet? email searching on
E N D
Web Security Sankar Roy
Acknowledgement Whilepreparing the presentation slides and the demo, I received help from • Professor Eugene Vasserman • Professor Simon Ou • Professor Gurdip Singh • Alex Bardas and Yuping Li
Web Activities • Why do we browse Internet? • email • searching on • social networking • e-commerce • driving directions • reading • watching
Security-sensitive Web Activities Online shopping Managing confidential emails
Goals of this Class • Understand the risks of Web communication • Understand the security mechanisms for Web transactions • Learn how to protect ourselves from the common problems in practice
Understanding the Web Communication s2 DNS s1 An example: Let’s do a Google search: • 0-th step: type google.comon a browser • The next three major steps (s1, s2 and s3) as shown above are elaborated later DNS = Domain name service s3 Googleserver Your desktop
Step 0: Opening a Browser • Open a browser (e.g. Safari, Firefox, IE, Chrome, etc.) • Type google.com in the address bar (HTTP protocol is used)
Step 1: Get Address of Google.com What’s the IP address of Google? • The browser asks the DNS the IP address of Google.com • DNS responds with the IP (e.g. 64.233.160.2) Your Browser Domain Name Service (DNS) 64.233.160.2 Compare with the phone number search Google.com =Contact name, IP = phone number
Step 2: Send Query to Google • The browser sends out a message • with the connection request • The packet (message) is routed over the Internet • and finally reaches the destination (i.e. Google.com) 64.233.160.2 Your Browser message (Google.com)
Step 3: Get Response from Google • Google.com sends back the response message • The message finally reaches your computer • The browser displays Google’s home page • Then you type the “key words” in Google’s “search box” • and hit “enter”; this sends a message to Google again (with “key words” now) • this type of back-and-forth communication may continue 64.233.160.2 Your Browser response message (Google.com)
Physical vs. Web: Bank transaction example • Physically visiting your bank: you are sure that building is your bank? The bank teller verifies your Driver’s license and thus authenticates you. • On Web: It is a virtual world. Your browser and the bank server needs some special tool toauthenticate each other. Also, the sensitive data traffic (including your password) has to remain confidential.
Attacks: Connection Interception query message • The browser sends out a message (with the query) • The browser displays Mallory’s response page, which may look identical to Google Your Browser (NOT Google.com) Mallory intercepts it and sends back a response claiming that she is “google.com”
Alice Bob Connection Interception: Another View The adversary (let’s call him Mallory) intercepts the communication between Alice and Bob. Muahaha! Bob
Where does Web Browsing Lack? • HTTP is (more or less) OK for Google search because of no confidential data being involved • But when we deal with sensitive data (e.g. e-banking) • then, we need: authenticate Server Browser authenticate • Also, we need confidentiality: the password or credit card info should not be transferred in clear text • Default web browsing does NOT use authentication or confidentiality
Viewing the Status of a Website NO authentication NO confidentiality The browser can show the statusof the connection, e.g. “no authentication or no encryption” (as shown above when we visit http://www.google.com).
Securing Web Browsing • A feasible Solution: • Each party B (e.g. a bank server) generates a Public and Private key pair. Mathematical theory ensures the correspondence b/w these key pair. B’s public cred. cert pub CA has CA’s sig. mybank.com (B) CA says “pub is B’s public key”. pri B’s private cred. • PKI (Public Key Infrastructure): Party B (e.g. a bank server) can collect a certificate from a cert-authority (CA) which is a trusted third party.
Alice Bob Securing Web Browsing CRAP! Bob Confidential Authenticated
Basics of PKI: comparison with DMV • A party P’s certificate CPis like P’s Driver License where CA takes the role of DMV • A policeman (or a liquor shop) uses your Driver License (DL) to verify your identity (or age) • Likewise, server P’s certificate CP can be verified by another party Q (e.g. your browser) • Actually, Q verifies P’s public key by investigating CA’s digital signature which is present in CP • Note that there are multiple DMVs in USA, each of whose DLs are trusted anywhere in USA • Similarly, there are multiple CAs in PKI, each of whose certificates are accepted by every browser
How to Do Secure Web Browsing? Ensure that you see the lock symbol in the address bar. The drop down panel above shows the https encryption and the certificate of this web server.
How to Check if We are Secure? • It depends on the browser. • Ensure you see the lock symbol or https in the address bar
Viewing the Certificate of a Server The browser can show us the certificate of the server website. Here we view the certificate of mail.google.com while using Firefox. Note the Certificate Hierarchy.
Secure Web Browsing Protocol Secure browsing (HTTPS) is like running the HTTP protocol on top of SSL which is a security technology After you type mybank.com(say B) on a browser (say A) address bar, the following events take place: • Using the public/private key pair, A and B establish a confidential communication channel. B’s certificate makes Asure that Bis the correct website • A displays the secure login page in front of you • You type the username and password, and A sends it to B over the confidential channel • B decrypts your username and password and verify. Bbecomes sure that it is communicating with you and nobody else • You (and A) can continue the mutually authenticated and confidential web session with B
Weakness of the PKI System • One compromised CA can issue a certificate to anybody X. Then, X can issue certificates. • Possible usage of a hierarchy of certificate authorities (CAs) which form a chain of trust. A bad node in the chain kills the system. • It is hard for a browser to manage the long list of trusted CAs. Updating the list of revoked/untrusted CAs is even harder. TRUSTED ROOT TRUSTED DELEGATE Certificate, e.g. BigCorp.com Certificate, e.g. Google.com Certificate, e.g. MyBank.com
More Limitations of HTTPS • We often encounter warning from the browser due to invalid(or expired) certificates. It can be very confusing to the common user to decide what to do in such situations to guarantee safety • Building trust could be confusing: trusted authority vs. trustworthy authority • Let’s compare two certificates of Citibank. One is issued by Verisign and the other by a Russian CA. Both of the certificates can be trusted by the browser, but only the first one might be trustworthy.
Delegate Changes, You Don’t Notice ROOT TRUSTED ROOT UNTRUSTWORTHY DELEGATE TRUSTED DELEGATE Certificate, e.g. BigCorp.com Certificate, e.g. BigCorp.com Certificate, e.g. NOT Google.com Certificate, e.g. Google.com Certificate, e.g. NOT MyBank.com Certificate, e.g. MyBank.com
Demonstration: Man-in-the-middle Attack • Goal: We show that just getting “https://” displayed on the address bar does not guarantee security. • Each student has a desktop to connect to the Internet • he/she may use the Firefox browser to visit a bank website • As an example, type on the Firefox address bar https://yourBank.com • Caution: when the login page is displayed on Firefox, • please use a boguslogin id and password • donot type any valid id or password to avoid problems
Alice Bob A Diagram of the Man-in-the-middle Attack The adversary (Mallory) intercepts the connection between Alice (e.g. you) and Bob (e.g. your bank). Muahaha! Bob
Explaining the Previous Demo • Setup: One proxy server for the whole class/lab • Each Desktop’s browser (Firefox) is pre-configured with the proxy server’s information (i.e. the IP address, and the port) Website 1 Desktop 1 https conctn https conctn You are using Firefox on one Desktop. One of these websites is your bank. … … … Proxy Server Website n Desktop n • If you are not careful, the proxy server can decrypt • your login name, password, and the other communicated data • Lesson: Never proceed if your browser warns that it does not trust a website’s certificate
What could Happen if the PKI is Broken? • Then, bogus certificates could be accepted. • We demonstrated a man-in-the-middle attackin a similar scenario. • The following events occur in the demo attack: • An HTTPS request from Client C to Server S is intercepted by the adversary on a proxy server • The adversary (Mallory) then sends a bogus certificate in the name of Server S • The Client C authenticates the certificate chain and sends a session key, encrypted using the public key supplied by Mallory
Problems if the PKI is broken (Contd.) • The adversary Mallory decrypts the session key • Mallory opens an HTTPS session with Server S and proxies the traffic between C and S • All the data that is in transferred between C and S is available to Mallory
Another Problem: Only the Login is Done in HTTPS In some portals (e.g. Yahoo mail) the web session after successful login switches back to HTTP. The HTTP session is then authenticated only by a cookie. Problem:client’s cookie can be stolen • (as an example) when the adversary does packet sniffing on the same Ethernet or Wi-Fi network as the client’s machine Outcome: the HTTP session can be hijacked. Solution: we suggest to use only those websites which employ HTTPS for the whole session (e.g. Gmail)
Summary • We discussed common security threats of Web browsing • We presented a few standard countermeasures to mitigate the risks • Remainder: • the next homework is due before the next class (1pm on February 7) • the next class will be held in Room 127