1 Web Application Security (and why it matters to YOU!) -Remix- By Mark Bristow and Doug Wilson

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Cross-site Request Forgery (CSRF) Attacks
Web Security Never, ever, trust user inputs Supankar.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
Don’t get Stung (An introduction to the OWASP Top Ten Project) Barry Dorrans Microsoft Information Security Tools NEW AND IMPROVED!
SEC835 OWASP Top Ten Project.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
9/9/2005 Developing "Secure" Web Applications 1 Methods & Concepts for Developing “Secure” Web Applications Peter Y. Hammond, Developer Wasatch Front Regional.
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
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.
Software Security Course Course Outline Course Overview Introduction to Software Security Common Attacks and Vulnerabilities Overview of Security.
Presenter Deddie Tjahjono.  Introduction  Website Application Layer  Why Web Application Security  Web Apps Security Scanner  About  Feature  How.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
OWASP Mobile Top 10 Why They Matter and What We Can Do
Security and Risk Management. Who Am I Matthew Strahan from Content Security Principal Security Consultant I look young, but I’ve been doing this for.
Web Application Security (and why it matters to YOU!) By Mark Bristow and Doug Wilson.
Web Security Demystified Justin C. Klein Keane Sr. InfoSec Specialist University of Pennsylvania School of Arts and Sciences Information Security and Unix.
Evolving Threats. Application Security - Understanding the Problem DesktopTransportNetworkWeb Applications Antivirus Protection Encryption (SSL) Firewalls.
Introduction to Application Penetration Testing
OWASP Zed Attack Proxy Project Lead
HTTP and Server Security James Walden Northern Kentucky University.
The OWASP Way Understanding the OWASP Vision and the Top Ten.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
Ryan Dewhurst - 20th March 2012 Web Application (PHP) Security.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Introduction To Web Application Security in PHP. Security is Big And Often Difficult PHP doesn’t make it any easier.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
Crash Course in Web Hacking
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 9 1COMP9321, 15s2, Week.
CS526Topic 12: Web Security (2)1 Information Security CS 526 Topic 9 Web Security Part 2.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
OWASP Building Secure Web Applications And the OWASP top 10 vulnerabilities.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
Web Application (In)security Note: Unless noted differently, all scanned figures were from the textbook, Stuttard & Pinto, 2011.
Intro to Web Application Security. iHostCodex Web Services - CEO Project-AG – CoFounder OWASP Panay -Chapter Leader -Web Application Pentester -Ethical.
Do not try any of the techniques discussed in this presentation on a system you do not own. It is illegal and you will get caught.
Page 1 Ethical Hacking by Douglas Williams. Page 2 Intro Attackers can potentially use many different paths through your application to do harm to your.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Application Vulnerabilities
Intro to Web Application Security
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
World Wide Web policy.
Finding and Fighting the Causes of Insecure Applications
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Riding Someone Else’s Wave with CSRF
امنیت نرم‌افزارهای وب تقديم به پيشگاه مقدس امام عصر (عج) عباس نادری
CSC 495/583 Topics of Software Security Intro to Web Security
Lecture 2 - SQL Injection
Finding and Fighting the Causes of Insecure Applications
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Presentation transcript:

1 Web Application Security (and why it matters to YOU!) -Remix- By Mark Bristow and Doug Wilson

2 Your presenters today are Doug Wilson Senior Application Engineer at SAIC Mark Bristow Information Assurance Engineer at SRA International

3 Why are we here?

4 A brief discussion on What is Web Application Security? and why does it matter? A look at the top problems on the web today And what you can do to remediate them. So, what is web application security?

5 Web application security is... An overall process that Starts in the initial planning stages Continues through coding, testing, and deployment Doesn’t finish until the lifecycle is completely finished

6 But why does this matter to me? Overcoming Denial No one would ever bother with my web site. We already have “security” We use open source We use “that” vendor We keep up on patches “So we have a firewall, an IDS, an IPS, and use SSL... we’re covered... right?”

7 No, you are probably NOT ok... The web was designed as a trusted environment. It is NOT that anymore. Web applications are still “emerging technologies” for most organizations. The drive to stay competitive results in unrealistic expectations and unsafe practices.

8 Looking at Some Recent IT nightmares VA and other government agencies  Personally Identifiable Information (PII) for 26.5 million veterans TJ Maxx and credit card processing  45 million credit card numbers AOL and User Data  19 million queries from 650,000 subscribers PaineWebber logic bomb  2000 servers, over $3.1 million just to restore

9 Web App specific numbers Symantec ISTR Jan-Jun 2007 (from September 2007)  “61 percent of all vulnerabilities disclosed were Web application vulnerabilities.”  “users... can no longer place their trust in well known sites.” CIO Magazine interviews Jeremiah Grossman (5/07)  Vulnerabilities in 80% of websites analyzed  Remaining 20% are mostly static sites  Most C-level execs they talk to think firewalls protect against web application attacks -- THIS IS NOT TRUE!!!

10 The bottom line? -- Liability Liability is not only costly financially, it can damage intangibles beyond repair. Even if you can afford to lose money, how much is your reputation worth? Regardless of the who broke it, the liability lies with the people who create and maintain these systems and their management.

11 So, how can we fix this?

12 OWASP -- what is that? Open Web Application Security Project  Top Ten  “Guides” Building secure web apps and services Application testing Code review  Code projects  Local Chapters, meetings, and conferences

13 OWASP Top 10 – err... Top 5?  Cross Site Scripting (XSS)  Injection Flaws  Malicious File Execution  Insecure Direct Object Reference  Cross Site Request Forgery (CSRF)

