CS 6262 - Network Security: Web Security



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

Web Application Guidelines

Criteria for web application security check. Version

Web-Application Security

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

Last update: February 23, 2004

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

What is Web Security? Motivation

Common Security Vulnerabilities in Online Payment Systems

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Web application security

Lecture 15 - Web Security

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

elearning for Secure Application Development

Web Security. Mahalingam Ramkumar

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

Web Application Security

Where every interaction matters.

WEB SECURITY. Oriana Kondakciu Software Engineering 4C03 Project


Perl In Secure Web Development

Check list for web developers

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Webapps Vulnerability Report

Gateway Apps - Security Summary SECURITY SUMMARY

Cyber Security Workshop Ethical Web Hacking

Web Application Security Considerations

Security features of ZK Framework

Nuclear Regulatory Commission Computer Security Office Computer Security Standard

Client vs. Server Implementations of Mitigating XSS Security Threats on Web Applications

Cross-Site Scripting

Sitefinity Security and Best Practices

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

Hack Proof Your Webapps

How To Understand The History Of The Web (Web)

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

Integrated Network Vulnerability Scanning & Penetration Testing SAINTcorporation.com

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

Magento Security and Vulnerabilities. Roman Stepanov

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

Transport Layer Security Protocols

WEB APPLICATION SECURITY

Application security testing: Protecting your application and data

Web and Security 1 / 40

FileMaker Server 13. FileMaker Server Help

FileMaker Server 11. FileMaker Server Help

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

IBM Protocol Analysis Module

CS5008: Internet Computing

Creating Stronger, Safer, Web Facing Code. JPL IT Security Mary Rivera June 17, 2011

Preparing for the Cross Site Request Forgery Defense

(WAPT) Web Application Penetration Testing

Cross Site Scripting Prevention

Penetration Test Report

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

Application Security Testing. Generic Test Strategy

Client Side Filter Enhancement using Web Proxy

Binonymizer A Two-Way Web-Browsing Anonymizer

Legal notices. Legal notices. For legal notices, see

The Top Web Application Attacks: Are you vulnerable?

Attacks on Clients: Dynamic Content & XSS

Multi Factor Authentication API

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Web Application Security Assessment and Vulnerability Mitigation Tests

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Certificates for computers, Web servers, and Web browser users

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

Project 2: Web Security Pitfalls

Ruby on Rails Secure Coding Recommendations

HTTP connections can use transport-layer security (SSL or its successor, TLS) to provide data integrity

Data Breaches and Web Servers: The Giant Sucking Sound

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

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

University of Wisconsin Platteville SE411. Senior Seminar. Web System Attacks. Maxwell Friederichs. April 18, 2013

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

With so many web applications, universities have a huge attack surface often without the IT security budgets or influence to back it up.

Next Generation Clickjacking

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

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Introduction to BlackBerry Smartphone Web Development Widgets

IJMIE Volume 2, Issue 9 ISSN:

Chapter 1 Web Application (In)security 1

Detecting and Exploiting XSS with Xenotix XSS Exploit Framework

Top Ten Web Application Vulnerabilities in J2EE. Vincent Partington and Eelco Klaver Xebia

SiteCelerate white paper

FileMaker Server 14. FileMaker Server Help

Still Aren't Doing. Frank Kim

Thomas Röthlisberger IT Security Analyst

Web attacks and security: SQL injection and cross-site scripting (XSS)

What about MongoDB? can req.body.input 0; var date = new Date(); do {curdate = new Date();} while(curdate-date<10000)

Network Security Exercise #8

Cracking the Perimeter via Web Application Hacking. Zach Grace, CISSP, CEH January 17, Mega Conference

E-Commerce: Designing And Creating An Online Store

Intrusion detection for web applications

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Adobe Systems Incorporated

JVA-122. Secure Java Web Development

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

Transcription:

CS 6262 - Network Security: Web Security Professor Patrick Traynor 4/9/2013 C

