Putting the dynamic into software security testing

Similar documents
Automotive Software Security Testing

Unit Testing with VectorCAST and AUTOSAR

CS 153 Design of Operating Systems

CS 153 Design of Operating Systems Spring 18

Benefits of Collecting Code Coverage Metrics during HIL/ECU Testing

Vector Logger Cloud. VECTOR GB Ltd Conference, 28th Sept, 2017 V

CS 153 Design of Operating Systems Spring 18

Diagnostics is evolving

Risk Based Security. Automotive Safety & Security, 30. Mai 2017 Christof Ebert and Dominik Lieckfeldt, Vector Consulting Services V1.

CS 153 Design of Operating Systems Spring 18

webinar series

Making Full Use of Multi-Core ECUs with AUTOSAR Basic Software Distribution

CAPL Scripting Quickstart

CAN FD. An Introduction V

DSCS6020: SQLite and RSQLite

Lecture 13: Exceptions and Interrupts

Enabling Connectivity with Service Oriented Architectures

CS 153 Design of Operating Systems

EMC ViPR. User Guide. Version

CS 153 Design of Operating Systems Spring 18

CS 153 Design of Operating Systems

Illumina LIMS. Software Guide. For Research Use Only. Not for use in diagnostic procedures. Document # June 2017 ILLUMINA PROPRIETARY

AUTOSAR System and Software Design with PREEvision

Overview of Security Support in Vector Tools

Lecture 4: Routing. CSE 222A: Computer Communication Networks Alex C. Snoeren. Thanks: Amin Vahdat

Today s Lecture. Software Architecture. Lecture 27: Introduction to Software Architecture. Introduction and Background of

CANoe/CANalyzer. Tools for comprehensive CAN Network Analysis and Test - An Overview V

POWER-OF-2 BOUNDARIES

CS 153 Design of Operating Systems Spring 18

EXAMINATIONS 2003 END-YEAR COMP 203. Computer Organisation

What s New in AUTOSAR?

Tdb: A Source-level Debugger for Dynamically Translated Programs

Dr Paolo Guagliardo. Fall 2018

EMC VNX Series. Problem Resolution Roadmap for VNX with ESRS for VNX and Connect Home. Version VNX1, VNX2 P/N REV. 03

Local Run Manager. Software Reference Guide for MiSeqDx

Bits, Bytes, and Integer

Program address space

Content Safety Precaution... 4 Getting started... 7 Input method... 9 Using the Menus Use of USB Maintenance & Safety...

The single-cycle design from last time

Pavlin and Daniel D. Corkill. Department of Computer and Information Science University of Massachusetts Amherst, Massachusetts 01003

The extra single-cycle adders

EMC AppSync. User Guide. Version REV 01

Isilon InsightIQ. Version 2.5. User Guide

CANoe/CANalyzer New Features

Ma Lesson 18 Section 1.7

TAKING THE PULSE OF ICT IN HEALTHCARE

Bits, Bytes, and Integers. Bits, Bytes, and Integers. The Decimal System and Bases. Everything is bits. Converting from Decimal to Binary

DIVAR IP U. Video DIVAR IP U.

DIVAR IP U. Video DIVAR IP U.

ICMS3 Integrated Corrosion Management System

The Impact of Avatar Mobility on Distributed Server Assignment for Delivering Mobile Immersive Communication Environment

Prof. Kozyrakis. 1. (10 points) Consider the following fragment of Java code:

The best decision leaves you options

Lecture 7. Building A Simple Processor

An Introduction to GPU Computing. Aaron Coutino MFCF

AUTOSAR Diagnostic Extract

DLA AIOL Series IP Video Storage Array

EXAMINATIONS 2010 END OF YEAR NWEN 242 COMPUTER ORGANIZATION

Today: Bits, Bytes, and Integers. Bits, Bytes, and Integers. For example, can count in binary. Everything is bits. Encoding Byte Values

Cautionary Aspects of Cross Layer Design: Context, Architecture and Interactions

Features. ICMS Integrated Corrosion Management System

DIVAR IP Video DIVAR IP Remote viewing via Video Security App and Video Security Client from Bosch

LDAP Configuration Guide

Networks An introduction to microcomputer networking concepts

The final datapath. M u x. Add. 4 Add. Shift left 2. PCSrc. RegWrite. MemToR. MemWrite. Read data 1 I [25-21] Instruction. Read. register 1 Read.

IMPLEMENTATION OF OBJECT ORIENTED APPROACH TO MODIFIED ANT ALGORITHM FOR TASK SCHEDULING IN GRID COMPUTING

CS421 COMPILERS AND INTERPRETERS. the point it was passed (line 11). explicit vs implicit memory de-allocation? (malloc-free vs. garbage collection)

More on Runtime Environments. Procedure Parameters (in Pascal) Traditional Stack Scheme. Restrictions in C & Pascal. code.

Nortel DECT Handset 4025 User Guide

Ellucian ODS9.0 Upgrade Migrating from OWB to ODI. Amir Saleem Centennial College May 17, 2017