14 Cross Site Scripting (XSS) What is Cross Site Scripting?  Occurs when an application takes user supplied data and sends it to a web browser without validating or encoding that content  In English: Can be anywhere you echo user input Getting the user to execute arbitrary code in their web browser XSS is everywhere, if you don’t find it, are you doing something wrong?

15 Why is XSS so dangerous? Compromise victim computer Can steal user’s authentication credentials Intranet Port scanning Stealing Sensitive Data Key/Mouse logging WebWorms

16 XSS Demo

17 Injection Flaws Occurs when user supplied data is sent to an interpreter as part of a command or query Comes in many flavors: SQL, LDAP, XPath, XSLT, HTML, XML, OS command injection, and more

18 Injection Flaws – SQL Injection So, most people here have probably heard of... SQL Injection Injecting code to modify the intent of a SQL query What can I do with SQL Injection? Break or bypass Authentication Has the potential to expose your database data to an attacker Attacker can potentially modify your database structure and data Select * from users where uname =‘’ and pw=‘’OR ‘Z’=‘Z’

19 SQL Injection Demo

20 Fixing Injection Flaws The top two flaws are based on Injection Most of these are easily solved by following a few simple concepts religiously, in the way that works for your environment. Don’t trust ANYTHING that comes from the client. Ever. 1. Validate and type all input as strictly as you can. 2. Encode and control all output as strictly as you can.

21 Input Validation Client side -- doesn’t really do anything for security, though it still has its uses Server side – The only place where your validation provides security Regex – Your new best friend

22 Mechanics of good Validation White listing – Pass only when content contains only known good input Black Listing – Fail when a known bad is detected Sanitization – “Clean” data before using it based on Black or White List

23 Sanitization Issues Lets sanitize the name field against script injection  String name = request.getParameter( "name" );  name.replaceALL(“script”, “”);  out.println(name); Test cases  Name = “ alert(‘I pwnt j00’); ”  Result: <>alert(‘I pwnt j00’);  Name = “ alert(‘I pwnt j00’); ”  Result: alert(‘I pwnt j00’); Sometimes this is a necessary evil

24 Output Encoding Output should be encoded to match the delivery medium If it will be HTML, HTML encode. Ex: < becomes < HTML Entity encoding will stop 99% of XSS attacks

25 Implementing Input Validation We are going to implement a white list validation for the username field What charecters are allowed in usernames?  A-Z upper and lower case  Integers What regular expression matches this criteria  [a-zA-Z0-9] How would we implement it in PHP  if (preg_match('/[^a-zA-Z0-9]/', $username)){ *FAIL* }

26 Implementing Input Validation

27 Now, back to our top or 5...

28 Malicious File Execution Occurs when developers use user input directly in file or stream functions, or improperly trust uploaded content Can lead to rootkit installs and server compromise Many sites allow you to upload images or documents. The demo site allows you to submit reports. If this report submission is unfiltered you may be able to upload code to the website

29 Malicious File Execution Demo

30 Insecure Direct Object Reference A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, database record, or key, as a URL or form parameter. Resource authorization checks should be conducted when the resouce is requested Common Examples  User ID on query string: showAccount.php?id=2345  Session ID on query String: index.php?PHP_SESSID=51h3nrstvi0mm60k2j179iqtg6  Directory Traversal

31 Directory Traversal Demo

32 Fixing Object Access Flaws Don’t trust ANYTHING that comes from the client. Ever.  Validate and type all input as strictly as you can.  Encode and control all output as strictly as you can. Do you sense a trend here? Perform authorization checks every time a resource is requested

33 Cross Site Request Forgery (CSRF) When an attacker forces a victim’s browser to submit a request the victim did not intend to submit Also known as a “One click attack”, session riding or XSRF Exploits pre-established trust relationship (session) to force authorization High remediation costs Malicious requests and legitimate requests are indistinguishable. Originally dates to 1998 but is just becoming well understood

34 CSRF DEMO

35 Fixing CSRF CSRF is often labeled as “unfixable,” it’s inherent in how the web works. But you can take steps to help. Problems and safeguards  Data returned as javascript (Gmail) -- fixed by while(); loop  Digg article -- fix: secret tokens (a.k.a. Nonces)  Amazon One-Click -- fix: Password re-entered Fixes work -- unless you combine with XSS. Then the rules change, and some standard fixes go out the window (like secret tokens)

36 The rest of the OWASP Top 10 Information Leakage  Error messages provide vital tools to an attacker Broken Session Management Insecure Cryptographic Storage Insecure Communications  SSL is a web attacker’s best friend Failure to restrict URL access  What happens when I request an admin page directly without logging in first?

37 The AJAX question Does AJAX and other similar technologies make for “worse” application security? What about web services? Asynchronous applications and web services aren’t innately more “insecure,” but greatly increase complexity and attack surface. Both Asynchronous and Web Service style applications have the potential to reintroduce a lot of old problems. Minimalist approach is best

38 Is the Sky Falling? The sky is NOT falling! All of the vulnerabilities mentioned here can be fixed Developer education and a robust software security program can help mitigate these issues Educate yourselves Educate your customers

39 How do I get started? LEARN! What threats are out there and how they apply to your organization? Classify what data is most important to your organization Identify all of your web applications and assign them criticalities based on business needs and data classification Perform vulnerability assessments to determine how big the problem is “Bake security in” to your SDLC

40 Resources Sites     Books  How to Break Web Software  Hacking Exposed : Web Applications  XSS ATTACKS Training  Certified Ethical Hacker (CEH)  Foundstone Ultimate Web Hacking  SANS Training Securing Critical Web Applications and Web Services (Aspect Security) Writing Secure Web Applications: Developer Training

41 Questions? stop by onelittlewindow.org