Reminders Need a study group for the final? Meet after class, or use Piazza to organize a meeting! Final posters for DL students: Record a 3-5 minute video and post it to YouTube. In addition to the PDF, turn in a link to the presentation. Be sure to check T-Square! The time to ask questions and check grades is now! 2

Network vs. Web Security 3

Web Security is Complicated App Level Vulnerability à Attack Against Server à Client is the Victim à Exploit a Client-side Vulnerability Enterprise security adds a third dimension 4

What is the web? A collection of application-layer services used to distribute content Web content (HTML) Multimedia Email Instant messaging Many applications News outlets, entertainment, education, research and technology, Commercial, consumer and B2B 5

Web security: the high bits The largest distributed system in existence threats are as diverse as applications and users But need to be thought out carefully The stakeholders are Consumers (users, businesses, agents, ) Providers (web-servers, IM services, ) Another way of seeing web security is Securing the web infrastructure such that the integrity, confidentiality, and availability of content and user information is maintained 6

Early Web Systems Early web systems provided a click-render-click cycle of acquiring web content. Web content consisted of static content with little user interaction. 7

Web Systems Evolve... The web has evolved from a document retrieval and rendering to sophisticated distributed application platform providing: dynamic content user-driven content interactive interfaces multi-site content content... With new interfaces comes new vulnerabilities... 8

DC: Embedded Scripting Program placed directly in content, run on server upon request and output returned in content MS active server pages (ASP) PHP mod_perl server-side JavaScript python,... Nice at generating output Dangerous if tied to user input 9

The new web-page Rendered elements from many sources containing scripts, images, and stylized by cascading style sheets (CSS) 10

Adding State to the Web:Cookies Cookies were designed to offload server state to browsers Not initially part of web tools (Netscape) Allows users to have cohesive experience E.g., flow from page to page, Someone made a design choice Use cookies to authenticate and authorize users E.g. Amazon.com shopping cart, WSJ.com 11

Cookie Issues New design choice means Cookies must be protected Against forgery (integrity) Against disclosure (confidentiality) Cookies not robust against web designer mistakes, committed attackers Were never intended to be Need the same scrutiny as any other tech. Many security problems arise out of a technology built for one thing incorrectly applied to something else. 12

Cookie Design 1: mygorilla.com Requirement: authenticate users on site mygorilla.com Design: 1. use digest authentication to login user 2. set cookie containing hashed username 3. check cookie for hashed username User Server Q: Is there anything wrong with this design? 13

Cookie Design 2: mygorilla.com Requirement: authenticate users on site mygorilla.com Design: 1. use digest authentication to login user 2. set cookie containing encrypted username 3. check cookie for encrypted username User Server Q: Is there anything wrong with this design? 14

Exercise: Cookie Design Design a secure cookie for mygorilla.com that meets the following requirements Requirements Users must be authenticated (assume digest completed) Time limited (to 24 hours) Unforgeable (only server can create) Privacy-protected (username not exposed) Location safe (cannot be replayed by another host) User Server 15

But What About... 16

Session Hijacking Virtual sessions are implemented in many ways session ID in cookies, URLs If I can guess, infer, or steal the session ID, game over Example, if your bank encodes the session ID in the url, then a malicious attacker can simply keep trying session IDs until gets a good one. http://www.mybank.com/loggedin?sessionid=11... note that if the user was logged in, then the attacker has full control over that account. Countermeasure: randomized, confidential session IDs that are tied to individual host address (see cookies) 17

Injection Attacker that can inject arbitrary inputs into the system can control it in subtle ways interpreter injection - if you can get PHP to eval your input, then you can run arbitrary code on the browser... e.g., leak cookies to remote site (e.g., session hijacking) $INPUT = Alice\;mail($to, $subject, $body); filename injection - if you can control what a filename is in application, then you can manipulate the host Poorly constructed applications build filename based on user input or input URLS, e.g., hidden POST fields e.g., change temporary filename input to ~/.profile <FORM METHOD=POST ACTION="../cgi-bin/mycgi.pl"><INPUT TYPE="hidden" VALUE="~/.profile" NAME="LOGFILE"></FORM> 18

