Walma: Learning to See Memory Corruption in WebAssembly

summary

The gist

WebAssembly’s monolithic linear memory turns a single memory-corruption bug into a bidirectional threat: a compromised module can attack its embedding host…

In short

Walma is a framework that uses a convolutional neural network to classify snapshots of WebAssembly linear memory as grayscale images. This approach detects memory corruption by analyzing the physical layout of data, catching attacks missed by traditional methods. It provides continuous, state-centric attestation for both module and host integrity.

Key concepts

Linear Memory Attestation
This is a method to verify the integrity of WebAssembly's single block of memory. Walma treats this memory as an image, allowing it to check if the data structure has been corrupted without needing internal knowledge of the program's code or execution flow.
Snapshot Classification via CNN
The system takes pictures (snapshots) of the entire memory state and uses a Convolutional Neural Network (CNN) to classify them. The CNN learns to recognize patterns in how compiled code organizes memory, identifying localized texture disruptions that indicate corruption.
Bidirectional Trust Boundary
Walma's verifier can be placed on either side of the Wasm trust boundary. This means it can protect a trusted module from a malicious host or audit a trusted host for tampering with the module's state, creating comprehensive security coverage.

Terminology used across episodes

This episode discusses

The paper

Walma: Learning to See Memory Corruption in WebAssembly · Read on arXiv

Oussama Draissi, Mark Günzel, Ahmad-Reza Sadeghi, Lucas Davi

University of Duisburg-Essen · Technical University of Darmstadt

The monolithic linear memory of WebAssembly (Wasm) creates a bidirectional attack surface: a memory corruption bug in a module can compromise the host, and a compromised host can corrupt the state of a trusted module. Existing defenses either require custom runtimes or source code changes, and none can verify runtime integrity under an adversarial host. We present WALMA, the first attestation framework delivering resilience by reaction against data-centric attacks that corrupt a region of memory. We render linear memory snapshots as grayscale images and classify them with a convolutional neural network. The network reads the row-aligned structure that compiled code imposes on memory and detects corruption that byte and texture statistics miss. Our main VGG-16 detector reaches 95%--100% verdict accuracy on four of five CVE-affected applications without a single false alarm, and a 1.9M-parameter ResNet, small enough to run inside the runtime on every host call, stays within a few points of it on the same four. A Shannon-entropy analysis bounds which out-of-band edits the network can separate from valid state, and black-box evasion requires contiguous overwrites of hundreds of kilobytes to megabytes. On the 53 WABench binaries, boundary attestation costs 1.07x--1.69x, scaling with a module's exposure to the host rather than with its runtime. WALMA thus makes linear memory integrity a property a Wasm runtime can check continuously: end to end against compromised modules, and against untrusted hosts provided snapshots reach the verifier intact.

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: We're looking at the paper: "Walma: Learning to See Memory Corruption in WebAssembly".

Elias: Here's the gist of the paper. WebAssembly’s monolithic linear memory turns a single memory-corruption bug into a bidirectional threat: a compromised module can attack its embedding host, and a malicious host can tamper with a trusted module’s state The authors present Walma, a framework for WebAssembly linear memory attestation that renders snapshots of linear memory as grayscale images and classifies them with a convolutional neural network This research is significant because it introduces a continuous, state-centric primitive that audits the module’s mutable state itself, with a verifier placeable on either side of the trust boundary The Core Problem Addressed WebAssembly modules hold all of its mutable state in one contiguous byte array with no internal memory protection A memory corruption bug is therefore rarely contained because an overflow in one buffer can corrupt any other structure in the module The sandbox isolates the module from its host, but the host implicitly trusts data returned across the boundary, so a data-only attack can escalate into a full host compromise A privileged host such as a malicious administrator or a compromised hypervisor can tamper with linear memory directly and subvert authorization checks before they reach the user This creates a bidirectional integrity problem that existing defenses leave open How the Training Signal is Built The offline training phase constructs the classifier from synthetically generated states The corpus comes from binary instrumentation that injects snapshot hooks at deterministic points, plus coverage-guided fuzzing

