Discriminating Traces with Time

Saeid Tizpaz-Niari, Pavol Cerný, Bor-Yuh Evan Chang, Sriram Sankaranarayanan, Ashutosh Trivedi

TL;DR

Researchers have developed a tool called DISCRIMINER that automatically identifies which parts of a program’s code are responsible for variations in execution time. By combining timing data with decision tree learning, the tool helps developers pinpoint and fix "timing side-channels"—security vulnerabilities where an attacker can steal secrets just by measuring how long a program takes to run.

What Problem Does This Paper Address?

In the world of software security, time is more than just a performance metric; it’s a potential leak. If a program takes 15 seconds to process a "secure" image but only 7.5 seconds for a "standard" one, an observer can infer sensitive information about the user's data without ever seeing the files. These are known as timing side-channel vulnerabilities.

The challenge for developers is finding the "smoking gun" in the source code. In a complex application with thousands of methods, which specific function call is causing the delay? Traditional performance profiling tells you where time is spent in a single run, but it doesn't explain the difference between multiple runs. This paper introduces the trace-set discrimination problem: given a collection of execution traces with different running times, how do we find a simple Boolean formula (a "discriminant") that explains why some traces are slow and others are fast?

Methods

The authors propose a formal framework to solve this problem using two primary approaches:

  1. Maximum Likelihood via ILP: They first show that finding the most likely explanation (the "maximum likelihood discriminant") is NP-hard. They develop a formal method using Integer Linear Programming (ILP) to find these discriminants. While mathematically rigorous, this approach struggles to scale as the number of traces and code methods grows.
  2. Decision Tree Learning (The "Winner"): To handle real-world complexity, the authors turn to CART (Classification and Regression Trees).
  3. Clustering: First, they use k-means clustering to group execution times into discrete "bins" or labels (e.g., "Fast," "Medium," "Slow").
  4. Learning: They then train a decision tree where the "features" are whether or not specific methods were called during execution.
  5. Result: The resulting tree provides a human-readable map. For example: "If OilFilter.filterPixels is called, the execution moves to the 15-second bin."

Datasets

The authors evaluated their approach using two distinct sets of data:

  • Micro-benchmarks: A custom suite of Java programs (LSB0, MSB0, and the "Pat" series) designed with intentional timing leaks based on bit patterns or specific input sequences.
  • DARPA STAC Case Studies: Three medium-sized Java applications (300 to 3,000+ methods) provided by a third party as security challenges:
  • SnapBuddy: A mock social network.
  • GabFeed: A community forum hosting application.
  • TextCrunchr: A text analysis tool.

Key Insights and Ideas

  • The Scalability Leap: The most significant "aha moment" was the performance gap between the formal ILP method and decision trees. On their largest micro-benchmark, the decision tree took just 4.2 seconds, while the ILP approach took over 10 minutes (652.4 seconds) to reach a similar result.
  • Interpretability is Key: Unlike "black box" machine learning models, decision trees produce a logical flow that a human developer can actually use to debug code. If the tree says a specific method is the branching point for a timing difference, the developer knows exactly where to start their investigation.
  • No Prior Knowledge Needed: The tool doesn't need to be told which functions are "suspicious." By looking at all method calls across hundreds of traces, it automatically filters out the "noise" of common functions to find the ones that actually correlate with timing changes.

Key Results

  • High Accuracy: Across all benchmarks, the decision tree models achieved high accuracy, often exceeding 97-99% in correctly classifying traces into their timing bins.
  • Vulnerability Discovery: In the GabFeed case study, DISCRIMINER successfully identified that the number of calls to OptimizedMultiplier.standardMultiply was leaking bits of a 3064-bit private key.
  • Availability Debugging: In TextCrunchr, the tool pointed to stac.sort.qsPartition (Quicksort), revealing that certain inputs were triggering the algorithm's worst-case performance, which could be exploited for a Denial-of-Service (DoS) attack.

Limitations and Future Work

  • Determinism: The current approach assumes the program is largely deterministic. While they use weighted labeling to handle some "noise" in timing measurements, highly non-deterministic systems might confuse the classifier.
  • Granularity: The current tool looks at whether a method was called (or how many times). It doesn't yet look at the sequence of events or the specific values of variables, which could hide more subtle leaks.
  • Future Directions: The authors plan to extend the framework to reactive systems (where timing depends on a sequence of timed events) and to integrate network traffic monitoring to make the tool more useful for distributed cloud architectures.

Summary updated

BibTeX
@inproceedings{tizpazniari2017discriminating,
  author = {Saeid Tizpaz-Niari and Pavol Cerný and Bor-Yuh Evan Chang and Sriram Sankaranarayanan and Ashutosh Trivedi},
  title = {{Discriminating Traces with Time}},
  booktitle = {TACAS},
  year = {2017},
  url = {https://openreview.net/forum?id=KHlFIl4SUV},
}
Figure