SQL Injection An injection that exploits the fact that many inputs to web applications are under control of the user used directly in SQL queries against back-end databases Bad buy just inserts escaped code into the input... SELECT email, login, last_name FROM user_table WHERE email = 'x'; DROP TABLE members; --'; This vulnerability became one of the most widely exploited and costly in web history. Industry reported as many as 16% of website were vulnerable to SQL injection in 2007 This may be inflated, but clearly an ongoing problem. 19

Preventing SQL injection Use the SQL/perl prevent libraries Before $sql = "select * from some_table where some_col = $input";$sth = $dbh->prepare( $sql );$sth->execute; After $sql = "select * from some_table where some_col =?"; $sth = $dbh->prepare( $sql ); $sth->execute( $input ); Other approaches: have built (static analysis) tools for finding unsafe input code and (dynamic tools) to track the use of inputs within the web application lifetime. 20

My Personal Favorite 21

Taint Tracking Taint Tracking is the most common program analysis technique used to detect and prevent injection attacks Can be done statically or dynamically (e.g., Perl taint tracking) Marks all input data as tainted (i.e., untrusted) Track all derivative information, e.g., if c is tainted, then a = b + c causes a to be tainted Removes the taint flag when data is sanitized This can be hard to get right At the sensitive operation (e.g., SQL query API), simply looks for tainted input 22

Cross-Site Scripting Note Assume the following is posted to a message board on your favorite website:!! Hello message board.!! <SCRIPT>malicious code</script>!this is the end of my message. Now a reasonable ASP (or some other dynamic content generator) uses the input to create a webpage (e.g., blogger nonsense). Now a malicious script is now running Applet, ActiveX control, JavaScript 23

XSS - Non-Persistent A non-persistent (or reflected) XSS attack pages immediately viewed by the user The bait is an innocent looking URL Commonly in Email or on a neutral site The user clicks on a link and the content from a form or a URL is displayed on the resulting page If the resulting page doesn t escape input, the script is executed Both persistent and non-persistent XSS are examples of injection attacks 24

In-Class Exercise http://xss.progphp.com/xss1.html http://xss.progphp.com/xss11.html http://xss.progphp.com/xss2.html 25

Preventing Web System Attacks Largely just applications In as much as application are secure Command shells, interpreters, are dangerous Broad Approaches Validate input (also called input sanitization) Limit program functionality Don t leave open ended-functionality Execute with limited privileges Input tracking, e.g., taint tracking Source code analysis, e.g., c-cured 26

Web Transport Security: SSL Secure socket Layer (SSL/TLS) Used to authenticate servers Uses certificates, root CAs Can authenticate clients Inclusive security protocol Security at the socket layer Transport Layer Security (TLS) Provides authentication confidentiality integrity HTTP SSL TCP IP 27

SSL Handshake Client (1) Client Hello (algorithms, ) (2) Server Hello (alg. selection,) (3) Server Certificate (4) ClientKeyRequest (5) ChangeCipherSuite (6) ChangeCipherSuite (7) Finished (8) Finished Server 28

Simplified Protocol Detail 29

SSL Tradeoffs Pros Server authentication* GUI clues for users Built into every browser Easy to configure on the server Protocol has been analyzed like crazy Cons Users don t check certificates Too easy to obtain certificates Too many roots in the browsers Some settings are terrible 30

Applications/Plugins A plugin is a simply a program used by a browser to process content MIME type maps content to plugin Like any old application (e.g., RealAudio) Newer browsers have autoinstall features A kind of plug-in (1997) David.exe Free pornography Moral: beware of plugins 32

