Lune

POPL2023Top-tier venue

MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code

Alexandra E. Michael, Anitha Gollamudi, Jay Bosamiya, Evan Johnson, Aidan Denlinger, Craig Disselkoen, Conrad Watt, Bryan Parno, Marco Patrignani, Marco Vassena, Deian Stefan

Abstract

DEIAN STEFAN, UCSD, USA Most programs compiled to WebAssembly (Wasm) today are written in unsafe languages like C and C++. Unfortunately, memory-unsafe C code remains unsafe when compiled to Wasm-and attackers can exploit buffer overflows and use-after-frees in Wasm almost as easily as they can on native platforms. Memory-Safe WebAssembly (MSWasm) proposes to extend Wasm with language-level memory-safety abstractions to precisely address this problem. In this paper, we build on the original MSWasm position paper to realize this vision. We give a precise and formal semantics of MSWasm, and prove that well-typed MSWasm programs are, by construction, robustly memory safe. To this end, we develop a novel, language-independent memorysafety property based on colored memory locations and pointers. This property also lets us reason about the security guarantees of a formal C-to-MSWasm compiler-and prove that it always produces memory-safe programs (and preserves the semantics of safe programs). We use these formal results to then guide several implementations: Two compilers of MSWasm to native code, and a C-to-MSWasm compiler (that extends Clang). Our MSWasm compilers support different enforcement mechanisms, allowing developers to make security-performance trade-offs according to their needs. Our evaluation shows that on the PolyBenchC suite, the overhead of enforcing memory safety in software ranges from 22% (enforcing spatial safety alone) to 198% (enforcing full memory safety), and 51.7% when using hardware memory capabilities for spatial safety and pointer integrity.

More importantly, MSWasm's design makes it easy to swap between enforcement mechanisms; as fast (especially hardware-based) enforcement techniques become available, MSWasm will be able to take advantage of these advances almost for free.

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.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

No credit card required.

Lineage

  • Put Your Memory in Order: Efficient Domain-based Memory Isolation for WASM Applications cites An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use Cases
  • Iris-MSWasm: Elucidating and Mechanising the Security Invariants of Memory-Safe WebAssembly cites Iris-Wasm: Robust and Modular Verification of WebAssembly Programs
  • Iris-MSWasm: Elucidating and Mechanising the Security Invariants of Memory-Safe WebAssembly cites RichWasm: Bringing Safe, Fine-Grained, Shared-Memory Interoperability Down to WebAssembly
  • Cornucopia: Temporal Safety for CHERI Heaps cites Oscar: A Practical Page-Permissions-Based Scheme for Thwarting Dangling Pointers
  • RichWasm: Bringing Safe, Fine-Grained, Shared-Memory Interoperability Down to WebAssembly cites Iris-Wasm: Robust and Modular Verification of WebAssembly Programs
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papersTop 5 of 8 by citations

  1. Iris-Wasm: Robust and Modular Verification of WebAssembly ProgramsXiaojia Rao, Aïna Linn Georges, Maxime Legoupil, Conrad Watt et al.PLDI 2023 · 19 citations
  2. Put Your Memory in Order: Efficient Domain-based Memory Isolation for WASM ApplicationsHanwen Lei, Ziqi Zhang, Shaokun Zhang, Peng Jiang et al.CCS 2023 · 7 citations
  3. Iris-MSWasm: Elucidating and Mechanising the Security Invariants of Memory-Safe WebAssemblyMaxime Legoupil, June Rousseau, Aïna Linn Georges, Jean Pichon-Pharabod et al.OOPSLA 2024 · 5 citations
  4. RichWasm: Bringing Safe, Fine-Grained, Shared-Memory Interoperability Down to WebAssemblyMichael Fitzgibbons, Zoe Paraskevopoulou, Noble Mushtak, Michelle Thalakottur et al.PLDI 2024 · 3 citations
  5. On Kernel's Safety in the Spectre Era (And KASLR is Formally Dead)Davide Davoli, Martin Avanzini, Tamara RezkCCS 2024 · 2 citations

Builds onTop 5 of 8 by citations

  1. PAC it up: Towards Pointer Integrity using ARM Pointer AuthenticationHans Liljestrand, Thomas Nyman, Kui Wang, Carlos Chinea Perez et al.USENIX Security 2019 · 168 citations
  2. An Empirical Study of Real-World WebAssembly Binaries: Security, Languages, Use CasesAaron Hilbig, Daniel Lehmann, Michael PradelWWW 2021 · 114 citations
  3. TypeSan: Practical Type Confusion DetectionIstván Haller, Yuseok Jeon, Hui Peng, Mathias Payer et al.CCS 2016 · 97 citations
  4. Oscar: A Practical Page-Permissions-Based Scheme for Thwarting Dangling PointersThurston H. Y. Dang, Petros Maniatis, David A. WagnerUSENIX Security 2017 · 77 citations
  5. Cornucopia: Temporal Safety for CHERI HeapsNathaniel Wesley Filardo, Brett F. Gutstein, Jonathan Woodruff, Sam Ainsworth et al.S&P 2020 · 71 citations

Related papers

  1. Provably-Safe Multilingual Software Sandboxing using WebAssemblyJay Bosamiya, Wen Shih Lim, Bryan ParnoUSENIX Security 2022
  2. Indexed Types for a Statically Safe WebAssemblyAdam T. Geller, Justin Frank, William J. BowmanPOPL 2024 · 4 citations
  3. WBSan: WebAssembly Bug Detection for Sanitization and Binary-Only FuzzingXiao Wu, Junzhou He, Liyan Huang, Cai Fu et al.WWW 2025 · 5 citations
  4. Translating C To Rust: Lessons from a User StudyRuishi Li, Bo Wang, Tianyu Li, Prateek Saxena et al.NDSS 2025
  5. Evaluating the Effectiveness of Memory Safety SanitizersEmanuel Q. Vintila, Philipp Zieris, Julian HorschS&P 2025
Dusk over the sea between two cliffs drawn in fine vertical lines