Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
CMPSC 497: Static Analysis
Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University
CMPSC 497: Static Analysis Trent Jaeger Systems and Internet - - PowerPoint PPT Presentation
CMPSC 497: Static Analysis Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
2
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
3
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
4
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
possible to answer
semantic properties
5
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
6
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
7
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
8
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
9
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
10
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
11
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
12
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
13
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
14
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf2R1 = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
15
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf2R1 = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
16
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf2R1 = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
17
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); bar(&buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
18
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); bar(&buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
19
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf3R1 = buf2R1; buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf3R1); free(buf1R2); }
21
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf2R1 = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
22
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); DEF buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1), FREE x1 = buf2R1; DEF y = x1, y = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(y), FREE x2 = y; free(buf1R2); }
23
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); DEF buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1), FREE x1 = buf2R1; DEF y = x1, y = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(x1); FREE x2 = x1; free(buf1R2); }
24
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); bar(&buf2R1); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
25
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); buf2R1 = (char *) malloc(BUFSIZE2); buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); free(buf1R2); }
26
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); // taint buf2R1 = (char *) malloc(BUFSIZE2); // untaint buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf2R1); // taint free(buf1R2); }
27
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
foo(int x, char **y) // need not be “main” { … buf1R1 = (char *) malloc(BUFSIZE2); buf2R1 = (char *) malloc(BUFSIZE2); free(buf1R1); free(buf2R1); // taint buf3R1 = buf2R1; // taint buf1R2 = (char *) malloc(BUFSIZE1); strncpy(buf1R2, argv[1], BUFSIZE1-1); free(buf3R1); // taint free(buf1R2); }
28
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
29
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
30
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
w02_avoiding-pitfalls-of-static-analysis_copy1.pdf
31
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
32
Web Application, Library, Trusted App, Mobile Application Add custom rules Assess results Add Canaries Assess results Address risk not covered by Static Analysis Assess results Scanning & Verification
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
are well supported
33
Web Application, Library, Trusted App, Mobile Application Add custom rules Assess results Add Canaries Assess results Address risk not covered by Static Analysis Assess results Scanning & Verification — —
Scanning and Verification
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
34
you can see which files were translated by looking for “ translate” in your –
Source Code Intermediate Representation Control Flow, Dataflow, etc. Analysis
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
35
you can see which files were translated by looking for “ translate” in your –
Source Code Intermediate Representation Control Flow, Dataflow, etc. Analysis
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
language and type of program?
36
Web Application, Library, Trusted App, Mobile Application Add custom rules Assess results Add Canaries Assess results Address risk not covered by Static Analysis Assess results Scanning & Verification — —
Scanning and Verification
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
37
Web Application, Library, Trusted App, Mobile Application Add custom rules Assess results Add Canaries Assess results Address risk not covered by Static Analysis Assess results Scanning & Verification
Add custom rules
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
38
Web Application, Library, Trusted App, Mobile Application Add custom rules Assess results Add Canaries Assess results Address risk not covered by Static Analysis Assess results Scanning & Verification
Add custom rules
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
HP_Fortify_SCA_Custom_Rules_Guide_4.21.pdf
40
Checkmarx Fortify Coverity Veracode Whitehat Most Flexible Very Flexible Flexible No custom rules allowed No custom rules allowed
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
43
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
44