Language-independent sandboxing of just-in-time compilation and self-modifying code

  • Authors:
  • Jason Ansel;Petr Marchenko;Úlfar Erlingsson;Elijah Taylor;Brad Chen;Derek L. Schuff;David Sehr;Cliff L. Biffle;Bennet Yee

  • Affiliations:
  • Massachusetts Institute of Technology, Cambridge, MA, USA;University College London, London, United Kingdom;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA;Google Inc., Mountain View, CA, USA

  • Venue:
  • Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

When dealing with dynamic, untrusted content, such as on the Web, software behavior must be sandboxed, typically through use of a language like JavaScript. However, even for such specially-designed languages, it is difficult to ensure the safety of highly-optimized, dynamic language runtimes which, for efficiency, rely on advanced techniques such as Just-In-Time (JIT) compilation, large libraries of native-code support routines, and intricate mechanisms for multi-threading and garbage collection. Each new runtime provides a new potential attack surface and this security risk raises a barrier to the adoption of new languages for creating untrusted content. Removing this limitation, this paper introduces general mechanisms for safely and efficiently sandboxing software, such as dynamic language runtimes, that make use of advanced, low-level techniques like runtime code modification. Our language-independent sandboxing builds on Software-based Fault Isolation (SFI), a traditionally static technique. We provide a more flexible form of SFI by adding new constraints and mechanisms that allow safety to be guaranteed despite runtime code modifications. We have added our extensions to both the x86-32 and x86-64 variants of a production-quality, SFI-based sandboxing platform; on those two architectures SFI mechanisms face different challenges. We have also ported two representative language platforms to our extended sandbox: the Mono common language runtime and the V8 JavaScript engine. In detailed evaluations, we find that sandboxing slowdown varies between different benchmarks, languages, and hardware platforms. Overheads are generally moderate and they are close to zero for some important benchmark/platform combinations.