Software security assessment based on static analysis



Similar documents
Automatic vs. Manual Code Analysis

Application Code Development Standards

Idea: Measuring the Effect of Code Complexity on Static Analysis Results

X05. An Overview of Source Code Scanning Tools. Loulwa Salem. Las Vegas, NV. IBM Corporation IBM System p, AIX 5L & Linux Technical University

Passing PCI Compliance How to Address the Application Security Mandates

Source Code Review Using Static Analysis Tools

Programming Flaws and How to Fix Them

Secure Software Programming and Vulnerability Analysis

Application Backdoor Assessment. Complete securing of your applications

Software security specification and verification

A Test Suite for Basic CWE Effectiveness. Paul E. Black.

D. Best Practices D.1. Assurance The 5 th A

Measuring the Effect of Code Complexity on Static Analysis Results

Qualitative & Quantitative Evaluation of Static Code Analysis Tools

The Need for Fourth Generation Static Analysis Tools for Security From Bugs to Flaws

How I Learned to Stop Fuzzing and Find More Bugs

Protect Your Organization With the Certification That Maps to a Master s-level Education in Software Assurance

TOOL EVALUATION REPORT: FORTIFY

Improving Software Security at the. Source

Securing Network Software using Static Analysis

Auditing a Web Application. Brad Ruppert. SANS Technology Institute GWAS Presentation 1

Application Security Testing How to find software vulnerabilities before you ship or procure code

Software Security Touchpoint: Architectural Risk Analysis

Introduction. Secure Software Development 9/03/2015. Matias starts. Daan takes over. Matias takes over. Who are we? Round of introductions

Learning objectives for today s session

Static Checking of C Programs for Vulnerabilities. Aaron Brown

Black Box versus White Box: Different App Testing Strategies John B. Dickson, CISSP

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

Braindumps.C questions

Precise XSS Detection with Static Analysis using String Analysis

Linux Kernel. Security Report

Plain English Guide To Common Criteria Requirements In The. Field Device Protection Profile Version 0.75

Application Intrusion Detection

Software Security Testing

Architectural Risk Analysis for Android Applications

Detecting Software Vulnerabilities Static Taint Analysis

Advanced ANDROID & ios Hands-on Exploitation

HP Fortify Static Code Analyzer

IBM Rational AppScan: Application security and risk management

Common Errors in C/C++ Code and Static Analysis

Scan Your Source Code To Locate Weak Spots Early

IBM Rational AppScan Source Edition

LEARNING CURRICULUM SECURITY COMPASS TRAINING 2015 Q3. Copyright Security Compass. 1

Visualizing Information Flow through C Programs

On the value of hybrid security testing

elearning for Secure Application Development

Software Security Analysis - Execution Phase Audit

Source Code Security Analysis Tool Functional Specification Version 1.0

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

Security Testing and Vulnerability Management Process. e-governance

Product Roadmap. Sushant Rao Principal Product Manager Fortify Software, a HP company

What is Web Security? Motivation

Review of source code analyzers. Gerard Frankowski, Tomasz Nowak PSNC Poznań, June connect communicate collaborate

Secure Programming with Static Analysis. Jacob West

Introduction to Web Application Security. Microsoft CSO Roundtable Houston, TX. September 13 th, 2006

Know or Go Practical Quest for Reliable Software

90% of data breaches are caused by software vulnerabilities.

Systematically Enhancing Black-Box Web Vulnerability Scanners

The security of Web applications

Early Vulnerability Detection for Supporting Secure Programming

Course Modules for Software Security

The FDA Forensics Lab, New Tools and Capabilities

Homeland Security Red Teaming

DISCOVERY OF WEB-APPLICATION VULNERABILITIES USING FUZZING TECHNIQUES

Access Control Fundamentals

How To Ensure That Your Computer System Is Safe

Juniper Networks Secure

CS 392/681 - Computer Security. Module 16 Vulnerability Analysis

Defense in Depth: Protecting Against Zero-Day Attacks

Transparent Monitoring of a Process Self in a Virtual Environment

Gold Standard Method for Benchmarking C Source Code Static Analysis Tools