12, 14, 15, 30: that drives the instrumented binary along diverse paths Valid Wasm memory layouts are application-specific, so no closed-form rule separates a benign state from a corrupted one; Walma must learn that boundary from observed executions The corpus is labeled using AddressSanitizer (ASan)

48: , the standard oracle for memory-corruption detection

14, 15: , whose near-zero false-positive rate keeps label noise out of the corrupted class Each captured snapshot inherits the label of its input, yielding a per-target corpus of labeled snapshots Where the Gains Come From Walma achieves four properties: 1 statecentric attestation that catches the memory footprint of data-only exploitation, which control-flow attestation misses; 2 bidirectional applicability, with a single attester–verifier protocol protecting a trusted module from a malicious host and a trusted host from a compromised module; 3 sanitizer independence at inference, detecting tampering with no sanitizer in the loop; and 4 tunable cost, exposed through three instrumentation policies and three verifier backends The visual encoding exploits the row-aligned structure that compiled code imposes on memory—audio frames, pixel rows, allocator headers—so corruption appears as a localized texture disruption a CNN detects without hand-engineered features On five CVE-affected applications, our main VGG-16 model

52: reaches 95 %–100 % verdict accuracy on four of the five targets, without a single false alarm on benign inputs on any target Performance and Practicality Across WABench’s 53 binaries

17, 45, 63: , attestation costs 1.07×–1.69× at the host boundary, making continuous, state-centric memory attestation for Wasm practical The performance-optimal choice is also the one that never exposes snapshots off the runtime For in-runtime CPU inference at 5.3 ms per snapshot, this beats GPU offloading because data transfer dominates compute at this snapshot size The Import policy—checking memory exactly where an attack escapes the sandbox—incurs only a 1.07× slowdown on compute kernels and 1.69× on host-call-heavy workloads This realizes the tunable security–performance contract of Section 3: finer inter-snapshot coverage costs proportionally more Limitations and Future Directions Walma’s weak targets are those whose benign memory lacks row-aligned structure Program-Specific Models train one model per target, generalizing to unseen inputs within a program, but do not transfer across programs A privileged host with white-box model access could craft memory states the classifier reads as benign Snapshot Freshness is a matter rather than a limit of visual classification because replay or corrupt-then-restore races can occur without nonces Walma is a detection primitive, and prevention under Scenario A would mean trusting the host we explicitly do not trust The same property admits a benign-only, one-class verifier needing no corrupted class at all Walma is the first linear-memory attestation framework for WebAssembly, reducing integrity verification to image classification It covers both directions of the Wasm trust relationship, with the verifier inside a TEE against an untrusted cloud host or beside the browser against a compromised module Its VGG-16 model reaches 95 %–100 % verdict accuracy on four of five CVE-affected applications, never raising a false alarm on a benign input, with misses concentrated where benign memory approaches maximal entropy Across 53 WABench binaries, the in-runtime VGG-16 backend attests at 1.07×–1.69× for boundary defense and 1.50×–2.65× per function—a practical primitive for continuous Wasm memory integrity Acknowledgments This work was partially funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through SFB 1119 – 236615297, project S2 References

0009-0005-6065-8087: A library OS for Linux multi-process applications, with Intel SGX support.

Nadia: url: https://github.com/gramineproject/gramine (Accessed: 2626-1).

1: A library OS for Linux multi-process applications, with Intel SGX support.

Nadia: url: https://github.com/gramineproject/gramine (Accessed: 2026-01-09).

Title and authors: Nadia: Moving on to how they frame this, "Walma: Learning to See Memory Corruption in WebAssembly" is a pretty straightforward title, but it really highlights the core idea of using AI to analyze memory states. It positions linear memory attestation not as a hard rule set you write, but as an image classification problem that the system learns from observation.

Elias: It emphasizes the learning aspect, which is key because they aren't relying on a closed-form rule to separate good from bad memory states; instead, Walma has to learn that boundary from observed executions. That shifts the defense mechanism entirely.