Method to build an initial adaptive Neuro-Fuzzy controller for joints control of a legged robot

Resolving Linkage Anomalies in Extracted Software System Models

Requirements Engineering. Objectives. System requirements. Types of requirements. FAQS about requirements. Requirements problems

CS 153 Design of Operating Systems

Addressing in Future Internet: Problems, Issues, and Approaches

CS 153 Design of Operating Systems Spring 18

Content Content Introduction

What s New in AppSense Management Suite Version 7.0?

DPDK s Best Kept Secret: Micro-benchmarks. M Jay DPDK Summit - San Jose 2017

TDT4255 Friday the 21st of October. Real world examples of pipelining? How does pipelining influence instruction

FT3. Testing Systems. Precision Thickness Gauge.

AAA CENTER FOR DRIVING SAFETY & TECHNOLOGY

Review Multicycle: What is Happening. Controlling The Multicycle Design

DIVAR IP U. Video DIVAR IP U.

The Volcano Optimizer Generator: Extensibility and Efficient Search

EEC 483 Computer Organization

BIS - Basic Package V4.6

An Adaptive Strategy for Maximizing Throughput in MAC layer Wireless Multicast

webinar series

CS 153 Design of Operating Systems Spring 18

6 Using Bookmarks Using Saved Pages Advanced Features

VirtuOS: an operating system with kernel virtualization

AUTOSAR Diagnostic Extract

On the Computational Complexity and Effectiveness of N-hub Shortest-Path Routing

QoS-driven Runtime Adaptation of Service Oriented Architectures

BIS - Basic package V4.2

Access Professional Edition 2.1

BIS - Basic package V4.3

BIS - Basic Package V4.4

Cameras. for the Classroom. Easy as Dell. Dell K-12 Education. Dell Software & Peripherals

Transcription:

Ptting the dynamic into software secrity testing Detecting and Addressing Cybersecrity Isses V1.1 2018-03-05

Code ahead! 2

Atomated vlnerability detection and triage + = 3

How did we get here? Vector was engaged with a large, US Tier 1 and we were addressing software qality They acknowledged they had software qality isses Concern was related to how these qality isses cold affect secrity Project goals morphed into low-hanging secrity frit (for both the cstomer and the attacker)! Or goal was more along the lines of robstness! 4

VectorCAST test atomation platform 5

Vector testing soltion Software System Link to Reqirements System Validation System Integration Test Software Integration Test Software Unit Test System validation + code coverage on ECU Change-Based Testing SW integration testing + code coverage on PC White-box testing on host / on target CANoe, vteststdio VT System VectorCAST/QA CANoe, vteststdio vvirtualtarget VectorCAST/C++ and /QA VectorCAST/C++ VectorCAST Analytics Software Implementation Benefits Fll spport in the development process, from software nit test to system validation Uniform test management, test atomation (CI), reslt analysis and traceability 6

Vlnerability detection via dynamic analysis The idea The approach To be able to identify and atomatically test for ndiagnosed secrity vlnerabilities Utilizes MITRE s classification of CWEs (common weakness enmeration) Once an instance of a generic CWE is fond in the software, that isse is then classed as a CVE (common vlnerability and exposre) Atomatically interrogate the code and identify possible weaknesses (a la static analysis) Once a potential CWE is fond, generate a test exploiting the identified isse and execte it (dynamic exection) After exection, analyses the exection trace and decide if the potential CWE is a genine threat Code CWEs Tests Exection Analysis CVEs 7

Vlnerability detection via dynamic analysis The benefits Weaknesses identified Unlike static analysis, this method will only flag an isse if we can generate an exploit, eliminating the false-positive isse plaging static analysis The generation of test artefacts allows for their ftre re-exection to demonstrate the mitigation of a potential isse after software redesign Can be sed for both on-host and on-target exection (think secrity validation for embedded systems) Via the analysis of open-sorce projects, a nmber of API-sage related isses have been identified A large US atomotive Tier 1 has sed it to find secrity-specific rese isses on their software platform Able to atomatically find isses sch as NULL pointer dereference (CWE-476), classic bffer overflow (CWE-120) and improper resorce shtdown/release (CWE-404) Atomated Validation 8

Two technical approaches Mtational (test-site) fzz testing Take an existing test-site Modify the vales to be randomly erroneos Rn it with coverage Does it crash? If yes: potential weakness! Directed ( intelligent ) secrity testing Identify an expression of interest > E.g., pointer dereference, divide by zero Generate a test reaching that line with erroneos vales Rn it with coverage Does it crash? If yes: potential weakness! 9

Example from lighttpd int bffer_copy_string_bffer(bffer *b, const bffer *src) { if (!src) retrn -1; } if (src->sed == 0) { b->sed = 0; retrn 0; } retrn bffer_copy_string_len(b, src->ptr, src->sed - 1); Not detected: CppCheck, Facebook s Infer, Uno Possible error: Lint, CodeHawk Programmatic error detected (SIGSEGV): VectorCAST 10

