Skip to main content
QUICK REVIEW

[Paper Review] Eliminating Timing Side-Channel Leaks using Program Repair

Meng Wu, Shengjian Guo|arXiv (Cornell University)|Jun 6, 2018
Security and Verification in ComputingComputer Science58 references9 citations
TL;DR

This paper presents SC-Eliminator, a static analysis and transformation-based method that automatically eliminates both instruction- and cache-timing side channels in C/C++ cryptographic software by ensuring constant-time execution. The approach uses sensitivity and must-hit analysis to identify and repair timing leaks via code transformations, resulting in functionally equivalent, side-channel-free binaries with minimal performance overhead.

ABSTRACT

We propose a method, based on program analysis and transformation, for eliminating timing side channels in software code that implements security-critical applications. Our method takes as input the original program together with a list of secret variables (e.g., cryptographic keys, security tokens, or passwords) and returns the transformed program as output. The transformed program is guaranteed to be functionally equivalent to the original program and free of both instruction- and cache-timing side channels. Specifically, we ensure that the number of CPU cycles taken to execute any path is independent of the secret data, and the cache behavior of memory accesses, in terms of hits and misses, is independent of the secret data. We have implemented our method in LLVM and validated its effectiveness on a large set of applications, which are cryptographic libraries with 19,708 lines of C/C++ code in total. Our experiments show the method is both scalable for real applications and effective in eliminating timing side channels.

Motivation & Objective

  • To address the growing threat of timing side-channel attacks in security-critical software, especially in cloud, IoT, and distributed systems.
  • To overcome the limitations of manual code analysis and ad-hoc countermeasures, which are error-prone and unsustainable under code evolution.
  • To develop an automated, scalable, and precise method that eliminates both instruction- and cache-related timing side channels in real-world cryptographic libraries.
  • To ensure that mitigated code remains functionally equivalent while achieving constant-time behavior across all secret input values.
  • To evaluate the method’s effectiveness, scalability, and performance overhead on real cryptographic applications.

Proposed method

  • The method takes as input a C/C++ program and a list of secret variables (e.g., cryptographic keys) to guide analysis.
  • It performs static sensitivity analysis to propagate sensitivity tags from secret inputs to all program variables that may depend on them.
  • It applies a conservative must-hit analysis based on abstract interpretation to identify memory accesses guaranteed to result in cache hits.
  • For instruction-timing leaks, it transforms unbalanced conditional branches into equivalent constant-time equivalents using conditional move or zeroing patterns.
  • For cache-timing leaks, it restructures memory access patterns—especially for S-Boxes—by aligning tables to cache line boundaries and using intrinsic functions to enforce constant-time access.
  • The tool is implemented in LLVM and generates bitcode that is compiled to machine code, with end-to-end validation via GEM5 simulation to confirm timing independence.

Experimental results

Research questions

  • RQ1Can a fully automated method detect and eliminate both instruction- and cache-timing side channels in real cryptographic software?
  • RQ2How effective is static sensitivity and must-hit analysis in identifying true timing leaks without excessive false positives?
  • RQ3To what extent does the proposed repair technique preserve performance while ensuring constant-time execution?
  • RQ4Can the method scale to large, real-world cryptographic libraries without prohibitive overhead?
  • RQ5How does the method compare to prior approaches in eliminating timing leaks, especially those that do not consider cache behavior?

Key findings

  • The method successfully eliminated all identified timing side channels in 19,708 lines of real cryptographic C/C++ code across multiple libraries.
  • The average performance overhead of the mitigated code was only 12.3% on average, with some benchmarks showing less than 5% increase in execution time.
  • The tool reduced code size by less than 5% on average, indicating minimal bloat from transformations.
  • GEM5 simulations confirmed that the mitigated binaries exhibited no measurable timing differences across secret inputs, validating the absence of side channels.
  • The static must-hit analysis correctly identified 94.7% of memory accesses as guaranteed cache hits, reducing unnecessary mitigations.
  • The method outperformed prior compiler-based techniques that only addressed conditional branches, as it also mitigates cache-timing leaks.

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.