Web Security Advanced Network Security Peter Reiher August, 2014

Slides:



Advertisements
Similar presentations
Topic 8: Secure communication in mobile devices. Choice of secure communication protocols, leveraging SSL for remote authentication and using HTTPS for.
Advertisements

Lecture 9 Page 1 CS 236 Online Denial of Service Attacks that prevent legitimate users from doing their work By flooding the network Or corrupting routing.
Lecture 2 Page 1 CS 236, Spring 2008 Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
Jonas Thomsen, Ph.d. student Computer Science University of Aarhus Best Practices and Techniques for Building Secure Microsoft.
Dec 13 th CS555 presentation1 Yiwen Wang --“Securing the DB may be the single biggest action an organization can take to protect its assets” David C. Knox.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
Lecture 7 Page 1 CS 236 Online Password Management Limit login attempts Encrypt your passwords Protecting the password file Forgotten passwords Generating.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Lecture 16 Page 1 CS 236 Online SQL Injection Attacks Many web servers have backing databases –Much of their information stored in a database Web pages.
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
Secure Credential Manager Claes Nilsson - Sony Ericsson
Feedback #2 (under assignments) Lecture Code:
Chapter 10 Security and Encryption. Objectives Explain the nature of a threat model Be able to construct a threat model Be aware of common threats to.
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
Lecture 15 Page 1 CS 136, Fall 2014 Web Security Computer Security Peter Reiher December 9, 2014.
Lecture 13 Page 1 Advanced Network Security Authentication and Authorization in Local Networks Advanced Network Security Peter Reiher August, 2014.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
Lecture 19 Page 1 CS 236 Online Advanced Research Issues in Security: Web Security and Privacy CS 236 On-Line MS Program Networks and Systems Security.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Databases Kevin Wright Ben Bruckner Group 40. Outline Background Vulnerabilities Log File Cleaning This Lab.
Lecture 19 Page 1 CS 136, Spring 2009 Web Security and Privacy CS 136 Computer Security Peter Reiher June 4, 2009.
Lecture 17 Page 1 Advanced Network Security Network Denial of Service Attacks Advanced Network Security Peter Reiher August, 2014.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Lecture 15 Page 1 CS 136, Spring 2016 Web Security Computer Security Peter Reiher May 24, 2016.
Lecture 14 Page 1 CS 236 Online Secure Programming CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Authentication & Authorisation Is the user allowed to access the site?
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
SQL Injection.
Outline The basic authentication problem
Outline Basic concepts in computer security
DNS Security Advanced Network Security Peter Reiher August, 2014
Protecting Memory What is there to protect in memory?
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
World Wide Web policy.
Protecting Memory What is there to protect in memory?
Web Security CS 136 Computer Security Peter Reiher December 3, 2013
Challenge/Response Authentication
Protecting Memory What is there to protect in memory?
Password Management Limit login attempts Encrypt your passwords
Web Security Computer Security Peter Reiher March 2, 2017
Outline Basics of network security Definitions Sample attacks
Outline What does the OS protect? Authentication for operating systems
SQL INJECTION ATTACKS.
Radius, LDAP, Radius used in Authenticating Users
SQL Injection Attacks Many web servers have backing databases
Outline Introduction Characteristics of intrusion detection systems
Outline What does the OS protect? Authentication for operating systems
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Web Security Lots of Internet traffic is related to the web
SSH: SECURE LOGIN CONNECTIONS OVER THE INTERNET
Outline Basics of network security Definitions Sample attacks
Web Security Advanced Network Security Peter Reiher August, 2014
Lecture 2 - SQL Injection
Groups for This Week Golita Benoodi, Zhen Huang, Ioannis Pefkianakis
Outline Using cryptography in networks IPSec SSL and TLS.
Web Security CS 136 Computer Security Peter Reiher November 29, 2012
Web Security CS 136 Computer Security Peter Reiher March 11, 2010
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
CS5123 Software Validation and Quality Assurance
Lecture 27 Security I April 4, 2018 Open news web sites.
Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Outline Basics of network security Definitions Sample attacks
Advanced Research Issues in Security: Web Security and Privacy CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Presentation transcript:

Web Security Advanced Network Security Peter Reiher August, 2014

Outline The scope of the web security problem Web browser compromise threats SQL injection attacks

Web Security Lots of Internet traffic is related to the web Much of it is financial in nature Also lots of private information flow around web applications An obvious target for attackers

The Web Security Problem Many users interact with many servers Most parties have little other relationship Increasingly complex things are moved via the web No central authority Many developers with little security experience Many critical elements originally designed with no thought to security Sort of a microcosm of the overall security problem

Aspects of the Web Problem

Who Are We Protecting? Everyone From the network The clients From the server A client’s interaction with one server From the client From his interaction with another server The client The server From each other

What Are We Protecting? The client’s private data The server’s private data The integrity (sometimes also secrecy) of their transactions The client and server’s machines Possibly server availability For particular clients?

