Web and Email Security 1 / 40



Similar documents
Web Server-Side Security

Network Security - ISA 656 Security

The Case For Secure

How To Protect Your From Being Hacked On A Pc Or Mac Or Ipa From Being Stolen On A Network (For A Free Download) On A Computer Or Ipo (For Free) On Your Pc Or Ipom (For An Ipo

What is Web Security? Motivation

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Web applications. Web security: web basics. HTTP requests. URLs. GET request. Myrto Arapinis School of Informatics University of Edinburgh

Check list for web developers

Web application security

Web-Application Security

Web Application Security Considerations

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

Introduction to Computer Security

Web Security. Crypto (SSL) Client security Server security 2 / 40. Web Security. SSL Recent Changes in TLS. Protecting the Client.

Criteria for web application security check. Version

Application Design and Development

Why you need secure

The Top Web Application Attacks: Are you vulnerable?

Security 1 / 43

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Figure 9-1: General Application Security Issues. Application Security: Electronic Commerce and . Chapter 9

E-commerce. Security. Learning objectives. Internet Security Issues: Overview. Managing Risk-1. Managing Risk-2. Computer Security Classifications

Web Application Worms & Browser Insecurity

CS 558 Internet Systems and Technologies

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Simon Fraser University. Web Security. Dr. Abhijit Sen CMPT 470

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

WEB ATTACKS AND COUNTERMEASURES

Server Security. Contents. Is Rumpus Secure? 2. Use Care When Creating User Accounts 2. Managing Passwords 3. Watch Out For Aliases 4

Application security testing: Protecting your application and data

OPENID AUTHENTICATION SECURITY

Web Application Guidelines

Is your data safe out there? -A white Paper on Online Security

Cyber Security Workshop Ethical Web Hacking

Finding and Preventing Cross- Site Request Forgery. Tom Gallagher Security Test Lead, Microsoft

Thick Client Application Security

Magento Security and Vulnerabilities. Roman Stepanov

Webmail Using the Hush Encryption Engine

Where every interaction matters.

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Web Application Attacks and Countermeasures: Case Studies from Financial Systems

Cryptshare for Outlook User Guide

Transport Layer Security Protocols

Ruby on Rails Secure Coding Recommendations

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

Web Application Security. Srikumar Venugopal S2, Week 8, 2013

How To Understand The History Of The Web (Web)

Personal Secure Certificate

Client Server Registration Protocol

Network Security - ISA 656 Review

Cross-Site Scripting

Authentication Types. Password-based Authentication. Off-Line Password Guessing

(WAPT) Web Application Penetration Testing

Last update: February 23, 2004

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Session Management in Web Applications

Application Security Testing. Generic Test Strategy

Cryptography for Software and Web Developers

CS5008: Internet Computing

Testing the OWASP Top 10 Security Issues

Web Security: SSL/TLS

E-Commerce Security. The Client-Side Vulnerabilities. Securing the Data Transaction LECTURE 7 (SECURITY)

SECURITY ADVISORY. December 2008 Barracuda Load Balancer admin login Cross-site Scripting

Web Application Security Guidelines for Hosting Dynamic Websites on NIC Servers

2.4: Authentication Authentication types Authentication schemes: RSA, Lamport s Hash Mutual Authentication Session Keys Trusted Intermediaries

Keep Yourself Safe from the Prying Eyes of Hackers and Snoopers!

Still Aren't Doing. Frank Kim

CS 161 Computer Security

Lecture 11 Web Application Security (part 1)

Network Security Web Security and SSL/TLS. Angelos Keromytis Columbia University

Lecture Notes for Advanced Web Security 2015

Configuring Single Sign-on for WebVPN

Web Application Report

Hushmail Express Password Encryption in Hushmail. Brian Smith Hush Communications

Hack Proof Your Webapps

Ethical Hacking as a Professional Penetration Testing Technique

ITSC Training Courses Student IT Competence Programme SIIS1 Information Security

JOOMLA SECURITY. ireland website design. by Oliver Hummel. ADDRESS Unit 12D, Six Cross Roads Business Park, Waterford City

Network Security Workshop

Sichere Software- Entwicklung für Java Entwickler

Login with Amazon. Developer Guide for Websites

Secure Web Development Teaching Modules 1. Threat Assessment

The Hidden Dangers of Public WiFi

External Network & Web Application Assessment. For The XXX Group LLC October 2012

NeoMail Guide. Neotel (Pty) Ltd

Web Application Firewall on SonicWALL SSL VPN

The basic groups of components are described below. Fig X- 1 shows the relationship between components on a network.

An Insight into Cookie Security

Essential IT Security Testing

APWG. (n.d.). Unifying the global response to cybecrime. Retrieved from

Firewalls, Tunnels, and Network Intrusion Detection

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

EVALUATING COMMERCIAL WEB APPLICATION SECURITY. By Aaron Parke

CMP3002 Advanced Web Technology

OWASP Top Ten Tools and Tactics

Advanced Web Security, Lab

Objectives. Security. Fixing Our JSTL Problem. Web Application Architecture. Web Security. A few lines of code can wreak more havoc than a bomb.

Transcription:

Web and 1 / 40

Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST 2 / 40

Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Assume initial authentication is by password How is continuing authentication done? Two principal ways: cookies and hidden values Both have their limits Fundamental issue: both are sent by untrusted clients 3 / 40

Untrusted Clients Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST The web site is interested in identifying users (Some) users have incentive to cheat The goal of the web site is to make cheating impossible But the web site doesn t control the client software or behavior 4 / 40

Repeat: Untrusted Clients Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST You can never trust the client All input must be sanitized, scrutinized, etc. Solutions: server-side storage or cryptographic sealing 5 / 40

Server-Side Storage Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Provide the client with an index to some server-side file Client sends back the nonce; server looks up the identity (or other session details) Caution: make certain that nonces are not guessable or findable by exhaustive search. Also make sure they re not (easily) stealable from other users Problem: server-side storage can be exhausted; sessions must be of finite duration 6 / 40

Cryptographic Sealing Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST After the user logs in (somehow), create a string that contains the userid Encrypt (optional) and MAC this string, using keys known only to the server; pass the string to the client When the string is sent to the server, validate the MAC and decrypt, to see who it is Only the server knows those keys, so only the server could have created those protected strings (similar to Keberos TGT) Optional: include (especially) timestamp, IP address, etc. 7 / 40

Hidden Values Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Protected userid string can be embedded in the web page, and returned on clicks Embed in URLs but then they re visible in log files Make them hidden variables passed back in forms: <INPUT TYPE=HIDDEN NAME=REQRENEW> <INPUT TYPE=HIDDEN NAME=PID VALUE="2378"> <INPUT TYPE=HIDDEN NAME=SEQ VALUE="2006092800235 <P><INPUT TYPE=SUBMIT VALUE="Renew Items"><INPUT </FORM> 8 / 40

Cookies Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST More commonly used Allow you to re-enter site Are sometimes stored on user s disks 9 / 40

Protecting Data Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST authentication data is frequently transmitted unencrypted! Most sites don t want the overhead of SSL for everything Credentials are easily stolen, especially in wireless hotpots (always use HTTPS with gmail) Usual defenses: lifetime; reauthenticate before doing really sensitive stuff 10 / 40

Sidebar: Cookies and JavaScript Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST IE trusts local content more than it trusts downloaded files Content is local if it s coming from a file on the user s disk Each cookie is stored as a separate file Suppose you put a script in a cookie, and then referenced it by filename? Now you know why browsers use random characters in some of their filenames... (Partially changed by Windows XP SP2) 11 / 40

Cross-Site Scripting (XSS) Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Problem usually occurs when sites don t sanitize user input to strip HTML Example: chat room (or MySpace or blog sites) that let users enter comments The comments can include JavaScript code This JavaScript code can transmit the user s authentication cookies to some other site 12 / 40

Why It Works Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST A JavaScript program can only access data for the current web site But JavaScript from a site can access that site s cookies Because of the XSS bug, the JavaScript from that site contains malicious code It can therefore steal cookies and send them to some other site, via (say) an IMG URL 13 / 40

Sanitizing Input Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Very hard to do properly Whitelist instead of blacklist accept <I> instead of blocking <SCRIPT> Watch for encoding: %3C Watch for Unicode: < or < or < or < or... Probably a way to write it in octal, too Unicode is tricky see RFC 3454. What do all of your users browsers understand? 14 / 40

GET versus POST Untrusted Clients Repeat: Untrusted Clients Server-Side Storage Cryptographic Sealing Hidden Values Cookies Protecting Data Sidebar: Cookies and JavaScript Cross-Site Scripting (XSS) Why It Works Sanitizing Input GET versus POST Web requests can use GET or POST commands GET puts parameters in the URL; POST sends it as data after the command The nice thing about GET: you can reuse the URL But URLs are logged, by servers and sometimes proxies Don t put anything sensitive in the parameters! POST can t be reused, but doesn t cause sensitive data to be logged 15 / 40

Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies 16 / 40

Protecting the Server Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies Servers are very tempting targets Defacement Steal data (i.e., credit card numbers) Distribute malware to unsuspecting clients 17 / 40

Standard Defenses Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies Check all inputs Remember that nothing the client sends can be trusted Scrub your site 18 / 40

Server-Side Scripts Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies Most interesting web sites use server-side scripts: CGI, ASP, PHP, server-side include, etc. Each such script is a separate network service For a web site to be secure, all of its scripts must be secure What security context do scripts run in? The web server s? How does the server protect its sensitive files against malfunctioing scripts? This latter is a particular problem with server plug-ins, such as PHP Partial defense: use things like suexec 19 / 40

Injection Attacks Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies Often, user-supplied input is used to construct a file name or SQL query Bad guys can send bogus data Example: a script that sends email collects a username and executes /usr/bin/sendmail username The bad guy supplies foo; rm -rf / as the username The actual code executed is /usr/bin/sendmail foo; rm -rf / Oops... 20 / 40

Scrubbing Your Site Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies What is really being served? Web servers often come with default scripts some of these are insecure Example: nph-test-cgi that used to come with Apache Example: proprietary documents; Google for them: filetype:pdf "company confidential" (By the way, many document have other, hidden data) Can Google for some other vulnerabilities, too 21 / 40

Users Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies If your site permits user web pages this deparment? you have serious threats Are the user CGI scripts secure? Can users run PHP scripts in the browser s security context? Are all of these secure? 22 / 40

ACLs Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies Web sites can block or permit certain IP addresses: Deny from 192.168.205 Deny from phishers.example.com Deny from moreidiots.example Deny from ke Possible to allow just a few addresses, too: Order deny,allow Deny from all Allow from dev.example.com Caution: do not trust domain names 23 / 40

SSL and Proxies Protecting the Server Standard Defenses Server-Side Scripts Injection Attacks Scrubbing Your Site Users ACLs SSL and Proxies On proxied web connections, the proxy does not see the full URL It only sees the hostname and port: CONNECT www.example.com:443 HTTP/1.1 User-Agent: Mozilla/5.0... Proxy-Connection: keep-alive Host: www.example.com (SSL starts here) But the hostname (such as www.reallynastystuff.com) is seen and logged Performance note: SSL pages are not cached SSL-only site can be 10 15 more expensive 24 / 40

The Usual Questions Assets Security at Rest In Motion versus at Rest Components 25 / 40

The Usual Questions The Usual Questions Assets Security at Rest In Motion versus at Rest Components What are we trying to protect? Against whom? 26 / 40

Assets The Usual Questions Assets Security at Rest In Motion versus at Rest Components Confidentiality people often discuss sensitive things via email Authenticity who really sent the email? Anti-spam? Phishing? Authenticity has many motivations here 27 / 40

Security at Rest The Usual Questions Assets Security at Rest In Motion versus at Rest Components TLS protects data in motion during communication For email, do we want that or do we want security at rest while the email is stored somewhere Other terminology: transmission security versus object security Usual answer: both Security at rest is much harder 28 / 40

In Motion versus at Rest The Usual Questions Assets Security at Rest In Motion versus at Rest Components In Motion keys are transient Reject expired certificates Negotiate algorithms Decryption failures noticed immediately Restart communications on decryption failure At Rest keys must last as long as data must be provably valid Must store and accept old ones them for later use Assume known algorithms Decryption failures noticed much later Decryption failure unknown to sender 29 / 40

Components The Usual Questions Assets Security at Rest In Motion versus at Rest Components Mail User Agents (MUA): Outlook, Thunderbird, webmail sites, etc. Mail submission servers Mail Transfer Agents (MTAs) Mail Receivers Mail storage and retrieval systems (IMAP, POP, etc.) 30 / 40

Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues 31 / 40

Eavesdropping Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues Most obvious way to read email: eavesdropping The bad guy simply listens to the network Harder than it sounds, except for some wireless nets Frequently used by police and intelligence agencies, i.e., the FBI s Carnivore device 32 / 40

Password Theft Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues Most email is retrieved by login and password Anyone who gets your password can read your email It s much easier for an eavesdropper to pick those up passwords are usually sent each time someone polls for new email 33 / 40

Hacking Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues The real threat to email is while it s in storage This can be temporary storage, waiting for you to pick it up It can also be your personal machine, for email you ve sent or received What if your laptop is stolen? Does it have plaintext copies of all the secure email you ve sent and received? 34 / 40

Screen Dumps Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues Connect via X11 Use some other Trojan horse software to dump user s screen periodically Reflection off the back wall... 35 / 40

Subpoena Attacks Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues What if your records are subpoenaed? This is a legal issue; technical wiggling won t help! Even a search warrant is very disruptive 36 / 40

Rubber Hose Cryptanalysis Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues What if the local secret police want to know what some intercepted email says? Protecting human rights workers was one of the original goals for PGP! It s public key-encrypted you can t read it If the signature is encrypted, they can t even prove you sent it Of course, people like that don t care much about proof, and they don t like to take no for an answer... 37 / 40

From http://xkcd.com/538/ Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues 38 / 40

Spoofing Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues Ordinary email is trivial to spoof On timesharing machines and web mailers, the systems can tack on the userid On PCs, individuals set their own addresses No security if you need to authenticate email, you have to use crypto 39 / 40

Systems Issues Eavesdropping Password Theft Hacking Screen Dumps Subpoena Attacks Rubber Hose Cryptanalysis From http://xkcd.com/538/ Spoofing Systems Issues Only read email on secure machines Only connect to them securely Watch out for buggy mailers and systems But if the process of reading secure email is too cumbersome, your email will be insecure, because you ll never use the secure version Finding the right tradeoff is a difficult engineering choice 40 / 40