Secrity weaknesses of interest The approach is focsed on atomatically generating tests for a nmber of classifications of vlnerabilities according to MITRE At the highest level, we look to address the general banner CWE-398 ( indication of poor code qality ) Some examples of isses we aim to detect Hard errors Use of a NULL pointer (CWE-476) Bffer {nder,over}flow (stack corrption) (CWE-124) Divide by zero (CWE-369) Mismatched calls malloc/free, fopen/fclose, pthread_mtex_lock/pthread_mtex_nlock (CWE- 401/404/413/415/590) Bad argments memcpy (CWE-120/130) Unchecked retrn malloc (CWE-252/690) 11

12 Technical Approach

Atomated (mtational) fzz testing for nit testing Existing test-case: > TEST.VALUE:bffer.bffer_copy_string_bffer.src:<<malloc 1>> > TEST.VALUE:bffer.bffer_copy_string_bffer.src[0].sed:0 > TEST.VALUE:bffer.bffer_copy_string_bffer.b:<<malloc 1>> Maniplate the vales: > TEST.VALUE:bffer.bffer_copy_string_bffer.src:<<malloc 1>> > TEST.VALUE:bffer.bffer_copy_string_bffer.src[0].sed:0 > TEST.VALUE:bffer.bffer_copy_string_bffer.b:<<nll>> Execte! 13

From software to mathematics Replace x with code and 0 with nll pointer dereference 14

Directed test-case generation for weaknesses We combine in-depth static analysis with constraint solving to identify more complex weaknesses: > param_2->x += 3; > param_3->y += 2; > retrn param_1->z / (param_2->x - param_3->y); Fzz testing has to get lcky here, bt sing test-case generation we can directly generate a test sch that: > (param_2->x 3) (param_3->y 2) 0 This gets fed to a black box oracle that can provide the answer! 15

16 Real World Examples

Real examples fond (divide by zero) atomotive extern VEHICLE_T Vehicle; void check_speed(int8_t speed_thomph) { int32_t temp,tho_mph,tho_rpm; if(vehicle.wheelspeed<150) {} else { if(speed_thomph>1000) {} else { Tho_MPH=0; } } if(tho_mph==0) { // no change to Tho_MPH! } else {} There exists a nmber of paths throgh the code where Tho_MPH is nassigned (so ndefined behavior) or is assigned to zero What is srprising is that Tho_MPH is checked against 0 and then sed in a divide at the same scope-level No corrective action taken, even thogh the corrective condition is already detected! 17 } temp=(100*tho_rpm)/tho_mph;

Real examples fond (NULL pointer) medical STATUS process_lamp_event(lamp_pattern_t patternid, LAMP_TASK_DATA_t *ptrtaskdata) { DRV_RET_CODE_t drvretcode = DRV_RC_ERROR; STATUS retcode = OK; LAMP_PATTERN_t tmppatternid = patternid; A lot of the code for provided in this project was extremely jdicios in checking all parameters Their style of coding made this crash stand-ot, as ptrtaskdata is never checked for nll! if (((LAMP_FAST_BLINKING == ptrtaskdata->previospatternid) (LAMP_SLOW_BLINKING == ptrtaskdata->previospatternid)) && (LAMP_PATTERN_NONE == tmppatternid)) { tmppatternid = ptrtaskdata->previospatternid; } } ptrtaskdata->conter += ptrtaskdata->timeot_ms; 18

19 Actionable Intelligence

Actionable Intelligence Software metrics An approach to ascertaining qickly Chess Morningstar for Software Secrity absence of obvios reliability isses This similar to CWE-398 for poor code qality The easy ones Defect density Defects/SLoC Lines free from obvios isses (via code coverage) Confidence of defect freedom (bt not garanteed!) Ratio of secrity tests free of defects Higher ratio => more secre 20

Actionable Intelligence Open Sorce analysis Project Metric LIGHTTPD ZLIB LIBXML2 Version 1.4.20 1.2.8 2.9.4 # files 89 16 84 SLoC⁶ 36,605 6,726 184,179 Uniqe # isses 709 113 2,926 Defect density (defects/line) 1/52 1/60 1/63 Avg. # of tests per defect 11 7 12 Tests hitting defects 69% 28% 40% Fnctions with defects 44% 44% 29% Fnctions with vg 20 and defects⁷ 51% 55% 66% ⁶measred with cloc 21 ⁷Jones 08: [complexity] levels greater than 20 are considered hazardos

Take home Process Identify portfolio Assess vlnerabilities Manage risk Some of the isses we find yo might consider are non-isses or are mitigated against as part of yor software architectre That s great be wary abot software re-se across projects! Mainly: no one size fits all soltion se mltiple tools! Dynamic exection can find certain vlnerabilities more definitively Need to always consider DP-E ratio (damage potential vs. effort) 22

For more information abot Vector and or prodcts please visit www.vector.com 23 2018. Vector Informatik GmbH. All rights reserved. Any distribtion or copying is sbject to prior written approval by Vector. V1.1 2018-03-05