Abstract
Abstract
WebAssembly (Wasm) is a platform-independent, low-level binary language that enables near-native performance in web applications. Given its growing importance in the web ecosystem, securing WebAssembly programs becomes increasingly important. A key security concern with WebAssembly is the threat of instruction-timing side-channel attacks, which exploit timing variations in branch instructions dependent on sensitive data, allowing attackers to infer sensitive information through timing measurement.
In this paper, we introduce WaSCR, an automated WebAssembly instruction-timing Side-Channel Repairer. WaSCR uses control and data dependencies to trace the flow of sensitive data and prevent its leakage. It employs rule-based code transformations to linearize the program, eliminating branches dependent on sensitive data and substituting them with constant-time selectors. Our evaluation demonstrates that WaSCR effectively eliminates instruction-timing side channels while maintaining program correctness, with efficient repairs and moderate performance overhead.
AI Summary
AI-Generated Summary (Experimental)
This summary was generated using automated tools and was not authored or reviewed by the article's author(s). It is provided to support discovery, help readers assess relevance, and assist readers from adjacent research areas in understanding the work. It is intended to complement the author-supplied abstract, which remains the primary summary of the paper. The full article remains the authoritative version of record. Click here to learn more.
Click here to comment on the accuracy, clarity, and usefulness of this summary. Doing so will help inform refinements and future regenerated versions.
To view this AI-generated plain language summary, you must have Premium access.
Formats available
You can view the full content in the following formats:
References
[1]
[n. d.]. Emscripten: a complete open source LLVM-based compiler toolchain for WebAssembly. https://emscripten.org
[2]
2024. WasmEdge Runtime. https://github.com/WasmEdge/WasmEdge. Accessed: 2024--10-07.
[3]
Adservio. 2024. Memory Safety in WebAssembly. https://www.adservio.fr/post/memory-safety-in-webassembly. Accessed: August 31, 2024.
[4]
Bytecode Alliance. 2024. Wasmtime - A fast and secure runtime for WebAssembly. https://github.com/bytecodealliance/wasmtime. Accessed: 2024-09--30.
[5]
Jose Bacelar Almeida, Manuel Barbosa, Gilles Barthe, François Dupressoir, and Michael Emmi. 2016. Verifying Constant-Time Implementations. In 25th USENIX Security Symposium (USENIX Security 16). USENIX Association, Austin, TX, 53--70. https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/almeida
[6]
Basavesh Ammanaghatta Shivakumar, Gilles Barthe, Benjamin Grégoire, Vincent Laporte, and Swarn Priya. 2022. Enforcing Fine-grained Constant-time Policies. In Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security (Los Angeles, CA, USA) (CCS '22). Association for Computing Machinery, New York, NY, USA, 83--96.
[7]
Lars Ole Andersen. 1994. Program analysis and specialization for the C programming language. (1994).
[8]
J. Bacelar Almeida, Manuel Barbosa, Jorge S. Pinto, and Bárbara Vieira. 2013. Formal verification of side-channel countermeasures using self-composition. Science of Computer Programming 78, 7 (2013), 796--812. Special section on Formal Methods for Industrial Critical Systems (FMICS 2009 FMICS 2010) & Special section on Object-Oriented Programming and Systems (OOPS 2009), a special track at the 24th ACM Symposium on Applied Computing.
[9]
George Balatsouras and Yannis Smaragdakis. 2016. Structure-Sensitive Points-To Analysis for C and C. In Sensors Applications Symposium. https://api.semanticscholar.org/CorpusID:16346939
[10]
Gilles Barthe, Gustavo Betarte, Juan Campo, Carlos Luna, and David Pichardie. 2014. System-level Non-interference for Constant-time Cryptography. In Proceedings of the 2014 ACM SIGSAC Conference on Computer and Communications Security (Scottsdale, Arizona, USA) (CCS '14). Association for Computing Machinery, New York, NY, USA, 1267--1279.
[11]
Nathan Binkert, Bradford Beckmann, Gabriel Black, Steven K. Reinhardt, Ali Saidi, Arkaprava Basu, Joel Hestness, Derek R. Hower, Tushar Krishna, Somayeh Sardashti, Rathijit Sen, Korey Sewell, Muhammad Shoaib, Nilay Vaish, Mark D. Hill, and David A. Wood. 2011. The gem5 simulator. SIGARCH Comput. Archit. News 39, 2 (Aug. 2011), 1--7.
[12]
Pietro Borrello, Daniele Cono D'Elia, Leonardo Querzoni, and Cristiano Giuffrida. 2021. Constantine: Automatic Side-Channel Resistance Using Efficient Control and Data Flow Linearization. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security (CCS '21). ACM.
[13]
David Brumley and Dan Boneh. 2003. Remote Timing Attacks Are Practical. In 12th USENIX Security Symposium (USENIX Security 03). USENIX Association, Washington, D.C. https://www.usenix.org/conference/12th-usenix-security-symposium/remote-timing-attacks-are-practical
[14]
Javier Cabrera Arteaga, Orestis Floros, Oscar Vera Perez, Benoit Baudry, and Martin Monperrus. 2021. CROW: Code Diversification for WebAssembly. In Proceedings 2021 Workshop on Measurements, Attacks, and Defenses for the Web (MADWeb 2021). Internet Society.
[15]
Luwei Cai, Fu Song, and Taolue Chen. 2024. Towards Efficient Verification of Constant-Time Cryptographic Implementations. arXiv:2402.13506 [cs.CR] https://arxiv.org/abs/2402.13506
[16]
Shuo Chen, Rui Wang, XiaoFeng Wang, and Kehuan Zhang. 2010. Side-Channel Leaks in Web Applications: A Reality Today, a Challenge Tomorrow. In 2010 IEEE Symposium on Security and Privacy. 191--206.
[17]
WebAssembly Community. 2023. Constant-Time Proposal Overview. https://github.com/WebAssembly/constant-time/blob/main/proposals/constant-time/Overview.md Accessed: 2024-08--15.
[18]
Bart Coppens, Ingrid Verbauwhede, Koen De Bosschere, and Bjorn De Sutter. 2009. Practical Mitigations for Timing-Based Side-Channel Attacks on Modern x86 Processors. In 2009 30th IEEE Symposium on Security and Privacy. 45--60.
[19]
Lesly-Ann Daniel, Sébastien Bardin, and Tamara Rezk. 2023. Binsec/Rel: Symbolic binary analyzer for security with applications to constant-Time and secret-erasure. ACM Transactions on Privacy and Security 26, 2 (2023), 11:1--42.
[20]
Craig Disselkoen, Sunjay Cauligi, Dean Tullsen, and Deian Stefan. 2020. Finding and eliminating timing side-channels in crypto code with pitchfork. In TECHCON.
[21]
Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. 1987. The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9, 3 (jul 1987), 319--349.
[22]
Antoine Geimer, Mathéo Vergnolle, Frédéric Recoules, Lesly-Ann Daniel, Sébastien Bardin, and Clémentine Maurice. 2023. A Systematic Evaluation of Automated Tools for Side-Channel Vulnerabilities Detection in Cryptographic Libraries. arXiv:2310.08153 [cs.CR] https://arxiv.org/abs/2310.08153
[23]
Daniel Genkin, Lev Pachmanov, Eran Tromer, and Yuval Yarom. 2018. Drive-By Key-Extraction Cache Attacks from Portable Code. In Applied Cryptography and Network Security: 16th International Conference, ACNS 2018, Leuven, Belgium, July 2--4, 2018, Proceedings (Leuven, Belgium). Springer-Verlag, Berlin, Heidelberg, 83--102.
[24]
Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. 2017. Bringing the web up to speed with WebAssembly. SIGPLAN Not. 52, 6 (jun 2017), 185--200.
[25]
Shaobo He, Michael Emmi, and Gabriela Ciocarlie. 2019. ct-fuzz: Fuzzing for Timing Leaks. arXiv:1904.07280 [cs.SE] https://arxiv.org/abs/1904.07280
[26]
Aaron Hilbig, Daniel Lehmann, and Michael Pradel. 2021. An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases. In Proceedings of the Web Conference 2021 (Ljubljana, Slovenia) (WWW '21). Association for Computing Machinery, New York, NY, USA, 2696--2708.
[27]
Minseo Kim, Hyerean Jang, and Youngjoo Shin. 2022. Avengers, Assemble! Survey of WebAssembly Security Solutions. In 2022 IEEE 15th International Conference on Cloud Computing (CLOUD). 543--553.
[28]
Daniel Lehmann, Johannes Kinder, and Michael Pradel. 2020. Everything old is new again: binary security of webassembly. In Proceedings of the 29th USENIX Conference on Security Symposium (SEC'20). USENIX Association, USA, Article 13, 18 pages.
[29]
Fangfei Liu, Qian Ge, Yuval Yarom, Frank Mckeen, Carlos Rozas, Gernot Heiser, and Ruby B. Lee. 2016. CATalyst: Defeating last-level cache side channel attacks in cloud computing. In 2016 IEEE International Symposium on High Performance Computer Architecture (HPCA). 406--418.
[30]
Jack Lloyd and the Botan contributors. 2023. Botan: Crypto and TLS for Modern C. https://github.com/randombit/botan. Accessed: October 6, 2023.
[31]
Jason Lowe-Power, Abdul Mutaal Ahmad, Ayaz Akram, Mohammad Alian, Rico Amslinger, Matteo Andreozzi, Adrià Armejach, Nils Asmussen, Brad Beckmann, Srikant Bharadwaj, Gabe Black, Gedare Bloom, Bobby R. Bruce, Daniel Rodrigues Carvalho, Jeronimo Castrillon, Lizhong Chen, Nicolas Derumigny, Stephan Diestelhorst, Wendy Elsasser, Carlos Escuin, Marjan Fariborz, Amin Farmahini-Farahani, Pouya Fotouhi, Ryan Gambord, Jayneel Gandhi, Dibakar Gope, Thomas Grass, Anthony Gutierrez, Bagus Hanindhito, Andreas Hansson, Swapnil Haria, Austin Harris, Timothy Hayes, Adrian Herrera, Matthew Horsnell, Syed Ali Raza Jafri, Radhika Jagtap, Hanhwi Jang, Reiley Jeyapaul, Timothy M. Jones, Matthias Jung, Subash Kannoth, Hamidreza Khaleghzadeh, Yuetsu Kodama, Tushar Krishna, Tommaso Marinelli, Christian Menard, Andrea Mondelli, Miquel Moreto, Tiago Mück, Omar Naji, Krishnendra Nathella, Hoa Nguyen, Nikos Nikoleris, Lena E. Olson, Marc Orr, Binh Pham, Pablo Prieto, Trivikram Reddy, Alec Roelke, Mahyar Samani, Andreas Sandberg, Javier Setoain, Boris Shingarov, Matthew D. Sinclair, Tuan Ta, Rahul Thakur, Giacomo Travaglini, Michael Upton, Nilay Vaish, Ilias Vougioukas, William Wang, Zhengrong Wang, Norbert Wehn, Christian Weis, David A. Wood, Hongil Yoon, and Éder F. Zulian. 2020. The gem5 Simulator: Version 20.0. arXiv:2007.03152 [cs.AR] https://arxiv.org/abs/2007.03152
[32]
Giorgi Maisuradze and Christian Rossow. 2018. ret2spec: Speculative Execution Using Return Stack Buffers. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (Toronto, Canada) (CCS '18). Association for Computing Machinery, New York, NY, USA, 2109--2122.
[33]
Judy McConnell. 2019. WebAssembly support now shipping in all major browsers. https://blog.mozilla.org/blog/2017/11/13/webassembly-inbrowsers/. Accessed: 2024-08--27.
[34]
David Molnar, Matt Piotrowski, David Schultz, and David Wagner. 2005. The Program Counter Security Model: Automatic Detection and Removal of Control-Flow Side Channel Attacks. USENIX Association, Baltimore, MD.
[35]
Keaton Mowery, Sriram Keelveedhi, and Hovav Shacham. 2012. Are AES x86 cache timing attacks still feasible?. In Proceedings of the 2012 ACM Workshop on Cloud Computing Security Workshop (Raleigh, North Carolina, USA) (CCSW '12). Association for Computing Machinery, New York, NY, USA, 19--24.
[36]
Shravan Narayan, Craig Disselkoen, Daniel Moghimi, Sunjay Cauligi, Evan Johnson, Zhao Gang, Anjo Vahldiek-Oberwagner, Ravi Sahita, Hovav Shacham, Dean Tullsen, and Deian Stefan. 2021. Swivel: Hardening WebAssembly against Spectre. arXiv:2102.12730 [cs.CR]
[37]
Shirin Nilizadeh, Yannic Noller, and Corina S. Pasareanu. 2019. DifFuzz: Differential Fuzzing for Side-Channel Analysis. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE). 176--187.
[38]
OpenAI. 2021. ChatGPT: OpenAI's Conversational AI. https://openai.com/chatgpt Accessed: 2024-02--27.
[39]
David J. Pearce, Paul H.J. Kelly, and Chris Hankin. 2007. Efficient field-sensitive pointer analysis of C. ACM Trans. Program. Lang. Syst. 30, 1 (nov 2007), 4--es. https:/doi.org/10.1145/1290520.1290524
[40]
Ashay Rane, Calvin Lin, and Mohit Tiwari. 2015. Raccoon: Closing Digital Side-Channels through Obfuscated Execution. In 24th USENIX Security Symposium (USENIX Security 15). USENIX Association, Washington, D.C., 431--446. https://www.usenix.org/conference/usenixsecurity15/technical-sessions/presentation/rane
[41]
Oscar Reparaz, Josep Balasch, and Ingrid Verbauwhede. 2016. Dude, is my code constant time? Cryptology ePrint Archive, Paper 2016/1123. https://eprint.iacr.org/2016/1123 https://eprint.iacr.org/2016/1123.
[42]
Bruno Rodrigues, Fernando Magno Quintão Pereira, and Diego F. Aranha. 2016. Sparse representation of implicit flows with applications to side-channel detection. In Proceedings of the 25th International Conference on Compiler Construction (Barcelona, Spain) (CC 2016). Association for Computing Machinery, New York, NY, USA, 110--120.
[43]
Thomas Rokicki, Clémentine Maurice, Marina Botvinnik, and Yossi Oren. 2022. Port Contention Goes Portable: Port Contention Side Channels in Web Browsers. In Proceedings of the 2022 ACM on Asia Conference on Computer and Communications Security (Nagasaki, Japan) (ASIA CCS '22). Association for Computing Machinery, New York, NY, USA, 1182--1194.
[44]
Alan Romano, Xinyue Liu, Yonghwi Kwon, and Weihang Wang. 2022. An empirical study of bugs in webassembly compilers. In Proceedings of the 36th IEEE/ACM International Conference on Automated Software Engineering (Melbourne, Australia) (ASE '21). IEEE Press, 42--54.
[45]
Alan Romano and Weihang Wang. 2023. Automated WebAssembly Function Purpose Identification With Semantics-Aware Analysis. In Proceedings of the ACM Web Conference 2023 (Austin, TX, USA) (WWW '23). Association for Computing Machinery, New York, NY, USA, 2885--2894.
[46]
Bruce Schneier. 2007. Applied cryptography: protocols, algorithms, and source code in C. john wiley & sons.
[47]
Luigi Soares, Michael Canesche, and Fernando Magno Quintão Pereira. 2023. Side-channel Elimination via Partial Control-flow Linearization. ACM Trans. Program. Lang. Syst. 45, 2, Article 13 (jun 2023), 43 pages.
[48]
Luigi Soares and Fernando Magno Quintãn Pereira. 2021. Memory-Safe Elimination of Side Channels. In 2021 IEEE/ACM International Symposium on Code Generation and Optimization (CGO). 200--210.
[49]
Bjarne Steensgaard. 1996. Points-to analysis in almost linear time. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (St. Petersburg Beach, Florida, USA) (POPL '96). Association for Computing Machinery, New York, NY, USA, 32--41.
[50]
The Chromium Project. 2024. V8 JavaScript Engine. https://v8.dev. Accessed: 2024-08--19.
[51]
Rodothea Myrsini Tsoupidi, Musard Balliu, and Benoit Baudry. 2021. Vivienne: Relational Verification of Cryptographic Implementations in WebAssembly. In 2021 IEEE Secure Development Conference (SecDev). 94--102.
[52]
Jeroen Van Cleemput, Bjorn De Sutter, and Koen De Bosschere. 2020. Adaptive Compiler Strategies for Mitigating Timing Side Channel Attacks. IEEE Transactions on Dependable and Secure Computing 17, 1 (2020), 35--49.
[53]
Marco Vassena, Craig Disselkoen, Klaus von Gleissenthall, Sunjay Cauligi, Rami Gökhan Kici, Ranjit Jhala, Dean Tullsen, and Deian Stefan. 2021. Automatically eliminating speculative leaks from cryptographic code with blade. Proc. ACM Program. Lang. 5, POPL, Article 49 (jan 2021), 30 pages.
[54]
Conrad Watt, John Renner, Natalie Popescu, Sunjay Cauligi, and Deian Stefan. 2019. CT-wasm: type-driven secure cryptography for the web ecosystem. Proceedings of the ACM on Programming Languages 3, POPL (Jan. 2019), 1--29.
[55]
WebAssembly Community. [n. d.]. Security Considerations for WebAssembly. https://webassembly.org/docs/security/.
[56]
WebAssembly Community. 2022. Discussion on WASI-Crypto's API design. https://github.com/WebAssembly/wasi-crypto/issues/21. Accessed: 2023-09--25.
[57]
WebAssembly Community. 2024. WABT: The WebAssembly Binary Toolkit. https://github.com/WebAssembly/wabt. Accessed: 2024-03--28.
[58]
WebAssembly Community Group. 2024. WebAssembly Specification. https://webassembly.github.io/spec/core/intro/introduction.html. Accessed: 2024-08--31.
[59]
Meng Wu, Shengjian Guo, Patrick Schaumont, and Chao Wang. 2018. Eliminating timing side-channel leaks using program repair. In Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (Amsterdam, Netherlands) (ISSTA 2018). Association for Computing Machinery, New York, NY, USA, 15--26.