IFC Inside: Retrofitting Languages with Dynamic Information Flow Control (Extended Version)

Stefan Heule, Deian Stefan, Edward Z. Yang, John C. Mitchell, Alejandro Russo

Introduction

Modern web applications are increasingly composed of "mash-ups" of code from disparate sources, including third-party analytics, advertisements, and browser extensions. This architectural pattern introduces significant security risks, as malicious or buggy third-party code may gain access to sensitive user data. Information Flow Control (IFC) provides a mechanism to track data movement and prevent unauthorized leaks. However, traditional fine-grained IFC—which monitors every variable access—is notoriously difficult to implement, often requiring intrusive changes to language runtimes (e.g., V8) and incurring substantial performance overhead.

This paper proposes a "retrofitting" approach that enables dynamic IFC in existing languages without modifying their underlying engines. By adopting a coarse-grained, task-based model, the authors provide a framework that is both language-agnostic and mathematically sound.

Methodology: Task-Based Isolation and Isomorphisms

The core of the proposed framework is the separation of the "Target Language" (the language to be secured) from the "IFC Language" (the security monitor). Instead of tracking individual variables, the system tracks isolated tasks.

Task Isolation

Each task is associated with a security label. When a task accesses sensitive data, its label "floats" to a higher secrecy level. Once a task reaches a high secrecy level, the monitor restricts it from communicating with low-secrecy (public) channels. This coarse-grained approach simplifies implementation and reduces overhead while providing sufficient protection for many web security use cases.

Formal Semantics and Isomorphisms

To ensure the framework's correctness, the authors utilize operational semantics to combine the target and IFC languages. A key challenge in practical implementation is memory management; while theory suggests tasks should have isolated heaps for safety, this is inefficient. The authors use isomorphism proofs to demonstrate that an optimized implementation—using a single shared heap with specific restrictions (e.g., forbidding the transmission of memory addresses)—is mathematically equivalent to a secure, multi-heap model.

Scheduling as a Security Mechanism

A significant contribution of this work is the formalization of how task scheduling impacts security guarantees. The authors distinguish between Termination-Sensitive Non-Interference (TSNI) and Termination-Insensitive Non-Interference (TINI).

Formal definitions of Round Robin (RR) and Sequential (SEQ) scheduling strategies used to prove security properties.

As shown in the formal definitions above, the choice of scheduler is critical. A Round Robin (RR) scheduler can mitigate "termination attacks," where an attacker infers secret data based on whether a program terminates or crashes. In contrast, Sequential (SEQ) schedulers typically only support the weaker TINI guarantee. The framework allows developers to choose the appropriate scheduler based on their specific security requirements.

Real-World Retrofitting and Results

The framework was successfully applied to several diverse environments, demonstrating its versatility:

  • Node.js: The authors developed espectro, a library providing isolated contexts for Node.js applications.
  • COWL: The framework provided the formal foundation for the Cloud-Object Web Layer, a security system for client-side JavaScript.
  • Haskell: The authors improved the existing LIO (Labeled IO) system, identifying and fixing a subtle bug related to how exceptions interacted with security clearances.

Performance evaluations indicate that by performing security checks only at isolation boundaries (e.g., message passing) rather than at every instruction, the system maintains near-native execution speeds.

Conclusion and Future Work

Retrofitting existing languages with IFC provides a pragmatic path toward securing modern web applications. By leveraging coarse-grained isolation and rigorous formal proofs, this framework demonstrates that strong security guarantees like non-interference can be achieved without sacrificing performance or requiring extensive modifications to established language runtimes.

Future work includes extending the formalism to handle external I/O effects (which currently require application-specific wrappers) and addressing the challenges of memory-unsafe languages like C, which may require hardware-level protection (e.g., Intel SGX) to prevent software isolation bypasses.

Summary updated

BibTeX
@inproceedings{heule2015ifc,
  author = {Stefan Heule and Deian Stefan and Edward Z. Yang and John C. Mitchell and Alejandro Russo},
  title = {{IFC Inside: Retrofitting Languages with Dynamic Information Flow Control (Extended Version)}},
  booktitle = {POST},
  year = {2015},
  doi = {10.1007/978-3-662-46666-7\_2},
}
Figure