Automated WebAssembly Function Purpose Identification With Semantics-Aware Analysis
Alan Romano, Weihang Wang
Abstract
WebAssembly is a recent web standard built for better performance in web applications. The standard defines a binary code format to use as a compilation target for a variety of languages, such as C, C++, and Rust. The standard also defines a text representation for readability, although, WebAssembly modules are difficult to interpret by human readers, regardless of their experience level. This makes it difficult to understand and maintain any existing WebAssembly code. As a result, third-party WebAssembly modules need to be implicitly trusted by developers as verifying the functionality themselves may not be feasible. To this end, we construct WASPur, a tool to automatically identify the purposes of WebAssembly functions. To build this tool, we first construct an extensive collection of WebAssembly samples that represent the state of WebAssembly. Second, we analyze the dataset and identify the diverse use cases of the collected WebAssembly modules. We leverage the dataset of WebAssembly modules to construct semantics-aware intermediate representations (IR) of the functions in the modules. We encode the function IR for use in a machine learning classifier, and we find that this classifier can predict the similarity of a given function against known named functions with an accuracy rate of 88.07%. We hope our tool will enable inspection of optimized and minified WebAssembly modules that remove function names and most other semantic identifiers.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- WaDec: Decompiling WebAssembly Using Large Language Model cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought Decompilation cites MineSweeper: An In-depth Look into Drive-by Cryptocurrency Mining and Its Defense
- StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought Decompilation cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection cites MineSweeper: An In-depth Look into Drive-by Cryptocurrency Mining and Its Defense
- WaSCR: A WebAssembly Instruction-Timing Side Channel Repairer cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases cites MineSweeper: An In-depth Look into Drive-by Cryptocurrency Mining and Its Defense
- CLARC: C/C++ Benchmark for Robust Code Search cites StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought Decompilation
- CLARC: C/C++ Benchmark for Robust Code Search cites MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking Detection
- CLARC: C/C++ Benchmark for Robust Code Search cites WaSCR: A WebAssembly Instruction-Timing Side Channel Repairer
- CLARC: C/C++ Benchmark for Robust Code Search cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
- Wasm-R3: Record-Reduce-Replay for Realistic and Standalone WebAssembly Benchmarks cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
Cited by top-tier papers9
- WaDec: Decompiling WebAssembly Using Large Language ModelXinyu She, Yanjie Zhao, Haoyu WangASE 2024 · 9 citations
- Wasm-R3: Record-Reduce-Replay for Realistic and Standalone WebAssembly BenchmarksDoehyun Baek, Jakob Getz, Yusung Sim, Daniel Lehmann et al.OOPSLA 2024 · 6 citations
- StackSight: Unveiling WebAssembly through Large Language Models and Neurosymbolic Chain-of-Thought DecompilationWeike Fang, Zhejian Zhou, Junzhou He, Weihang WangICML 2024 · 5 citations
- WaSCR: A WebAssembly Instruction-Timing Side Channel RepairerLiyan Huang, Junzhou He, Chao Wang, Weihang WangWWW 2025 · 3 citations
- CLARC: C/C++ Benchmark for Robust Code SearchKaicheng Wang, Liyan Huang, Weike Fang, Weihang WangICLR 2026 · 3 citations
Builds on3
- MineSweeper: An In-depth Look into Drive-by Cryptocurrency Mining and Its DefenseRadhesh Krishnan Konoth, Emanuele Vineti, Veelasha Moonsamy, Martina Lindorfer et al.CCS 2018 · 162 citations
- An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use CasesAaron Hilbig, Daniel Lehmann, Michael PradelWWW 2021 · 114 citations
- MinerRay: Semantics-Aware Analysis for Ever-Evolving Cryptojacking DetectionAlan Romano, Yunhui Zheng, Weihang WangASE 2020 · 30 citations
Related papers
- Multi-modal Learning for WebAssembly Reverse EngineeringHanxian Huang, Jishen ZhaoISSTA 2024 · 1 citation
- When Function Inlining Meets WebAssembly: Counterintuitive Impacts on Runtime PerformanceAlan Romano, Weihang WangFSE 2023 · 7 citations
- Two Mechanisations of WebAssembly 1.0Conrad Watt, Xiaojia Rao, Jean Pichon-Pharabod, Martin Bodin et al.FM 2021 · 32 citations
- An Empirical Study of Bugs in WebAssembly CompilersAlan Romano, Xinyue Liu, Yonghwi Kwon, Weihang WangASE 2021 · 43 citations
- Broken Promise: Differential Analysis of Functional Discrepancies Between WebAssembly and Native BinariesXiao Wu, Alan Romano, Liyan Huang, Qiwen Yan et al.WWW 2026