Real World Software Assurance Test Suite: STONESOUP

Evaluating Static Source Code Analysis Tools by Thomas Hofer

Introduction to Static Analysis for Assurance

Session 3: Security in a Software Project

KEN VAN WYK. Fundamentals of Secure Coding and how to break Software MARCH 19-23, 2007 RESIDENZA DI RIPETTA - VIA DI RIPETTA, 231 ROME (ITALY)

OWASP Mobile Top Ten 2014 Meet the New Addition

Making your web application. White paper - August secure

Using the Juliet Test Suite to compare Static Security Scanners

Development. Resilient Software. Secure and. Mark S. Merkow Lakshmikanth Raghavan. CRC Press. Taylor& Francis Croup. Taylor St Francis Group,

-.% . /(.0/ ) 53%/( (01 (%((. * 7071 (%%2 $,( . 8 / 9!0/!1 . # (3(0 31.%::((. ;.!0.!1 %2% . ".(0.1 $) (%+"",(%$.(6

Whitebox Security Testing Using Code Scanning

Lecture 9. Semantic Analysis Scoping and Symbol Table

Web Application Security. Vulnerabilities, Weakness and Countermeasures. Massimo Cotelli CISSP. Secure

Windows Phone 7 Internals and Exploitability

Towards practical reactive security audit using extended static checkers 1

1/20/2016 INTRODUCTION

IBM Security AppScan Source

Columbia University Web Security Standards and Practices. Objective and Scope

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

Testing for Security

Web Application Security

Web application testing

Institutionen för datavetenskap Department of Computer and Information Science

Bitrix Software Security. Powerful content management with advanced security features

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science

Numerology - A Case Study in Network Marketing Fractions

Transcription:

Software security assessment based on static analysis Christèle Faure Séminaire SSI et méthodes formelles Réalisé dans le projet Baccarat cofinancé par l union européenne

Context > 200 static tools for security at source code level Many programming languages: C, C++, Java, Ada, Perl, Python, PHP, Javascript A wide range of underlying technologies: from grep to abstract interpretation Main security issues: Identification of dangerous function calls Textual analysis from data base Identification of dangerous patterns Pattern matching from data base Detection of non conformances to design and coding rules Data and control flows Proof of absence of errors and weaknesses Sound semantic analysis 2

Illustration of underlying techniques Problem: Identify calls to fscanf and their impact on security Code example (123) fscanf (file,format,precious); (124) If (cond){compute1(precious, result1);} (125) {compute2(precious, result2);} Results Textual analysis line 123 Pattern matching INPUT(file), FORMAT(format) Data and control flows file impacts precious Sound semantic analysis precious impacts {result1, result2} 3

Identification of dangerous calls RATS, (ITS4 dead), Flawfinder, Pscan Flawfinder log extract Flawfinder version 1.27, (C) 2001-2004 David A. Wheeler. Number of dangerous functions in C/C++ ruleset: 160 Examining test.c Examining test2.c test.c:32: [5] (buffer) gets: Does not check for buffer overflows. Use fgets() instead. Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! 4

Identification of dangerous patterns McCabe IQ Microsoft SDL banned Function calls Analysis kernel Function call relationships connecting Attack surface: input routines Attack target: banned functions Complexity measures Klocwork CWE software weaknesses Analysis kernel Dataflow Analysis on the Control Flow Graph to monitor data objects creation, modification, use and deletion Symbolic Logic to remove any path that cannot be executed at runtime Accurate Bug Identification and Vulnerability Analysis 5

McCabe IQ Complexity and presence of dangerous function calls 6

Detection of non conformances IBM Rational AppScan (Ounce Security analyst ) Web flaws (OWAST Top 10) PCI Data Security Standards, ISO 17799, ISO 27001, Basel II, SB 1386, PABP (Payment Application Best Practices). Analysis kernel String analyses Hybrid analysis: automatic correlation of static and dynamic results HP Fortify SCA Gary Mac Graw seven kingdoms Analysis kernel Semantic analyzer detects use of vulnerable functions Data flow analyzer tracks tainted input Control flow analyzer tracks improper sequencing of operations 7

Detection or proof of absence of errors Class of errors Concurrency Example of errors Deadlock, data race conditions Tools Fluid tools, RacerX, Warlock Memory Runtime Memory leak, buffer overrun Non initialize variable, division by 0 Numerical Cancellation Fluctuat Clousot, Sparrow, C Global Surveyor, BoundsChecker, Code Advisor, Coverity Astrée, PolySpace, Frama-C, Inspector, Lintplus Dead code Dead code PolySpace, STATIC 8

Detection or proof of absence of errors (cont.) Constraints Assertion failure Astrée, PolySpace, Frama- C Execution time Clones Worst case execution time Cut and paste not well used 64 bit Not portable constructs 32 to 64 bits Dangerous calls Format string Ait WCET Bauhaus, CCFinderX, Clone Doctor, AntiCutandPaste Viva64 Protocol Secrecy properties CSur Vulncheck (gcc option) 9

Synthesis Most security tools Combine several methods Pattern matching and control flow Static analysis and complexity Static analysis and dynamic analysis (test) Tools based on abstract interpretation Use one technique Prove the absence of Targeted errors (memory errors) Roots of security flaws Give results difficult to interpret 10

Approach Development of a new tool Enable users to Define security objectives Analyze exploitability of security flaws Perform depth on demand analysis Techniques Combine techniques from syntactic to abstract interpretation Data and control flow analysis Value analysis Pointer analysis Combine static and dynamic analysis 11

Features Detection of common weaknesses CWE including complex (race conditions, ToCToU] OWASP Analysis of user defined filtering and protection means Verification of user defined security policies Access policies Flow control policies Detection of covert/side channels Exploitability of security flaws 12

Carto-C tool Software security audit Input: Security objective (security policy) Piece of software (source code) Output: Arguments to show Insecurity w.r.t. the objective: problems found Security w.r.t. the objective 13

Use cases (1) Audit objective: Valid attack surface Tool knowledge Elements of the attack surface are IO functions, C library functions User provided input: Source code Specification of constraints on the attack surface Overall size Absence of some calls Output: Actual attack surface Verification of the constraints specified 14

Use case (2) Objective: Absence of information leak User provided input: Source code List of asset names Output: Accesses to assets (read / write) Impact of assets on output 15

Use case (3) Objective: Correctness of asset protections User provided input: Source code List of asset names List of asset protection functions Output: Accesses to assets (read / write) Location of call to protections on the source code Presence/absence of protections on computational flows List of unprotected assets 16

Use case (4) Objective: Correctness of input/output filtering User provided input: Source code List of IO filtering functions (sanitization) Output: List of input/output channels Location of filtering functions on the source code Presence/absence of filtering on computational flows Input: between input and use Output: between definition and output List of unprotected channels 17

Example Inputs Source code : User provided input : 0: x=getc(fic1); 1: gets(line); 2: system(line); Asset (precious) Protection(precious,In, decrypt) 3: fscanf(fic2,format,precious); 4: y=compute(decrypt(precious),x); 5: z=makefullcomputation(x,y); 6: printf(z); Filter(system,In, filter_command) 18

Exemple Output (1) Map Channel Asset 0 IN(getc) fic1 1 IN(gets) keyboard 2 OUT(system) 3 IN(fscanf) fic2 precious Occurrence(precious) 4 Occurrence(precious) Occurrence(decrypt) 5 6 OUT(printf) environment precious decrypt 19

Protection(precious,In,decode) Protection(system,In,filter_command) Example output (2) fic1 (0) fic2 (3) keybd (2) x precious line decrypt Z y envt system Error initial graph closure 20

Underlying technologies Data-flow, control-flow, abstract interpretation Exploration of the source code Computation of IO interfaces Search for occurrences of declared assets Search for protections Dependencies computation Inter-procedural Aliasing Projected on target paths Closed by target input / output points 21

Conclusions Carto-C: first implementation over Frama-C Need for C++, Java languages Coupling with Dynamic analysis (FLOID) Binary/bytecode analysis (Binsec) Open to new collaborations Need of access to user code for a proof of concept 22