TL;DR
CACHEQL is a cache side-channel detector that both quantifies (via mutual information) and localizes (using game-theoretic Shapley values) secret leakage in production binary executables. By reformulating mutual information estimation as neural network–based conditional probability classification, it scales to traces with millions of instructions, handles non-determinism from blinding or ORAM, and uncovers hundreds of overlooked leakage points across modern cryptographic libraries.
What Problem Does This Paper Address?
Shared CPU caches allow attackers to infer confidential data—such as cryptographic keys or private images—by observing memory access patterns and branch choices (Secret-Dependent Data Access, or SDA, and Secret-Dependent Control Branching, or SCB).
Prior detectors face major roadblocks when analyzing real-world software:
- Qualitative vs. Quantitative: Most tools only determine whether a leak exists, not how much information escapes, making it difficult for developers to prioritize patches.
- Poor Scalability: Symbolic execution and abstract interpretation struggle on full-length traces (often containing millions of instructions), forcing tools to analyze truncated code snippets and skip critical stages like initialization.
- Inability to Handle Non-Determinism: Hardening techniques like RSA blinding and Oblivious RAM (ORAM) introduce random noise. Existing tools often either misclassify randomized accesses as massive leaks (high false positives) or miss leaks entirely.
- Localization Inaccuracy: Prior quantitative tools misattribute or double-count dependent leakage sites (e.g., claiming 413 bits leaked from a 128-bit AES key).
Methods
CACHEQL satisfies eight comprehensive criteria proposed by the authors for robust side-channel detection:
[ Execution Trace o ] ──> [ Sparse Encoder 𝒮 ] ──> [ Compressor ℛ ] ──> [ Classifier 𝒞 ] ──> Conditional Probability p(T|k,o)
[ Secret Input k ] ────────────────────────────────────────────────────────┘ │
▼
Leakage Quantification
(Point-wise MI)
│
▼
Shapley Value Attribution
(Pinpoint Vulnerable Code Points)
- Reformulating Mutual Information (MI): Instead of sampling marginal probabilities (which fails in high dimensions or under random blinding), CACHEQL recasts Point-wise Dependence (PD) into a binary classification problem: predicting whether a secret $k$ and execution trace $o$ co-occurred ($T$) or were paired independently at random ($F$).
- Deep Learning Pipeline:
- Sparse Encoder ($\mathcal{S}$): Folds lengthy, sparse 1D trace records into matrices processed by convolutional layers to exploit spatial instruction locality.
- Information Compressor ($\mathcal{R}$): Constrains latent representations to prevent non-secret noise from dominating.
- Classifier ($\mathcal{C}$): Outputs conditional probability $p(T|k, o)$, bounded by a theoretical error $\varepsilon$.
- Statistical De-Biasing: Employs cross-validation splits to strip out non-deterministic variation introduced by blinding or system noise.
- Game-Theoretic Localization: Treats the execution trace as a cooperative game where each logged instruction is a player contributing to the overall leaked bits. CACHEQL calculates Shapley values with domain-specific optimizations, reducing computational complexity from exponential $O(2^N)$ to near-constant time.
Datasets
CACHEQL was evaluated on full-program binary executions logged via Intel Pin (capturing cache-line and bank accesses) and real-world attack logs captured via Prime+Probe:
- Cryptographic Libraries: Evaluated current and legacy versions of OpenSSL (3.0.0 and 0.9.7), MbedTLS (3.0.0 and 2.15.0), and Libgcrypt (1.9.4 and 1.6.1) implementing AES-128 and RSA-1024.
- Media Libraries: Libjpeg-turbo (2.1.2) processing private user images.
- Ground Truth & Hardened Baselines: 13 verified constant-time utilities from the
Binsec/Relbenchmark and an ORAM implementation (PathOHeap) to validate zero-leakage conditions. AES datasets used 40,000 random keys; RSA used 1,024-bit keys generated under default library configurations.
Key Insights and Ideas
- Pre-Processing is the Real Blindspot: Modern cryptographic libraries invest heavily in making core decryption constant-time and protected by blinding. However, CACHEQL discovered that pre-processing routines (key loading, PEM/s-expression parsing, and
BIGNUMinitialization) leak hundreds of bits. Because prior tools could not scale to analyze pre-processing, these vulnerabilities were completely overlooked. - The "Leading-Zero" Hazard: Functions like
BN_bin2bnandmbedtls_mpi_copyalter branch or copy behaviors based on leading zeros in secret numbers. These leaks bypass traditional static taint checks (which only track the array buffer, not metadata like byte length) and persist despite blinding. - Game Theory Eliminates Overcounting: Traditional additive heuristics double-count related memory accesses. Using Shapley values models the cooperative interaction among instructions, accurately assigning fractional bits of information to each contributing statement.
Key Results
- Precision: Correctly quantified exactly 128.0 bits leaked in unmitigated T-table AES (where Abacus previously estimated 413.6 bits) and confirmed 0.0 bits leaked on constant-time cryptographic utilities and PathOHeap ORAM.
- Vulnerability Discovery: Uncovered hundreds of previously unknown leakage sites across hundreds of functions in the latest versions of OpenSSL, Libgcrypt, and MbedTLS.
- Developer Confirmation: Reported findings were acknowledged by OpenSSL and Libjpeg-turbo maintainers, and MbedTLS developers confirmed all 62 reported leakage sites.
- Performance & Scalability: Successfully processed full execution traces of up to 5 million records where prior symbolic execution tools (CacheD, Abacus) crashed or timed out after 48 hours. Once trained, CACHEQL evaluated 256 traces in 1–2 seconds on a single GPU.
Limitations and Future Work
- Software Bug Detector, Not Exploit Synthesizer: CACHEQL measures software-level information leakage; determining real-world exploitability still requires manual effort and depends on microarchitectural constraints (e.g., CPU cache topologies, co-residency).
- Cross-Program Generalization: The neural network currently trains on traces from the specific target program. The authors suggest investigating transfer learning to allow one general model to quantify multiple programs without per-target retraining.
- Complex Software Monoliths: Instrumentation overhead from Intel Pin makes analyzing massive GUI monoliths (such as modern web browsers) difficult, motivating future integration with lighter-weight dynamic binary translators.
Summary updated