security bugs in embedded interpreters
play

Security Bugs in Embedded Interpreters Haogang Chen, Cody Cutler, - PowerPoint PPT Presentation

Security Bugs in Embedded Interpreters Haogang Chen, Cody Cutler, Taesoo Kim, Yandong Mao, Xi Wang, Nickolai Zeldovich and M. Frans Kaashoek MIT CSAIL Embedded interpreters Host system Bytecode Embedded Output interpreter Input


  1. Security Bugs in Embedded Interpreters Haogang Chen, Cody Cutler, Taesoo Kim, Yandong Mao, Xi Wang, Nickolai Zeldovich and M. Frans Kaashoek MIT CSAIL

  2. Embedded interpreters Host system Bytecode Embedded Output interpreter Input

  3. Embedded interpreters Host system Bytecode Embedded Output interpreter Input • Define an instruction set in the form of bytecode

  4. Embedded interpreters Host system Bytecode Embedded Output interpreter Input • Define an instruction set in the form of bytecode • Interpret and execute bytecode on a virtual machine

  5. Embedded interpreters Host system Bytecode Embedded Output interpreter Input • Define an instruction set in the form of bytecode • Interpret and execute bytecode on a virtual machine • Usually light-weight, and no process-level sandboxing

  6. Prevalence of embedded interpreters and related vulnerabilities

  7. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities

  8. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021

  9. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627

  10. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627 Bitcoin bitcoin CVE-2010-5137

  11. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627 Bitcoin bitcoin CVE-2010-5137 Python Pickle CVE-2011-2520 CVE-2012-4406

  12. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627 Bitcoin bitcoin CVE-2010-5137 Python Pickle CVE-2011-2520 CVE-2012-4406 TrueType / Type 1 FreeType CVE-2010-2520 CVE-2011-0226 Charstring

  13. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627 Bitcoin bitcoin CVE-2010-5137 Python Pickle CVE-2011-2520 CVE-2012-4406 TrueType / Type 1 FreeType CVE-2010-2520 CVE-2011-0226 Charstring

  14. Prevalence of embedded interpreters and related vulnerabilities Software Interpreter Known vulnerabilities BPF CVE-2010-4158 CVE-2012-3729 INET_DIAG CVE-2010-3880 CVE-2011-2213 AML CVE-2010-4347 CVE-2011-1021 RarVM CVE-2007-3725 LLVM CVE-2011-3627 Bitcoin bitcoin CVE-2010-5137 Python Pickle CVE-2011-2520 CVE-2012-4406 TrueType / Type 1 FreeType CVE-2010-2520 CVE-2011-0226 Charstring

  15. Our contributions • Studies of 10 widely-used embedded interpreters in real world • Studies of known vulnerabilities • Security guidelines • Research opportunities

  16. Why do people use embedded interpreter?

  17. A packet filtering example • Monitor all packets that do not originate from 18.26.5.* or 18.1.2.* $"tcpdump"‘ip"src"net"not"(18.26.5.0/24"or"18.1.2.0/24)’

  18. A packet filtering example • Monitor all packets that do not originate from 18.26.5.* or 18.1.2.* $"tcpdump"‘ip"src"net"not"(18.26.5.0/24"or"18.1.2.0/24)’ • Strawman 1: user space filtering • The kernel passes all packets to tcpdump filtered ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) packets kernel **** * * * **** * * * packets

  19. A packet filtering example • Monitor all packets that do not originate from 18.26.5.* or 18.1.2.* $"tcpdump"‘ip"src"net"not"(18.26.5.0/24"or"18.1.2.0/24)’ • Strawman 1: user space filtering • The kernel passes all packets to tcpdump • ✔ Flexibility ✔ Security ✘ Performance filtered ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) packets kernel **** * * * **** * * * packets

  20. A packet filtering example

  21. A packet filtering example • Strawman II: extensible kernel module

  22. A packet filtering example • Strawman II: extensible kernel module • tcpdump uploads compiled native code to the kernel ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ld*****12(%ebx),*%eax* Native test***%eax,*$0x800 code jeq****L3 filtered ld*****26(%ebx),*%eax packets and****%eax,*$0xffffff00 ********... **** * * * **** * * * Kernel module packets

  23. A packet filtering example • Strawman II: extensible kernel module • tcpdump uploads compiled native code to the kernel • ✔ Flexibility ✔ Performance ✘ Security ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ld*****12(%ebx),*%eax* Native test***%eax,*$0x800 code jeq****L3 filtered ld*****26(%ebx),*%eax packets and****%eax,*$0xffffff00 ********... **** * * * **** * * * Kernel module packets

  24. Solution: Berkeley Packet Filter (BPF)

  25. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24)

  26. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) ********ldh****[12] Bytecode ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 L3:*****ret****#TRUE L4:*****ret****#0

  27. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 L3:*****ret****#TRUE L4:*****ret****#0

  28. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 L3:*****ret****#TRUE L4:*****ret****#0 BPF interpreter

  29. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 Inputs to L3:*****ret****#TRUE L4:*****ret****#0 bytecode **** * * * **** * * * BPF interpreter packets

  30. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 Inputs to L3:*****ret****#TRUE L4:*****ret****#0 bytecode **** * * * Filtered **** * * * BPF interpreter packets packets

  31. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 Inputs to L3:*****ret****#TRUE L4:*****ret****#0 bytecode **** * * * Filtered **** * * * BPF interpreter packets packets ✔ Flexibility

  32. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 Inputs to L3:*****ret****#TRUE L4:*****ret****#0 bytecode **** * * * Filtered **** * * * BPF interpreter packets packets ✔ Flexibility ✔ Performance —— no IPC & context switch overhead

  33. Solution: Berkeley Packet Filter (BPF) ip*src*net*not* tcpdump (18.26.5.0/24*or*18.0.0.0/24) kernel ********ldh****[12] Bytecode Host ********jeq****#ETHERTYPE_IP,*L1,*L4 program L1:*****ld*****[26] system ********and****#0xffffff00 ********jeq****#0x121a0500,*L4,*L2 L2:*****jeq****#0x12010200,*L4,*L3 Inputs to L3:*****ret****#TRUE L4:*****ret****#0 bytecode **** * * * Filtered **** * * * BPF interpreter packets packets ✔ Flexibility ✔ Performance —— no IPC & context switch overhead ✔ “Security” —— no direct control of the real machine

Recommend


More recommend