Program Transformations to Remove Integer-Handling Vulnerabilities in C Programs Zack Coker, Munawar Hafiz

Slides:



Advertisements
Similar presentations
* College Intern, West Virginia Wesleyan, Buckhannon, WV.
Advertisements

1 9/13/06CS150 Introduction to Computer Science 1 Type Casting.
COMP3221: Microprocessors and Embedded Systems Lecture 14: Floating Point Numbers Lecturer: Hui Wu Session 2, 2004.
1 9/17/07CS150 Introduction to Computer Science 1 Type Casting.
Scope and Casting. Scope Region of the program where a particular name can be referenced Formal parameters and local variables –can be accessed from within.
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
Software and Software Vulnerabilities. Synopsis Array overflows Stack overflows String problems Pointer clobbering. Dynamic memory management Integer.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 13P. 1Winter Quarter Scope of Variables.
Data Representation Kieran Mathieson. Outline Digital constraints Data types Integer Real Character Boolean Memory address.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Representation and Conversion of Numeric Types 4 We have seen multiple data types that C provides for numbers: int and double 4 What differences are there.
Computer Science Jan 2011 Robot Game. Introduction to Robot Arcade game Collect all of the items while avoiding the enemy (robot) Objectives More extensive.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Arithmetic for Computers
CSC 386 – Computer Security Scott Heggen. Agenda Introduction to Software Security.
CENG 311 Machine Representation/Numbers
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
Review C++ exception handling mechanism Try-throw-catch block How does it work What is exception specification? What if a exception is not caught?
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
Implementation Considerations Yonglei Tao. Components of Coding Standards 2  File header  file location, version number, author, project, update history.
Rote Learning of the Week "A variable is a named section of RAM that stores data of a specific data type"
Chapter 4: Overview of Preventive Maintenance
Version 02U-1 Computer Security: Art and Science1 Penetration Testing by Brad Arkin Scott Stender and Gary McGraw.
CSC 107 – Programming For Science. Announcements  Textbook available from library’s closed reserve.
IT253: Computer Organization Lecture 3: Memory and Bit Operations Tonga Institute of Higher Education.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Dynamic Memory Allocation 9.8.
1 CSC 110AA Introduction to Computer Science for Majors - Spring 2003 Class 5 Chapter 2 Type Casting, Characters, and Arithmetic Operators.
CPS120: Introduction to Computer Science Operations Lecture 9.
Mathematical Calculations in Java Mrs. G. Chapman.
Program Development Cycle Modern software developers base many of their techniques on traditional approaches to mathematical problem solving. One such.
CSC 107 – Programming For Science. The Week’s Goal.
Date: November 9, 2011 Presenter – Munawar Hafiz Assistant Professor, CSSE, Auburn University A Tale of Four Research Ideas.
Chapter 3: Assignment, Formatting, and Interactive Input.
CSCE 548 Integer Overflows Format String Problem.
Computer Science and Software Engineering© 2014 Project Lead The Way, Inc. Procedural Abstraction Object-Oriented Code.
Mathematical Calculations in Java Mrs. C. Furman.
This will all add up in the end. Assignment operator =Simple Assignment operator Arithmetic Operators +Additive operator – Subtraction operator * Multiplication.
Institute for Applied Information Processing and Communications (IAIK) – Secure & Correct Systems 1 Robert Könighofer and Roderick Bloem IAIK – Graz University.
S ECURE P ROGRAMMING 6. B UFFER O VERFLOW (S TRINGS AND I NTEGERS ) P ART 2 Chih Hung Wang Reference: 1. B. Chess and J. West, Secure Programming with.
Sairajiv Burugapalli. This chapter covers three main categories of classic software vulnerability: Buffer overflows Integer vulnerabilities Format string.
1 Fundamentals of Computer Science Combinational Circuits.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Chapter 10 Chapter 10 Implementing Subprograms. Implementing Subprograms  The subprogram call and return operations are together called subprogram linkage.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Multiplication Timed Tests.
Chapter 3 Math Operations. Objectives Use the assignment and arithmetic operators. Use operators in output statements. Explain the problem with division.
Secure Coding Rules for C++ Copyright © 2016 Curt Hill
Shellcode COSC 480 Presentation Alison Buben.
Instructor: David Ferry
Variables Data Types and Assignment
Secure Coding Rules for C++ Copyright © Curt Hill
COMP3221: Microprocessors and Embedded Systems
Chapter 9 Pointers Objectives
Math in C The math blocks you've used in Scratch can all be recreated in C!
Learning Objectives What else in C++ Bitwise operator
Lecture 3 Expressions Richard Gesick.
Chapter 14 Bitwise Operators Objectives
Pointer Operations.
CISC181 Introduction to Computer Science Dr
Java Programming Review 1
See requirements for practice program on next slide.
Welcome to AP Computer Science A!
Variables Data Types and Assignment
Computer Organization COMP 210
CS2S562 Secure Software Development
Variables Data Types and Assignment
Oriented Design and Abstract Data Type
Testing & Security Dr. X.
Presentation transcript:

Program Transformations to Remove Integer-Handling Vulnerabilities in C Programs Zack Coker, Munawar Hafiz Computer Science and Software Engineering, Auburn University S oftware A nalysis T ransformation & S ecurity Is it possible to create automated program transformations that refactor a program to remove its integer- handling vulnerabilities in C? Integer-handling vulnerabilities are common security flaws in a program In many cases it is complicated to remove the vulnerability once it is found We are developing a tool to perform source-to-source program transformations on a possible vulnerability to create a version where the vulnerability and any related vulnerabilities are removed throughout the file. This corrections are available in three refactorings: 1.Add Integer Cast 2.Replace Arithmetic Operator 3.Integer Type change This transformation adds typecasts to a program when the selected variable is used as a different integer type in a few cases. Example: … unsigned int i; int s; … // instances where s is used correctly s = i; //Notice Type Mismatch!! … while(s > 90) //Notice Type Mismatch!! … unsigned int i; int s; … // instances where s is used correctly s = (int)i; //Fixed Type Mismatch … while((unsigned int) s > 90) //Fixed Type Mismatch … In C, arithmetic operations are not checked for overflow. In vulnerable cases, these operations are replaced by functions that check for overflow. Example: … int a, b; … // a and b are assigned values If(a+b< 60) // Possible Error Due to Overflow!! … #include IntegerLib.h … int a, b; … // a and b are assigned values If(addsi(a,b)< 60) //Overflow is Prevented … In cases where the integer type is used incorrectly throughout the program, the code will change the integer to the correct type. Example: … unsigned int i; int s; //Notice Incorrect Type Decleration!! … s = i; //Notice Type Mismatch!! … while(s > 90) //Notice Type Mismatch!! … unsigned int i; unsigned int s; //Declared to Correct Type … s = i; //Fixed Type Mismatch … while(s > 90) //Fixed Type Mismatch … These transformations are implemented as an Eclipse plugin in the CR-12, a program transformation for C, a larger security transformation effort which addresses multiple vulnerability types. When completed, CR-12 should be able to address all of the security vulnerabilities which can be fixed through program transformations. At the moment, basic implementations of the add integer cast and replace arithmetic operator transformations have been completed and tested on small programs. A basic implementation of integer type change is currently being created. Once that is finished, the transformations will be tested on larger codes, and they will be refined to a more advanced state. There are two main types: integer overflow and signed vulnerabilities. Integer overflow is due to limited space to store integer values. When values become too large, they wrap around and become the lowest value. Signed Vulnerabilities are due to the different values you can store in signed and unsigned values when changing between them.