Slide 1

Slide 1 text

SECURE CODING GUIDE

Slide 2

Slide 2 text

X What is Secure Coding Guide? Secure Coding Guide

Slide 3

Slide 3 text

X Hacker vs Attacker Secure Coding Guide

Slide 4

Slide 4 text

X Types of Vulnerabilities Buffer overflows / underflows Unvalidated input Social Engineering etc. Secure Coding Guide

Slide 5

Slide 5 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 6

Slide 6 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 7

Slide 7 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 8

Slide 8 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 9

Slide 9 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 10

Slide 10 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 11

Slide 11 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; }

Slide 12

Slide 12 text

X Buffer overflows / underflows Secure Coding Guide #include #include void doit(void) { char buf[128]; gets(buf); printf("%s\n", buf); } int main(void) { printf("So... The End...\n"); doit(); printf("or... maybe not?\n"); return 0; } … buf[0] buf[127] . . . … return address … Buffer overflow

Slide 13

Slide 13 text

X Other types of overflows Heap overflows Integer overflow Pointer arithmetic Secure Coding Guide

Slide 14

Slide 14 text

X How to avoid these overflow? Use functions that check the bounds (i.e. fgets instead of gets) Secure Coding Guide

Slide 15

Slide 15 text

X How to avoid these overflow? Use functions that check the bounds (i.e. fgets instead of gets) Some things are done by OS Secure Coding Guide

Slide 16

Slide 16 text

X How to avoid these overflow? Use functions that check the bounds (i.e. fgets instead of gets) Some things are done by OS DON’T USE C Secure Coding Guide

Slide 17

Slide 17 text

X Unvalidated input Format string vulnerabilities URL commands Code insertion Social engineering Secure Coding Guide

Slide 18

Slide 18 text

X Format string vulnerability Secure Coding Guide Let’s Code!

Slide 19

Slide 19 text

X Social engineering attacks Tricking people into normal security procedures. An example: Phishing Secure Coding Guide

Slide 20

Slide 20 text

X Social engineering attacks myapp://cmd/delete?file=cached data that is slowing down your system.,key_from_my_bitcon_wallet.txt Secure Coding Guide

Slide 21

Slide 21 text

X Social engineering attacks myapp://cmd/delete?file=cached data that is slowing down your system.,key_from_my_bitcon_wallet.txt Secure Coding Guide

Slide 22

Slide 22 text

X Other types of vulnerabilities Insecure file operations Secure Coding Guide

Slide 23

Slide 23 text

X Other types of vulnerabilities Insecure file operations Race conditions Secure Coding Guide

Slide 24

Slide 24 text

X Other types of vulnerabilities Insecure file operations Race conditions Secure Coding Guide

Slide 25

Slide 25 text

X And finally… Secure Coding Guide