HackerPapers

arXiv:2408.11456cs.PL

Cage: Hardware-Accelerated Safe WebAssembly

Martin Fink, Dimitrios Stavrakakis, Dennis Sprokholt, Soham Chakraborty, Jan-Erik Ekberg, Pramod Bhatotia

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

WebAssembly (WASM) is an immensely versatile and increasingly popular compilation target. It executes applications written in several languages (e.g., C/C++) with near-native performance in various domains (e.g., mobile, edge, cloud). Despite WASM's sandboxing feature, which isolates applications from other instances and the host platform, WASM does not inherently provide any memory safety guarantees for applications written in low-level, unsafe languages. To this end, we propose Cage, a hardware-accelerated toolchain for WASM that supports unmodified applications compiled to WASM and utilizes diverse Arm hardware features aiming to enrich the memory safety properties of WASM. Precisely, Cage leverages Arm's Memory Tagging Extension (MTE) to (i) provide spatial and temporal memory safety for heap and stack allocations and (ii) improve the performance of WASM's sandboxing mechanism. Cage further employs Arm's Pointer Authentication (PAC) to prevent leaked pointers from being reused by other WASM instances, thus enhancing WASM's security properties. We implement our system based on 64-bit WASM. We provide a WASM compiler and runtime with support for Arm's MTE and PAC. On top of that, Cage's LLVM-based compiler toolchain transforms unmodified applications to provide spatial and temporal memory safety for stack and heap allocations and prevent function pointer reuse. Our evaluation on real hardware shows that Cage incurs minimal runtime (<5.8%) and memory (<3.7%) overheads and can improve the performance of WASM's sandboxing mechanism, achieving a speedup of over 5.1%, while offering efficient memory safety guarantees.

arXiv comments
Journal reference
23rd ACM/IEEE International Symposium on Code Generation and Optimization (CGO '25), March 2025, Las Vegas, NV, USA
DOI
doi:10.1145/3696443.3708920
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 2 comments across 2 threads, from Dec 2025 to Dec 2025. Found in 1 HN submission from Dec 2025 to Dec 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

    • "Cage: Hardware-Accelerated Safe WebAssembly" (2024) https://arxiv.org/abs/2408.11456v2 : > Abstract: WebAssembly (WASM) is an immensely versatile and increasingly popular compilation target. It executes applications written in several languages (e.g., C/C++) with near-native…

      westurnerView on HNParent context

    • A bit OT here, but oh well Would hardened_malloc or llvm scudo be useful in a WASM runtime (given that WASM doesn't have an MMU)? https://www.google.com/search?q=would+hardened_malloc+be+use... Emscripten handles malloc and free with dlmalloc, emmalloc, mimalloc, emcc…

      westurnerView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.