Lune

ICSE2021顶会

Data-Driven Synthesis of Provably Sound Side Channel Analyses

Jingbo Wang, Chungha Sung, Mukund Raghothaman, Chao Wang

摘要

We propose a data-driven method for synthesizing static analyses to detect side-channel information leaks in cryptographic software. Compared to the conventional way of manually crafting such static analyzers, which can be tedious, error prone and suboptimal, our learning-based technique is not only automated but also provably sound. Our analyzer consists of a set of type-inference rules learned from the training data, i.e., example code snippets annotated with the ground truth. Internally, we use syntax-guided synthesis (SyGuS) to generate new recursive features and decision tree learning (DTL) to generate analysis rules based on these features. We guarantee soundness by proving each learned analysis rule via a technique called query containment checking. We have implemented our technique in the LLVM compiler and used it to detect power side channels in C programs that implement cryptographic protocols. Our results show that, in addition to being automated and provably sound during synthesis, our analyzer can achieve the same empirical accuracy as two state-of-the-art, manually-crafted analyzers while being 300X and 900X faster, respectively. • We propose the first data-driven method for learning a provably sound static analyzer using syntax guided synthesis (SyGuS) and decision tree learning (DTL). • We guarantee soundness by formulating and solving a Datalog query containment checking problem. • We demonstrate the effectiveness of our method for detecting side channels in cryptographic software. In the remainder of this paper, we begin by presenting the technical background in Section II and our motivating example in Section III. We then describe the learner in Section IV and the prover in Section V, followed by the experimental results in Section VI. Finally, we survey the related work in Section VII and conclude in Section VIII. II. PRELIMINARIES A. Power Side-Channels Prior works in side-channel security [19]- [21] show that variance in the power consumption of a computing device may leak secret information; for example, when a secret value is stored in a physical register, its number of logical-1 bits may affect the power consumption of the CPU. Such side-channel leaks are typically mitigated by masking, e.g., using d random bits (r 1 , . . . , r d ) to split a key bit into d + 1 secret shares: key 1 = r 1 , . . ., key d = r d , and key d+1 = r 1 ⊕r 2 . . .⊕r d ⊕key, where ⊕ denotes the logical operation exclusive or (XOR). Since all d + 1 shares are uniformly distributed in the 0, 1, in theory, this order-d masking scheme is secure in that any combination of less than d shares cannot reveal the secret, but combining all d + 1 shares, key 1 ⊕ key 2 ⊕ ...key d+1 = key, recovers the secret. In practice, masking countermeasures must also be implemented properly to avoid de-randomizing any of the secret shares accidentally. Consider While syntactically dependent on the two randomized values t L and t R , t is in fact leaky because, semantically, it does not depend on the random input r 1 . In this work, we aim to learn a static analyzer that can soundly prove that all intermediate variables of a program that implements masking countermeasures are free of such leaks. B. Type Systems Type systems prove to be effective in analyzing power side channels [1], [2], e.g., by certifying that all intermediate variables of a program are statistically independent of the secret. Typically, the program inputs are marked as public (INPUB), secret (INKEY) or random (INRAND), and then the types of all other program variables are inferred automatically. The type of a variable v, denoted TYPE(v), may be RUD, SID, or UKD. Here, RUD stands for random uniform distribution, meaning v is either a random bit or being masked by a random bit. SID stands for secret independent distribution, meaning v does not depend on the secret. While an RUD variable is, by definition, also SID, an SID variable does not have to be RUD (e.g., variables that are syntactically independent of the secret). Finally, UKD stands for unknown distribution, or potentially leaky; if the analyzer cannot prove v to be RUD or SID, then it is assumed to be UKD. Type systems are generally designed to be sound but not necessarily complete. They are sound in that they never miss real leaks. For example, by default, they may safely assume that all variables are UKD, unless a variable is specifically elevated to SID or RUD by an analysis rule. Similarly, they may conservatively classify SID variables as UKD, or classify RUD variables as SID, without missing real leaks. In general, the sets of variables that can be marked as the three types form a hierarchy: S RUD ⊆ S SID ⊆ S UKD .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 9 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Sporq: An Interactive Environment for Exploring Code using Query-by-Example 引用了 Example-guided synthesis of relational queries
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper9

  1. Exploration of Power Side-Channel Vulnerabilities in Quantum Computer ControllersChuanqi Xu, Ferhat Erata, Jakub SzeferCCS 2023 · 26 次引用
  2. Synthesizing abstract transformersPankaj Kumar Kalita, Sujit Kumar Muduli, Loris D'Antoni, Thomas W. Reps 等OOPSLA 2022 · 21 次引用
  3. Example-guided synthesis of relational queriesAalok Thakkar, Aaditya Naik, Nathaniel Sands, Rajeev Alur 等PLDI 2021 · 12 次引用
  4. Sporq: An Interactive Environment for Exploring Code using Query-by-ExampleAaditya Naik, Jonathan Mendelson, Nathaniel Sands, Yuepeng Wang 等UIST 2021 · 11 次引用
  5. Certifying the Fairness of KNN in the Presence of Dataset BiasYannan Li, Jingbo Wang, Chao WangCAV 2023 · 8 次引用

它引用的 Paper3

  1. Strong Non-Interference and Type-Directed Higher-Order MaskingGilles Barthe, Sonia Belaïd, François Dupressoir, Pierre-Alain Fouque 等CCS 2016 · 302 次引用
  2. Precise Detection of Side-Channel Vulnerabilities using Quantitative Cartesian Hoare LogicJia Chen, Yu Feng, Isil DilligCCS 2017 · 74 次引用
  3. Augmented example-based synthesis using relational perturbation propertiesShengwei An, Rishabh Singh, Sasa Misailovic, Roopsha SamantaPOPL 2020 · 7 次引用

相关 Paper

  1. DATA - Differential Address Trace Analysis: Finding Address-based Side-Channels in BinariesSamuel Weiser, Andreas Zankl, Raphael Spreitzer, Katja Miller 等USENIX Security 2018 · 77 次引用
  2. Identifying Cache-Based Side Channels through Secret-Augmented Abstract InterpretationShuai Wang, Yuyan Bao, Xiao Liu, Pei Wang 等USENIX Security 2019 · 57 次引用
  3. microSCALE: Static Analysis for Microarchitectural Side-channel Leakage EvaluationAkshay Kumar E, Pranav Krishna N, Annapurna Valiveti, Pallavi Borkar 等USENIX Security 2026
  4. Cache Refinement Type for Side-Channel Detection of Cryptographic SoftwareKe Jiang, Yuyan Bao, Shuai Wang, Zhibo Liu 等CCS 2022 · 7 次引用
  5. Quantifying and Mitigating Cache Side Channel Leakage with Differential SetCong Ma, Dinghao Wu, Gang Tan, Mahmut Taylan Kandemir 等OOPSLA 2023 · 2 次引用
黄昏的海面,两侧是细线勾勒的悬崖