[Paper Review] Taint Tracking for WebAssembly
This paper presents the first JavaScript-based WebAssembly virtual machine with integrated taint tracking, enabling fine-grained monitoring of sensitive data flows in untrusted WebAssembly code. It introduces indirect taint tracking to capture implicit data flows between variables, demonstrating correctness, security, and linear performance overhead in practice.
WebAssembly seeks to provide an alternative to running large and untrusted binaries within web browsers by implementing a portable, performant, and secure bytecode format for native web computation. However, WebAssembly is largely unstudied from a security perspective. In this work, we build the first WebAssembly virtual machine that runs in native JavaScript, and implement a novel taint tracking system that allows a user to run untrusted WebAssembly code while monitoring the flow of sensitive data through the application. We also introduce indirect taint, a label that denotes the implicit flow of sensitive information between local variables. Through rigorous testing and validation, we show that our system is correct, secure, and relatively efficient, benefiting from the native performance of WebAssembly while retaining precise security guarantees of more mature software paradigms.
Motivation & Objective
- To address the lack of runtime security analysis tools for WebAssembly, particularly taint tracking, in client-side execution environments.
- To build a fully functional WebAssembly virtual machine implemented in JavaScript for client-side execution and analysis.
- To design and implement a taint tracking system that operates at binary-code granularity and supports both direct and indirect taint propagation.
- To validate the correctness, security, and performance characteristics of the taint tracking system through comprehensive testing and benchmarking.
- To enable future deployment of taint tracking in real-world contexts, such as browser extensions for privacy and security auditing.
Proposed method
- Developed a custom JavaScript-based WebAssembly virtual machine to interpret and execute WebAssembly binary code in a sandboxed environment.
- Implemented taint tracking at the instruction level, propagating taint labels through stack operations and memory accesses with strong typing guarantees.
- Introduced indirect taint as a label for variables whose values are influenced by tainted inputs but are not directly assigned them, capturing implicit data flows.
- Designed and executed a comprehensive test suite including C-to-wasm compilation, taint propagation verification, and performance benchmarks.
- Used a debugging toolset to inspect stack and memory states at each instruction, enabling precise validation of taint propagation.
- Measured time and memory overhead of taint tracking across different workloads, including loops and complex functions like Euler’s totient function.
Experimental results
Research questions
- RQ1Can a fully functional WebAssembly virtual machine be implemented in JavaScript to enable runtime analysis of untrusted code?
- RQ2How can taint tracking be effectively integrated into a WebAssembly execution environment with fine-grained control over data flow?
- RQ3What is the performance overhead of taint tracking in terms of execution time and memory usage when applied to real-world workloads?
- RQ4How can indirect taint be modeled and detected to capture implicit data flows that are missed by direct taint tracking alone?
- RQ5Can the taint tracking system correctly and securely track sensitive data through complex control flows, including recursion and iterative algorithms?
Key findings
- The proposed JavaScript-based WebAssembly virtual machine correctly executes WebAssembly binaries, including complex functions such as the recursive and iterative implementations of Euler’s totient function.
- The taint tracking system correctly propagates taint through direct assignments and captures indirect taint, where variables are influenced by tainted values without direct assignment.
- Taint tracking introduces a linear time overhead proportional to the number of variable assignments, with measurable but manageable performance cost in simple loops.
- The performance cost of indirect taint propagation is higher than direct taint tracking, particularly in computationally intensive functions like the totient function, but remains asymptotically linear.
- Memory overhead from taint tracking grows linearly with the number of taintable variables, as expected, with heap usage increasing proportionally to the number of taint labels allocated.
- The system maintains constant-time taint transfer regardless of data volume, ensuring that the asymptotic efficiency of any program is preserved under 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 NubintThis review was generated by AI from the original paper. Please check the paper before citing it.