Skip to main content
QUICK REVIEW

[Paper Review] Information Flow Control in WebKit's JavaScript Bytecode

Abhishek Bichhawat, Vineet Rajani|arXiv (Cornell University)|Jan 17, 2014
Security and Verification in ComputingComputer Science6 citations
TL;DR

This paper presents a dynamic information flow control (IFC) mechanism for WebKit's JavaScript bytecode, enabling secure execution of untrusted code by tracking explicit and implicit data flows. It achieves moderate performance overhead (45% average on optimized prototype) through bytecode-level instrumentation, formalized semantics, and permissive taint tracking using post-dominator analysis and a novel permissive-upgrade check.

ABSTRACT

Websites today routinely combine JavaScript from multiple sources, both trusted and untrusted. Hence, JavaScript security is of paramount importance. A specific interesting problem is information flow control (IFC) for JavaScript. In this paper, we develop, formalize and implement a dynamic IFC mechanism for the JavaScript engine of a production Web browser (specifically, Safari's WebKit engine). Our IFC mechanism works at the level of JavaScript bytecode and hence leverages years of industrial effort on optimizing both the source to bytecode compiler and the bytecode interpreter. We track both explicit and implicit flows and observe only moderate overhead. Working with bytecode results in new challenges including the extensive use of unstructured control flow in bytecode (which complicates lowering of program context taints), unstructured exceptions (which complicate the matter further) and the need to make IFC analysis permissive. We explain how we address these challenges, formally model the JavaScript bytecode semantics and our instrumentation, prove the standard property of termination-insensitive non-interference, and present experimental results on an optimized prototype.

Motivation & Objective

  • To address the security risks posed by third-party JavaScript code in modern web applications, especially confidentiality leaks due to information flow.
  • To implement a practical, production-grade IFC solution within a real-world JavaScript engine (WebKit) rather than a custom interpreter or abstract language.
  • To overcome challenges in bytecode-level IFC, including unstructured control flow, exceptions, and the need for permissiveness, without requiring code annotations.
  • To formally model WebKit's bytecode semantics and prove termination-insensitive non-interference for the instrumented system.
  • To evaluate performance overhead in real-world benchmarks and demonstrate feasibility for deployment in browsers like Safari.

Proposed method

  • Instrument the WebKit JavaScript bytecode interpreter to track taints dynamically at runtime, preserving existing optimizations.
  • Formalize the syntax and semantics of WebKit's 147-bytecode instruction set based on actual interpreter code (build r122160).
  • Use on-the-fly intra-procedural static analysis of immediate post-dominators to restrict overtainting and improve permissiveness despite unstructured control flow.
  • Extend the post-dominator technique to handle exceptions, break, and continue statements without requiring additional annotations.
  • Implement a bytecode-specific variant of the permissive-upgrade check to reduce false positives in taint propagation.
  • Optimize taint tracking using sparse labeling: propagate taints only on heap writes until a value from the heap is read with a different label.

Experimental results

Research questions

  • RQ1Can dynamic IFC be effectively and efficiently implemented at the bytecode level in a production JavaScript engine like WebKit?
  • RQ2How can IFC be made permissive enough to handle real-world JavaScript with unstructured control flow (e.g., breaks, continues, exceptions) without requiring code annotations?
  • RQ3What performance overhead does bytecode-level IFC incur in real-world workloads, and can optimizations reduce this overhead significantly?
  • RQ4Is it possible to formally model a production bytecode interpreter and prove its non-interference security property?
  • RQ5How does the performance of IFC in WebKit compare to the uninstrumented interpreter, especially when JIT compilation is enabled?

Key findings

  • The prototype achieves an average overhead of 45% on optimized IFC and 121% on basic IFC in the SunSpider benchmark suite, with standard deviations indicating stable performance.
  • The optimized IFC variant reduces taint tracking overhead significantly in microbenchmarks by propagating taints only on heap writes until a labeled heap value is read.
  • Overheads on real-world websites are consistently below 42%, averaging around 29%, and are negligible compared to network and rendering times.
  • The JIT-optimized configuration performs worse than the baseline in macrobenchmarks, indicating that JIT is less effective with instrumented code in this context.
  • The JSBench evaluation shows average overheads of approximately 38% for both basic and optimized IFC, with standard deviations of 4.09% and 5.04% respectively.
  • The formal model of WebKit’s bytecode and its instrumentation proves termination-insensitive non-interference, ensuring confidentiality under dynamic taint tracking.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.