+ All Categories
Home > Documents > Reflections on Trusting Trust - Indiana University...

Reflections on Trusting Trust - Indiana University...

Date post: 20-Jun-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
16
Reflections on Trusting Trust Yan Huang
Transcript
Page 1: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

ReflectionsonTrustingTrust

YanHuang

Page 2: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

DoyouTrustyourLinuxlogin?

WillyourpasswordbekeptandlaterrevealedtoEve?

Doesithaveabackdoorfora(powerful)adversarytosneakin?

Page 3: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

ScrutinizeitsSourceCode

Page 4: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Orwriteyourown

Doesitsolvetheproblem?

Page 5: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Needtofurthertrustingthecompiler/interpreter/executionenvironment…

Thusneedtolookfurtheratthesourcecodeofthecompiler/interpretation/executionenvironment!

Page 6: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

EvenTrickier

Whatprogramcompilesthecompilersourcecodethatyou(couldhave)spentyourlifetoproofread?

Page 7: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust
Page 8: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Ifyoustopchasingyourtail…

evil_compileplantsabackdoorintoanypatternmatched“login”programthatitcompiles;butcompilesnormallyotherprogramsourcecode.

evil_compiler(src) { /* compile particular src for login program */

if (match(src, login-pattern)) { compile(login-with—backdoor) return } .... /* compile other application src as usual */ }

Page 9: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Ifyoustopchasingyourtail…evil_compiler(src) { /* compile particular src for login program */

if (match(src, login-pattern)) { compile(login-with—backdoor) return } .... /* compile other application src as usual */ }

evil_compilerTrustedcompilersource

Trustedcompiler

Trustedloginsource

Trusted“login”

Page 10: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

evil_compilecanbedevil…devil_compiler(src) {

/* compile particular src for login program */ if (match(src, login-pattern)) { compile(login-with—backdoor) return } if (match(src, compiler-pattern)) { compile (myself) return } .... /* compile other application src as usual */ }

devil_compilerTrustedcompilersource

Trustedloginsource

backdoor-ed“login”devil_compiler

Page 11: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

devilnessneverdecay

devilcompiler

Trustedcompilersource

Trustedloginsource

backdoor-ed“login”

devilcompiler

Trustedcompilersourcewithfeature1

devilcompilerwithfeature1

Trustedcompilersourcewithfeature2

devilcompilerwithfeature2

Trustedcompilersourcewithfeature3

……

Trustedcompilersourcewithfeature…

featureloadeddevilcompiler

Page 12: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Howtoembedexactly“myself”?

devil_compiler(src) { /* compile particular src for login program */

if (match(src, login-pattern)) { compile(login-with—backdoor) return } if (match(src, compiler-pattern)) { compile (myself) return } .... /* compile other application src as usual */ }

Itremindsmeofprogramsoutputtingexactly

themselves…

Page 13: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

Howtooutput“myself”,exactly?

#include <stdio.h> void main(){printf(“myself”);}

myself

Page 14: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

LiveDemo

#include <stdio.h>

int main(){ char s[]="#include <stdio.h>%c%cint main(){%c char s[]=%c%s%c;%c return printf(s,10,10,10,34,s,34,10);%c}"; return printf(s,10,10,10,34,s,34,10,10); }

#include <stdio.h>

int main(){ char s[]="#include <stdio.h>%c%cint main(){%c char s[]=%c%s%c;%c return printf(s,10,10,10,34,s,34,10);%c}"; return printf(s,10,10,10,34,s,34,10,10); }

Page 15: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

LiveDemo—Alternatives#include <stdio.h>

char* s[]={"#include <stdio.h>\n\nchar* s[]={","};\n\nvoid print_string_literal(char *s){\n putchar(34);\n while(*s!=0) {\n switch (*s) {\n case 10: printf(\"\\\\n\"); break;\n default: putchar(*s);\n }\n s++;\n }\n putchar(34);\n}\n\nint main(){\n printf(\"%s\", s[0]);\n print_string_literal(s[0]);\n putchar(',');\n print_string_literal(s[1]);\n printf(\"%s\", s[1]);\n return 0;\n}"};

void print_string_literal(char *s){ putchar(34);

while (*s!=0) { switch (*s) { case 10: printf("\\n"); break;

default: putchar(*s); }

s++; }

putchar(34); }

int main(){

printf("%s", s[0]); print_string_literal(s[0]);

putchar(','); print_string_literal(s[1]);

printf("%s", s[1]); return 0;

}

Page 16: Reflections on Trusting Trust - Indiana University Bloomingtonhomes.sice.indiana.edu/yh33/Teaching/I433-2016/lec25-trust.pdf · Reflections on Trusting Trust Yan Huang. Do you Trust

16

Trust,butonlycautiously…

“Themoralisobvious.Youcan'ttrustcodethatyoudidnottotallycreateyourself.(Especiallycodefromcompaniesthatemploypeoplelikeme.)”


Recommended