Skip to main content
Vulnerability Database/CVE-2026-47218

CVE-2026-47218: runwasi containerd-shim RCE Vulnerability

CVE-2026-47218 is a remote code execution vulnerability in runwasi that allows attackers to bypass WebAssembly validation and execute native code in containerd-shim-wasmtime. This article covers technical details, affected versions, security impact, and available patches.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-47218 Overview

CVE-2026-47218 is a critical insecure deserialization flaw [CWE-502] in runwasi, a project that enables running WebAssembly (Wasm) and WebAssembly System Interface (WASI) workloads under containerd. Prior to version 0.6.1, containerd-shim-wasmtime-v1 treats Wasmtime precompiled bytes supplied directly in an Open Container Initiative (OCI) image layer as a trusted artifact from the precompile-cache path. The shim deserializes those bytes as native code, bypassing WebAssembly validation. An attacker who tricks a victim into running a crafted image executes native code inside the shim zygote process with the workload container's filesystem, environment, credentials, networking, and Linux syscall access.

Critical Impact

A malicious OCI image can escape the WASI sandbox and execute attacker-controlled native code in the shim process, inheriting the workload container's full privilege set.

Affected Products

  • containerd-shim-wasmtime-v1 versions prior to 0.6.1
  • runwasicontainerd-shim-wasm precompile-cache API consumers
  • Downstream shims implementing Compiler that trust executable precompiled artifacts from OCI layers

Discovery Timeline

  • 2026-10-15 - CVE-2026-47218 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-47218

Vulnerability Analysis

The flaw resides in how containerd-shim-wasmtime loads layer content from OCI images. The shim distinguishes between raw Wasm modules that must pass validation and precompiled Wasmtime artifacts retrieved from a trusted precompile cache. The vulnerable code path does not reliably track provenance, so bytes shipped directly inside an OCI layer are indistinguishable from cache-origin artifacts. When Wasmtime deserializes those bytes, it treats them as validated native machine code and maps them for execution.

The outcome escapes the WASI sandbox to the workload container boundary. It does not by itself cross container isolation or deliver direct host code execution, but it grants the attacker everything the container holds: mounted filesystems, environment variables, service account credentials, network reachability, and the Linux syscalls permitted by the container runtime policy.

Root Cause

The root cause is a missing trust label on the WasmLayer structure. Layer bytes carry no field indicating whether they originated from the precompile cache or from an attacker-controlled image layer. The fix in commit d28ab73c2c8a6c50d1927078821bd418b9e51638 adds an explicit precompiled: bool field so the shim can refuse native deserialization of untrusted inputs.

Attack Vector

An attacker publishes or substitutes an OCI image containing a crafted layer that mimics a precompiled Wasmtime artifact. When the victim pulls and runs the image under a vulnerable shim, the shim calls Wasmtime's deserialization routine on the attacker bytes, bypasses Wasm validation, and executes native code in the shim zygote.

rust
// Patch: crates/containerd-shim-wasm/src/sandbox/context.rs
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct WasmLayer {
    pub config: Descriptor,
+   pub precompiled: bool,
    #[serde(with = "serde_bytes")]
    pub layer: Vec<u8>,
}

// Patch: crates/containerd-shim-wasm/src/containerd/client.rs
layers_for_runtime.push(WasmLayer {
    config: original_config.clone(),
    layer: compiled_layer.clone(),
+   precompiled: true,
});
let _ = precompiled_content.lease.release().await;

Source: runwasi commit d28ab73. The patch tags cache-origin layers with precompiled: true so attacker-supplied layers default to untrusted and are rejected from the native deserialization path.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-47218

Indicators of Compromise

  • OCI image layers whose media type or digest matches Wasmtime precompiled artifacts but originate from untrusted registries
  • Unexpected containerd-shim-wasmtime-v1 child processes performing filesystem, network, or syscall activity unrelated to the declared Wasm workload
  • Egress connections from Wasm workload containers to attacker-controlled hosts following image pulls

Detection Strategies

  • Inventory runwasi and containerd-shim-wasmtime versions across Kubernetes nodes and flag any build below 0.6.1
  • Audit OCI image sources permitted by admission controllers and alert on images delivering Wasmtime precompile layer media types from untrusted registries
  • Correlate shim process behavior against the expected WASI syscall surface and flag deviations such as execve, raw sockets, or filesystem writes outside the workload rootfs

Monitoring Recommendations

  • Enable containerd and shim audit logging and forward events for centralized analysis
  • Monitor runtime telemetry on nodes running Wasm workloads, including process lineage and syscall traces
  • Track registry pulls and image signature verification outcomes for Wasm workload images

How to Mitigate CVE-2026-47218

Immediate Actions Required

  • Upgrade containerd-shim-wasmtime to version 0.6.1 or later on every node running Wasm workloads
  • Rebuild and redeploy downstream shims that use the containerd-shim-wasm precompile-cache API and implement Compiler
  • Restrict Wasm workload execution to signed images sourced from trusted registries until upgrades are complete

Patch Information

The fix ships in runwasi containerd-shim-wasmtime v0.6.1. Technical details are documented in GitHub Security Advisory GHSA-cc25-vq59-rcjx. The 0.6.1 boundary applies to containerd-shim-wasmtime only and does not certify downstream distributions, which must publish their own fixed releases.

Workarounds

  • Block OCI layers advertising Wasmtime precompiled media types at the registry or admission controller level
  • Pin Wasm workloads to known-good image digests and enforce image signing with Sigstore or equivalent
  • Apply tight seccomp, AppArmor, or SELinux profiles to Wasm workload containers to reduce blast radius if native code executes
bash
# Verify installed shim version on each node
containerd-shim-wasmtime-v1 --version

# Example admission policy snippet: reject untrusted Wasm precompile layers
# (adapt to your policy engine of choice)
allowedRegistries:
  - registry.internal.example.com
rejectMediaTypes:
  - application/vnd.wasmtime.component.v1+precompiled

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.