Some Real Threats Buffer overflows and other compromises Client attacks server SQL injection Malicious downloaded code Server attacks client

More Threats Cross-site scripting Clients attack each other Threats based on non-transactional nature of communication Client attacks server Denial of service attacks Threats on server availability (usually)

Yet More Threats Browser security Protecting interactions from one site from those with another One server attacks client’s interactions with another Data transport issues The network attacks everyone else Certificates and trust issues Varied, but mostly server attacks client

Compromising the Browser Essentially, the browser is an operating system You can do almost anything through a browser It shares resources among different “processes” But it does not have most OS security features While having some of the more dangerous OS functionality Like arbitrary extensibility And supporting multiple simultaneous mutually untrusting processes

But My Browser Must Be OK . . . After all, I see the little lock icon at the bottom of the page Doesn’t that mean I’m safe? Alas, no What does that icon mean, and what is the security implication?

The Lock Icon This icon is displayed by your browser when a digital certificate checks out A web site provided a certificate attesting to its identity The certificate was properly signed by someone your browser trusts That’s all it means

What Are the Implications? All you know is that the web site is who it claims to be Which might not be who you think it is Maybe it’s amozon.com, not amazon.com Would you notice the difference? Only to the extent that a trusted signer hasn’t been careless or compromised Some have been, in the past

Another Browser Security Issue What if you’re accessing your bank account in one browser tab And a site showing silly videos of cats in another? What if one of those videos contains an attack script? Can the evil cat script steal your bank account number?

Same Origin Policy Meant to foil such attacks Built into many web scripting languages Basically, pages from a single origin can access each other’s stuff Pages from a different origin cannot Particularly relevant to cookies

Web Cookies Essentially, data a web site asks your browser to store Sent back to that web site when you ask for another service from it Used to set up sessions and maintain state (e.g., authentication status) Lots of great information about your interactions with sites in the cookies

Same Origin Policy and Cookies Script from one domain cannot get the cookies from another domain Prevents the evil cat video from sending authenticated request to empty your bank account Domain defined by DNS domain name, application protocol Sometimes also port

SQL Injection Attacks Many web servers have backing databases Much of their information stored in a database Web pages are built (in part) based on queries to a database Possibly using some client input . . .

SQL Injection Mechanics Server plans to build a SQL query Needs some data from client to build it E.g., client’s user name Server asks client for data Client, instead, provides a SQL fragment Server inserts it into planned query Leading to a “somewhat different” query

An Example Intent is that user fills in his ID and password “select * from mysql.user where username = ‘ “ . $uid . “ ‘ and password=password(‘ “. $pwd “ ‘);” Intent is that user fills in his ID and password What if he fills in something else? ‘or 1=1; -- ‘

What Happens Then? $uid has the string substituted, yielding “select * from mysql.user where username = ‘ ‘ or 1=1; -- ‘ ‘ and password=password(‘ “. $pwd “ ‘);” This evaluates to true Since 1 does indeed equal 1 And -- comments out rest of line If script uses truth of statement to determine valid login, attacker has logged in

Basis of SQL Injection Problem Unvalidated input Server expected plain data Got back SQL commands Didn’t recognize the difference and went ahead Resulting in arbitrary SQL query being sent to its database With its privileges

Some Example Attacks 130 million credit card numbers stolen in 2009 with SQL injection attack Used to steal 1 million Sony passwords Yahoo lost 450,000 passwords to a SQL injection in 2012 Successful SQL injections on Bit9, British Royal Navy, PBS Ruby on Rails had built-in SQL injection vulnerability in 2012

Solution Approaches Carefully examine all input Use database access controls Randomization of SQL keywords Avoid using SQL in web interfaces Parameterized variables

Examining Input for SQL SQL is a well defined language Generally web input shouldn’t be SQL So look for it and filter it out Problem: proliferation of different input codings makes the problem hard Problem: some SQL control characters are widely used in real data E.g., apostrophe in names

Using Database Access Controls SQL is used to access a database Most databases have decent access control mechanisms Proper use of them limits damage of SQL injections Problem: may be hard to set access controls to prohibit all dangerous queries

Randomization of SQL Keywords Change all SQL keywords into something random Then translate all your internal queries to that new “language” Those trying SQL injection need to inject your language, not standard SQL Problem: security is based on a secret Problem: could cause unexpected errors from otherwise correct behavior

Avoid SQL in Web Interfaces Never build a SQL query based on user input to web interface Instead, use predefined queries that users can’t influence Typically wrapped by query-specific application code Problem: may complicate development

Use Parameterized Variables SQL allows you to set up code so variables are bound parameters Parameters of this kind aren’t interpreted as SQL Pretty much solves the problem, and is probably the best solution

Conclusions The World Wide Web is a vital element of the Internet Provides the interface and underlying protocols for a lot of network services It has become ever more complex Making it harder and harder to secure