Chapter 5 Handling Input.

Slides:



Advertisements
Similar presentations
S ECURE P ROGRAMMING 5. H ANDLING I NPUT (P ART 1) Chih Hung Wang Reference: 1. B. Chess and J. West, Secure Programming with Static Analysis, Addison-Wesley,
Advertisements

Exploring Office Grauer and Barber 1 Tables and Forms: Properties, Views, and Wizards(Wk3)
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.
1 Introduction to Computers and Programming Quick Review What is a Function? A module of code that performs a specific job.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Attribute databases. GIS Definition Diagram Output Query Results.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Cookies & Sessions.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
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.
Use to Implement: Input validation Page-Level authorization Session Management Audit Logging Use to Implement: Input validation Page-Level authorization.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory, Enhanced Chapter 4: Active Directory Architecture.
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.
Microsoft Access 2013 Design and Create Tables to Store Data Chapter 2.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
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.
11 Using ADO.NET II Textbook Chapter Getting Started Last class we started a simple example of using ADO.NET operations to access the Addresses.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
Accessing Your MySQL Database from the Web with PHP (Ch 11) 1.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
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.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
3/6: Data Management, pt. 2 Refresh your memory Relational Data Model
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
1 Intro stored procedures Declaring parameters Using in a sproc Intro to transactions Concurrency control & recovery States of transactions Desirable.
CHAPTER 5 MANAGING USER ACCOUNTS & GROUPS. User Accounts Windows 95, 98 & Me do not need a user account like Windows XP Professional to access computer.
SQL Injection Anthony Brown March 4, 2008 IntroductionQuestionsBackgroundTechniquesPreventionDemoConclusions.
Chapter X Handling Input. VALIDATE! Validate all input Validate input from ALL sources Establish trust boundaries: store validated and unvalidated data.
Network Security Philadelphia UniversitylAhmad Al-Ghoul Module 7 Module 7 Data Base Security  MModified by :Ahmad Al Ghoul  PPhiladelphia.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
SQL Triggers, Functions & Stored Procedures Programming Operations.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
Microsoft Access 2016 Design and Create Tables to Store Data
Getting started with Accurately Storing Data
Fundamentals of DBMS Notes-1.
Chapter VII: Arrays.
SQL Injection.
Database System Implementation CSE 507
COMP 430 Intro. to Database Systems
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Chapter 7: Identifying Advanced Attacks
Dynamic SQL Writing Efficient Queries on the Fly
Udaya Shyama Pallathadka Ganapathi Bhat CSCE 548 Student Presentation
Protecting Memory What is there to protect in memory?
SQL and SQL*Plus Interaction
Authentication & .htaccess
SQL Injection.
2008/11/19: Lecture 18 CMSC 104, Section 0101 John Y. Park
Microsoft Access 2013 Design and Create Tables to Store Data
SQL Injection Attacks Many web servers have backing databases
Dynamic SQL Writing Efficient Queries on the Fly
User Defined Functions
CSCI 3370: Principles of Programming Languages Chapter 9 Subprograms
Design and Create Tables to Store Data Chapter 2
Kristina Dourmashkin Eurostat Unit E4
Kristina Dourmashkin Eurostat Unit E4
Chapter 7 Using SQL in Applications
Contents Preface I Introduction Lesson Objectives I-2
Chapter 7 Using SQL in Applications
CS5123 Software Validation and Quality Assurance
CodePainter Revolution Trainer Course
2008/11/19: Lecture 18 CMSC 104, Section 0101 John Y. Park
Presentation transcript:

Chapter 5 Handling Input

VALIDATE! Validate all input Validate input from ALL sources Establish trust boundaries: store validated and unvalidated data separately to ensure that validation is always performed.

How to validate Use strong validation Avoid blacklisting Don't mistake validation for usability with validation for security. Reject bad data. Make good input validation the default. Use abstraction. Always check input length. Bound numeric input. (Above and below).

What to validate VALIDATE ALL INPUT Examples: Command line parameters, config files, data retrieved from a database, environment variables, Network services, registry values, system properties, temporary files, etc. Attack surface of an application (places where it accepts input) = set of function calls that are invoked externally or provide external data. Examples: cin, int main(args...)‏ Two kinds of validation: Syntax checking Semantic Checking

Some bad examples .htaccess file in Apache (page 123)‏ --delimiter parameter (page 124)‏

Database Queries Hard to check accuracy of database data. However sanity checks are a definite must: If the output is expected to be unique, check for only one row of data. Check the format of the data returned from the database: bad data could be the result of a misformed query or worse! Other, ad-hoc checks could be made.

Network Services DO NOT TRUST DNS NAMES DO NOT TRUST IP ADDRESSES DNS CACHE POISONING has happened and will happen again. Problem can happen for both outgoing and ingoing communications. Cautionary tales: Apple OS X (page 129) Sony Rootkit eraser

Establish Trust Boundaries Beware of mixing validated and unvalidated data; very easy to do sometimes. For example, sometimes all the data has to be read before it can be validated For example, a complex data structure is read and is hard to validate.

How to Validate Check input length (min and max)‏ Bound numeric values (min and max)‏ Whitelist: have a list of acceptable inputs to check against. Indirect Selection: index into a list of acceptable inputs. Whitelist: check the format (e.g. Phone numbers) Use regex? Avoid blacklisting. Beware of doubledecoding. Don't mistake usability for security. Reject bad data. Create a security-enhanced input API. Consistent – maintainable – constant – omnipresent

Metacharacter Vulnerabilities Metacharacters (' ; .. / \ && \n ...) are very dangerous. Use parameterized commands. Example: instead of SQL(...) use Select(<from>,<var>,<value>) for Select * FROM <from> WHERE <var> = '<value>' Beware of Path manipulation Command separation/injection Log Forging