Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Characterizing and Detecting WebAssembly Runtime Bugs

Published: 21 December 2023 Publication History
  • Get Citation Alerts
  • Abstract

    WebAssembly (abbreviated WASM) has emerged as a promising language of the Web and also been used for a wide spectrum of software applications such as mobile applications and desktop applications. These applications, named WASM applications, commonly run in WASM runtimes. Bugs in WASM runtimes are frequently reported by developers and cause the crash of WASM applications. However, these bugs have not been well studied. To fill in the knowledge gap, we present a systematic study to characterize and detect bugs in WASM runtimes. We first harvest a dataset of 311 real-world bugs from hundreds of related posts on GitHub. Based on the collected high-quality bug reports, we distill 31 bug categories of WASM runtimes and summarize their common fix strategies. Furthermore, we develop a pattern-based bug detection framework to automatically detect bugs in WASM runtimes. We apply the detection framework to seven popular WASM runtimes and successfully uncover 60 bugs that have never been reported previously, among which 13 have been confirmed and 9 have been fixed by runtime developers.

    References

    [1]
    Nicolas Falliere. 2018. Reverse Engineering WebAssembly. https://www.pnfsoftware.com/reversing-wasm.pdf
    [5]
    [12]
    [13]
    [14]
    [15]
    [18]
    EOSIO. 2022. EOS VM - A low-latency, high performance and extensible WebAssembly engine.https://github.com/EOSIO/eos
    [19]
    ewasm. 2022. hera - An ewasm (revision 4) virtual machine implemented in C++ conforming to EVMC ABIv9.https://github.com/ewasm/hera
    [20]
    WebAssembly Community Group. 2022. WABT: The WebAssembly Binary Toolkit. https://github.com/WebAssembly/wabt
    [23]
    WebAssembly Community Group. 2022. WASI link. https://wasi.dev/
    [24]
    WebAssembly Community Group. 2022. Wasm non web usage. https://webassembly.org/docs/non-web/
    [25]
    Timothy McCallum. 2022. Wasm runtime architecture. https://medium.com/wasm/webassembly-wasm-runtimes-522bcc7478fd
    [26]
    Wasm3 Labs. 2022. wasm3 - The fastest WebAssembly interpreter, and the most universal runtime.https://github.com/wasm3/wasm3
    [28]
    [29]
    [30]
    [31]
    Cloud Native Computing Foundation. 2022. WasmEdge issue 1711. https://github.com/WasmEdge/WasmEdge/issues/1711
    [32]
    Cloud Native Computing Foundation. 2022. WasmEdge Runtime. https://github.com/WasmEdge/WasmEdge
    [33]
    Wasmer. 2022. wasmer - A fast and secure WebAssembly runtime. https://github.com/wasmerio/wasmer
    [34]
    Wasmer. 2022. wasmer-go - A complete and mature WebAssembly runtime for Go based on Wasmer.https://github.com/wasmerio/wasmer-go
    [35]
    Wasmer. 2022. wasmer-python - A complete and mature WebAssembly runtime for Python based on Wasmer.https://github.com/wasmerio/wasmer-python
    [36]
    Bytecode Alliance. 2022. wasmtime - A standalone runtime for WebAssembly. https://github.com/bytecodealliance/wasmtime
    [37]
    [39]
    WAVM. 2022. WAVM - A WebAssembly virtual machine, designed for use in non-browser applications.https://github.com/WAVM/WAVM
    [40]
    Bytecode Alliance. 2022. WebAssembly Micro Runtime. https://github.com/bytecodealliance/wasm-micro-runtime
    [42]
    WebAssembly Community Group. 2022. WebAssmebly Doc. https://webassembly.org/
    [43]
    Emscripten community. 2023. Emscripten compiler. https://emscripten.org/
    [45]
    Emad Aghajani, Csaba Nagy, Olga Lucero Vega-Márquez, Mario Linares-Vásquez, Laura Moreno, Gabriele Bavota, and Michele Lanza. 2019. Software documentation issues unveiled. In 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE ’19). IEEE, 1199–1210.
    [46]
    Rafael Belchior, André Vasconcelos, Sérgio Guerreiro, and Miguel Correia. 2021. A survey on blockchain interoperability: Past, present, and future trends. ACM Computing Surveys (CSUR) 54, 8 (2021), 1–41.
    [47]
    Stefanie Beyer, Christian Macho, Massimiliano Di Penta, and Martin Pinzger. 2018. Automatically classifying posts into question categories on stack overflow. In 2018 IEEE/ACM 26th International Conference on Program Comprehension (ICPC ’18). IEEE, 211–21110.
    [48]
    Shrenik Bhansali, Ahmet Aris, Abbas Acar, Harun Oz, and A. Selcuk Uluagac. 2022. A first look at code obfuscation for WebAssembly. In Proceedings of the 15th ACM Conference on Security and Privacy in Wireless and Mobile Networks. 140–145.
    [49]
    Zhenpeng Chen, Huihan Yao, Yiling Lou, Yanbin Cao, Yuanqiang Liu, Haoyu Wang, and Xuanzhe Liu. 2021. An empirical study on deployment faults of deep learning based mobile applications. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE ’21). IEEE, 674–685.
    [50]
    Jacob Cohen. 1960. A coefficient of agreement for nominal scales. Educational and Psychological Measurement 20, 1 (1960), 37–46.
    [51]
    Anthony Di Franco, Hui Guo, and Cindy Rubio-González. 2017. A comprehensive study of real-world numerical bug characteristics. In 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE ’17). IEEE, 509–519.
    [52]
    Zhen Yu Ding and Claire Le Goues. 2021. An empirical study of OSS-Fuzz bugs. In 2021 IEEE/ACM 18th International Conference on Mining Software Repositories (MSR ’21). IEEE, 131–142.
    [53]
    Phani Kishore Gadepalli, Sean McBride, Gregor Peach, Ludmila Cherkasova, and Gabriel Parmer. 2020. Sledge: A serverless-first, light-weight WASM runtime for the edge. In Proceedings of the 21st International Middleware Conference. 265–279.
    [54]
    Phani Kishore Gadepalli, Gregor Peach, Ludmila Cherkasova, Rob Aitken, and Gabriel Parmer. 2019. Challenges and opportunities for efficient serverless computing at the edge. In 2019 38th Symposium on Reliable Distributed Systems (SRDS ’19). IEEE, 261–2615.
    [55]
    Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and J. F. Bastien. 2017. Bringing the web up to speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation. 185–200.
    [56]
    David Herrera, Hangfen Chen, Erick Lavoie, and Laurie Hendren. 2018. WebAssembly and JavaScript challenge: Numerical program performance using modern browser technologies and devices. University of McGill, Montreal: QC, Technical Report SABLE-TR-2018-2.
    [57]
    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. 2696–2708.
    [58]
    Eric Holk. 2018. Schism: A self-hosting scheme to WebAssembly compiler. In Proceedings of the Scheme and Functional.
    [59]
    Abhinav Jangda, Bobby Powers, Emery D. Berger, and Arjun Guha. 2019. Not so fast: Analyzing the performance of WebAssembly vs. native code. In 2019 USENIX Annual Technical Conference (USENIX ATC ’19). 107–120.
    [60]
    Daniel Lehmann, Johannes Kinder, and Michael Pradel. 2020. Everything old is new again: Binary security of WebAssembly. In 29th USENIX Security Symposium (USENIX Security ’20). 217–234.
    [61]
    Daniel Lehmann and Michael Pradel. 2022. Finding the dwarf: Recovering precise types from WebAssembly binaries. In Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation. 410–425.
    [62]
    Shan Lu, Soyeon Park, Eunsoo Seo, and Yuanyuan Zhou. 2008. Learning from mistakes: A comprehensive study on real world concurrency bug characteristics. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems. 329–339.
    [63]
    Niko Mäkitalo, Tommi Mikkonen, Cesare Pautasso, Victor Bankowski, Paulius Daubaris, Risto Mikkola, and Oleg Beletski. 2021. WebAssembly modules as lightweight containers for liquid IoT applications. In International Conference on Web Engineering. Springer, 328–336.
    [64]
    Brian McFadden, Tyler Lukasiewicz, Jeff Dileo, and Justin Engler. 2018. Security chasms of WASM. NCC Group Whitepaper.
    [65]
    Pankaj Mendki. 2020. Evaluating WebAssembly enabled serverless approach for edge computing. In 2020 IEEE Cloud Summit. IEEE, 161–166.
    [66]
    Jämes Ménétrey, Marcelo Pasin, Pascal Felber, and Valerio Schiavoni. 2021. Twine: An embedded trusted runtime for WebAssembly. In 2021 IEEE 37th International Conference on Data Engineering (ICDE ’21). IEEE, 205–216.
    [67]
    Matteo Paltenghi and Michael Pradel. 2022. Bugs in quantum computing platforms: An empirical study. Proceedings of the ACM on Programming Languages 6, OOPSLA1 (2022), 1–27.
    [68]
    Alan Romano, Xinyue Liu, Yonghwi Kwon, and Weihang Wang. 2021. An empirical study of bugs in WebAssembly compilers. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE ’21). IEEE, 42–54.
    [69]
    Alan Romano and Weihang Wang. 2020. WASim: Understanding WebAssembly applications through classification. In 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE ’20). IEEE, 1321–1325.
    [70]
    Carolyn B. Seaman. 1999. Qualitative methods in empirical studies of software engineering. IEEE Transactions on Software Engineering 25, 4 (1999), 557–572.
    [71]
    Quentin Stiévenart, David W. Binkley, and Coen De Roover. 2022. Static stack-preserving intra-procedural slicing of WebAssembly binaries. In 2022 IEEE/ACM 44th International Conference on Software Engineering (ICSE ’22). IEEE, 2031–2042.
    [72]
    Weihang Wang. 2021. Empowering web applications with WebAssembly: Are we there yet?. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE ’21). IEEE, 1301–1305.
    [73]
    Ziyuan Wang, Dexin Bu, Aiyue Sun, Shanyi Gou, Yong Wang, and Lin Chen. 2022. An empirical study on bugs in python interpreters. IEEE Transactions on Reliability 1,1 (2022). DOI:
    [74]
    Elliott Wen and Gerald Weber. 2020. Wasmachine: Bring IoT up to speed with a WebAssembly OS. In 2020 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops ’20). IEEE, 1–4.
    [75]
    Jinfeng Wen, Zhenpeng Chen, Yi Liu, Yiling Lou, Yun Ma, Gang Huang, Xin Jin, and Xuanzhe Liu. 2021. An empirical study on challenges of application development in serverless computing. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 416–428.
    [76]
    Tianyi Zhang, Cuiyun Gao, Lei Ma, Michael Lyu, and Miryung Kim. 2019. An empirical study of common challenges in developing deep learning applications. In 2019 IEEE 30th International Symposium on Software Reliability Engineering (ISSRE ’19). IEEE, 104–115.
    [77]
    Xiuhong Zhang. 2020. WebAssembly Principles and Core Technologies. China Machine Press.
    [78]
    Yuhao Zhang, Yifan Chen, Shing-Chi Cheung, Yingfei Xiong, and Lu Zhang. 2018. An empirical study on TensorFlow program bugs. In Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis. 129–140.
    [79]
    Zhide Zhou, Zhilei Ren, Guojun Gao, and He Jiang. 2021. An empirical study of optimization bugs in GCC and LLVM. Journal of Systems and Software 174 (2021), 110884.

    Cited By

    View all
    • (2023)An Overview of WebAssembly for IoT: Background, Tools, State-of-the-Art, Challenges, and Future DirectionsFuture Internet10.3390/fi1508027515:8(275)Online publication date: 18-Aug-2023
    • (2023)Enabling Trusted TEE-as-a-Service Models with Privacy Preserving Automatons2023 IEEE International Conference on Cloud Computing Technology and Science (CloudCom)10.1109/CloudCom59040.2023.00048(252-260)Online publication date: 4-Dec-2023
    • (2023)A Comprehensive Study of Bugs in Embedded WebAssembly Virtual Machines2023 3rd International Conference on Computer Science, Electronic Information Engineering and Intelligent Control Technology (CEI)10.1109/CEI60616.2023.10528174(901-907)Online publication date: 15-Dec-2023
    • Show More Cited By

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Transactions on Software Engineering and Methodology
    ACM Transactions on Software Engineering and Methodology  Volume 33, Issue 2
    February 2024
    947 pages
    ISSN:1049-331X
    EISSN:1557-7392
    DOI:10.1145/3618077
    • Editor:
    • Mauro Pezzè
    Issue’s Table of Contents

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 21 December 2023
    Online AM: 20 September 2023
    Accepted: 16 August 2023
    Revised: 07 August 2023
    Received: 20 January 2023
    Published in TOSEM Volume 33, Issue 2

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. WebAssembly
    2. WebAssembly runtime

    Qualifiers

    • Research-article

    Funding Sources

    • National Key R&D Program of China
    • National Natural Science Foundation of China
    • Beijing Outstanding Young Scientist Program
    • Center for Data Space Technology and System, Peking University
    • ERC Advanced Grant
    • Hong Kong RGC Project

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)450
    • Downloads (Last 6 weeks)65
    Reflects downloads up to

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)An Overview of WebAssembly for IoT: Background, Tools, State-of-the-Art, Challenges, and Future DirectionsFuture Internet10.3390/fi1508027515:8(275)Online publication date: 18-Aug-2023
    • (2023)Enabling Trusted TEE-as-a-Service Models with Privacy Preserving Automatons2023 IEEE International Conference on Cloud Computing Technology and Science (CloudCom)10.1109/CloudCom59040.2023.00048(252-260)Online publication date: 4-Dec-2023
    • (2023)A Comprehensive Study of Bugs in Embedded WebAssembly Virtual Machines2023 3rd International Conference on Computer Science, Electronic Information Engineering and Intelligent Control Technology (CEI)10.1109/CEI60616.2023.10528174(901-907)Online publication date: 15-Dec-2023
    • (2023)WADIFF: A Differential Testing Framework for WebAssembly Runtimes2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE)10.1109/ASE56229.2023.00188(939-950)Online publication date: 11-Sep-2023

    View Options

    Get Access

    Login options

    Full Access

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Full Text

    View this article in Full Text.

    Full Text

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media