Drive by downloads Using a deceptive means to get someone to install something on their own (spyware/adware) Once you have one, then it starts downloading lots of others, their friends, A personal favorite: extortion-ware -- pay us 40$ for our popup blocker, etc. The real gambit is that they demand 40$ for the uninstall option Answer: go get adaware and install it (its free)! 33

Spyware Definition: hidden software that uses local host to transmit user secrets e.g., browsing habits, forms data Typically found in free software Gnutella, game tools, demo software, MP3 tools...) Implemented using spyware engines - gator Imbeds in local host to Adds shared libraries (.dlls), adds to startup as TSR programs Often difficult or impossible to remove You are never really sure it is gone (advice: reinstall) Gets installed by user action or via some of IEs ability to help the user via tools such as Active-X 35

JavaScript Scripting Language used to improve the quality/ experience Create dialogs, forms, graphs, Built upon API functions (lots of different flavors) No ability to read local files, open connections Security: No ability to read local files, open connections, but DOS the infinite popup script Often could not break out with restarting computer Spoofing easy to create password dialogs 36

Malicious IFrame(s) An IFRAME is a HTML tag that creates an embedded frame in the content of another page. This is the attack vector de jour for adversaries attempting to delivery content that exploits browser vulnerabilities. E.g., deliver crafted.jpg or malicious scripting The attack occurs when the adversary breaks into a webserver and places a IFRAME in legitimate content e.g., by sniffing passwords, recursively adding IFRAMEs <iframe src=http://[removed].info/counter style=display:none></iframe> 38

Active X ActiveX is a MS windows technology Really, just a way to run arbitrary code Called controls (.OCX), just programs Conforms to MS APIs to interact with web Extends user experience in lots of nice ways Microsoft upgrade service BIOS Upgrades Lookup services Massive security hole. 39

Authenticode Problem: I need to run an application code on my machine, but I worry about security Solution: Make sure code only comes from people that you trust. Authenticode Sign download content Check that signer is trusted Used for all Win* content Problem: Jan 2001 Verisign issued two bad MS 41

The new web-page Rendered elements from many sources containing scripts, images, and stylized by cascading style sheets (CSS) A browser may be compromised by any of these elements 42

ActiveX Cautionary Tales Exploder (Win95) 1996, Fred McLain Acquired Verisign cert Signed Exploder 10 second countdown shutdown MS/Verisign upset Microsoft Access 2000, Guninski ActiveX related control Allowed a website to load and execute an spreadsheet.. Which can contain any command which means A website can run any command on the user machine. 43

Java Platform and language for writing applets Sun Microsystems platform for set-top boxes Applets embedded in web pages (or native) Language loosely resembling C++ Runs in a Java Virtual Machine (JVM) Every platform has JVM Platform runs arbitrary code (bytecode) Hence: one application runs on a bunch of platforms Great way to take advantage of the web Slow for data/processing intensive applications 44

Web-server APIs Web-servers often provide application extension APIs to which developers can build... ISSAPI Apache API Act as kinds of kernel modules for web-server Web-server processes received inputs (URL, fields, etc.) Passes result to custom code (typically, C code) 45

Application Frameworks Application frameworks are software stacks that implement a web application Programmer adds domain-specific programming Handle request handling and rendering Quickly implement web apps without dealing the the nasty details of HTTP/HTML For example, the Zend framework implements a web application by processing incoming URLs E.g., http://base/module/function Zend accepts returned framework objects and renders them via internal API Modify documents on the fly using AJAX scripts such as JavaScript 46

AJAX AJAX: asynchronous JavaScript and XML A collection of approaches to implementing web applications Changes the click-render-click web interface to allow webpages to be interactive, change, etc. Examples: Google Gmail/Calendar, Facebook,... Hidden requests that replace document elements (DOM) 47

Attacks on web systems Web systems have replaced custom organization, enterprise and customer applications..... this move is has led to many new attacks... 48