Priya: So it’s not about writing perfect memory safety checks, but about training a model on what corrupted data looks like visually in terms of its layout. That feels different from traditional formal verification methods we usually talk about when discussing module security.

Nadia: Right, and the authors are addressing the bidirectional threat here too. They're showing that this single attester verifier protocol can protect a trusted module from a malicious host while also protecting a trusted host from a compromised module, which is important because it covers both directions of the trust relationship.

Elias: That bidirectional applicability is what makes this framework distinct; it’s not just one-way monitoring. They are looking at how memory corruption in one direction can compromise the other side of the boundary.

The paper's summary: Nadia: So, to summarize what they’re doing, Walma is a framework for WebAssembly linear memory attestation where snapshots are rendered as grayscale images and classified by a convolutional neural network that reads those row-aligned structures. This detects corruption that traditional byte and texture statistics often miss.

Elias: The summary points out the bidirectional threat clearly: a corrupted module can attack the host, but also a malicious host can tamper with the trusted module's state directly, which is what existing defenses leave open.

Priya: It’s about using this visual classification to catch data-only attacks that control-flow attestation misses. They are validating the memory footprint itself instead of just watching the execution path, which is a really interesting approach for identifying subtle tampering.

Nadia: And they show how they build their training signal: they use binary instrumentation for deterministic snapshots and coverage-guided fuzzing to drive that instrumented binary along diverse paths to get a rich corpus. The labels come from AddressSanitizer, which is the standard oracle for memory corruption detection, so the label noise is kept out of the corrupted class.

Elias: They also detail how they tune this system through three instrumentation policies and three verifier backends, which gives them that tunable cost aspect they mention later on. It shows a practical mechanism for security-performance contracting in this context.

The paper's improvements: Nadia: The authors highlight several improvements to the existing ideas in this paper, specifically focusing on what Walma actually achieves. They claim it provides state-centric attestation that catches the memory footprint of data-only exploitation, which control-flow attestation misses.

Elias: That’s a big claim because it means they are catching things that bypass standard execution flow checks by looking at the underlying data structure itself, and they also achieve bidirectional applicability with a single protocol between an attester and verifier.

Priya: And I see the improvement in sanitizer independence at inference, meaning the detection works even if there’s no sanitizer running during the actual checking loop, which is a nice feature for deployment scenarios where you can't always guarantee instrumentation is present.

Nadia: They also point out that the visual encoding exploits that row-aligned structure compiled code imposes on memory, so corruption appears as a localized texture disruption that the CNN detects without needing hand-engineered features. That’s a very data-driven way to find anomalies.

Elias: And they quantify how effective it is, saying their main VGG16 model reaches ninety-five percent to one hundred percent verdict accuracy on four of the five CVE-affected applications, which gives us a concrete performance benchmark against known vulnerabilities.

Conclusion: Nadia: So wrapping this up on "Walma: Learning to See Memory Corruption in WebAssembly," it’s essentially introducing the first linear-memory attestation framework for WebAssembly by reducing integrity verification to an image classification problem. It covers both sides of the Wasm trust relationship.

Elias: The key implication is that we can move toward continuous, state-centric memory attestation where a verifier sits either inside a TEE against an untrusted cloud host or beside the browser against a compromised module. This makes integrity verification much more practical than relying solely on custom runtimes or source changes.

Priya: From my side, it’s interesting that they bound the detection effectiveness by Shannon entropy analysis, which quantifies what kind of out-of-band edits the learned prior can actually find, giving us a measurable limit on its capability.

Nadia: They show that across fifty three WABench binaries, their in-runtime backend attests at one point zero seven times to one point six nine times for boundary defense and one point five zero times to two point six five times per function. That’s a practical primitive for continuous integrity checks on WebAssembly memory.

Elias: It’s a lot of work, but it seems like this approach provides a tangible way to deal with the inherent bidirectional integrity problem that monolithic linear memory creates in Wasm environments. We’ll keep an eye on how this evolves into real deployment scenarios.

More episodes

← Home