MEDIUM 5.0

CVE-2026-54786: Wasmtime File Descriptor Leak in fd_renumber Function

Wasmtime, a WebAssembly runtime, contains a resource leak in its implementation of the WASIp1 file descriptor renumbering function (fd_renumber). When a WebAssembly guest program renumbers a file descriptor, Wasmtime updates its internal descriptor table but fails to clean up the corresponding entry in the host operating system's file descriptor table. This leaves orphaned file descriptors and other resources that accumulate in the host until the entire Wasmtime Store is destroyed. An attacker with the ability to execute WebAssembly code and access file descriptors can deliberately call fd_renumber in a loop to exhaust the host's file descriptor pool and memory, causing a denial of service. The vulnerability requires authenticated access (file descriptor capability) and affects only runtimes that expose both fd_renumber and file access to guest modules.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.0 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L
Weaknesses (CWE)
CWE-400, CWE-772
Affected products
1 configuration(s)
Published / Modified
2026-07-01 / 2026-07-02

NVD description (verbatim)

Wasmtime is a runtime for WebAssembly. All versions prior to 24.0.10; versions 25.0.0 through those before 36.0.11; versions 37.0.0 through those before 44.0.3; and versions 45.0.0 and 45.0.1 contain a native implementation of WASIp1 which suffers from a leak in the fd_renumber function where the file descriptor being renumbered to is not properly closed. Wasmtime's implementation erroneously only updated the table of descriptors for WASIp1 and didn't update the underlying table of descriptors used by the host. This behavior means that while fd_renumber works correctly from a guest's perspective it ends up leaking resources in the host that aren't cleaned up until the corresponding Store is destroyed. In a loop, guests can use fd_renumber to cause hosts to exhaust both resources and file descriptors. This bug only affects the native implementation of WASIp1, meaning that only runtimes which load core wasm modules and expose fd_renumber are affected. Runtimes are additionally only affected if they expose the ability to acquire a file descriptor, such as opening a file. For runtimes that deny access to files they are unaffected. This issue has been fixed in versions 24.0.10, 36.0.11, 44.0.3, and 45.0.2.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in Wasmtime's native implementation of WASIp1 (WebAssembly System Interface preview 1). The fd_renumber function is designed to reassign a file descriptor from one number to another, similar to the POSIX dup2 system call. Wasmtime's implementation updates the WASIp1-level descriptor table but does not close the original file descriptor in the host's operating system file table. This asymmetry causes the host to retain open file descriptors even though the guest perceives the renumbering as successful. Over multiple invocations in a loop, this leads to file descriptor table exhaustion and resource depletion on the host. The bug is confined to the native WASIp1 implementation and does not affect other WASI backends or interpreters that do not expose fd_renumber. Affected versions include all releases prior to 24.0.10, versions 25.0.0–36.0.10, versions 37.0.0–44.0.2, and versions 45.0.0–45.0.1.

Business impact

For organizations running Wasmtime as a service or embedding it in multi-tenant environments, this vulnerability enables guest WebAssembly modules to degrade or crash the host through resource exhaustion. In SaaS platforms or containerized deployments running untrusted WASM code, a malicious or compromised module can starve the host system of file descriptors, potentially affecting other guests or services. The impact is limited to availability (denial of service) with no confidentiality or integrity implications. Organizations that carefully restrict file access to WebAssembly guests or run only trusted code face reduced risk. The leakage is also gradual—each call to fd_renumber leaks resources over time rather than causing immediate failure—which may mask the attack until critical thresholds are reached.

Affected systems

The vulnerability affects Wasmtime versions: prior to 24.0.10; versions 25.0.0 through 36.0.10; versions 37.0.0 through 44.0.2; and versions 45.0.0 and 45.0.1. Only runtimes that (1) expose the native WASIp1 implementation, (2) allow WebAssembly modules to call fd_renumber, and (3) permit guest modules to open or access file descriptors are affected. Runtimes that deny file access to guests, use alternative WASI implementations, or disable fd_renumber are not vulnerable. Any embedded application, container runtime, or serverless platform using the affected Wasmtime versions with permissive file descriptor policies is at risk.

Exploitability

Exploitation requires authenticated access—the attacker must be able to load and execute WebAssembly code within the Wasmtime runtime and must have permission to acquire file descriptors. The attack is trivial to execute: a simple loop calling fd_renumber with valid file descriptors will exhaust host resources. No complex exploit chains, race conditions, or memory corruption techniques are needed. The barrier to exploitation is primarily administrative: preventing untrusted code execution or restricting file descriptor access mitigates the risk. The CVSS score of 5.0 (Medium) reflects the need for prior authentication and the availability-only impact; however, in multi-tenant or service environments where guest code execution is the business model, the practical risk is higher.

Remediation

Upgrade Wasmtime to patched versions: 24.0.10 or later (for the 24.x series), 36.0.11 or later (for 25.x–36.x), 44.0.3 or later (for 37.x–44.x), or 45.0.2 or later (for 45.x). The patches correct the fd_renumber function to properly close the old file descriptor in the host's file table. Verify the exact patch versions against official Bytecode Alliance release notes. Organizations unable to patch immediately should restrict file descriptor access for guest modules or disable fd_renumber if operationally feasible.

Patch guidance

Update Wasmtime to the earliest patched version in your release series: 24.0.10, 36.0.11, 44.0.3, or 45.0.2. Consult the Bytecode Alliance release notes and migration guides for each version to ensure no breaking changes affect your deployment. Test patches in a staging environment before rolling out to production, particularly if you rely on fd_renumber functionality. After patching, monitor for any performance improvements in file descriptor usage and verify that guest modules continue to function as expected.

Detection guidance

Monitor the host system's file descriptor count (via /proc/sys/fs/file-nr on Linux or lsof commands) during Wasmtime workload execution. A steady increase in open file descriptors that does not correlate with legitimate guest activity may indicate exploitation. Implement resource limits per Wasmtime Store or container (ulimit, cgroups) to cap file descriptor usage and prevent system-wide exhaustion. Log fd_renumber calls if instrumentation is available, and alert on unusually high call frequencies from individual guests. Correlate file descriptor leaks with guest module execution patterns to identify suspicious behavior.

Why prioritize this

This vulnerability merits prompt patching due to its simplicity of exploitation and the common multi-tenant deployment model of WebAssembly runtimes. However, the Medium CVSS score and the requirement for authenticated access and file descriptor permissions limit its absolute priority compared to unauthenticated remote code execution vulnerabilities. Prioritize patching if you (1) run Wasmtime in a multi-tenant environment, (2) execute untrusted guest code, or (3) grant file access to guests. Organizations with strict file descriptor policies or running only trusted code may defer patching with appropriate risk acceptance. The gradual nature of the leak allows time for planned updates rather than emergency response.

Risk score, explained

The CVSS 3.1 score of 5.0 (Medium) is driven by: Attack Vector = Network (the vulnerability is reachable over the network if Wasmtime is exposed), Attack Complexity = Low (trivial to exploit), Privileges Required = Low (authenticated access needed), User Interaction = None, Scope = Changed (the impact extends beyond the vulnerable component to the host system), Confidentiality = None, Integrity = None, and Availability = Low (denial of service through resource exhaustion). The score accurately reflects that this is a moderate, availability-focused issue requiring prior access. In threat modeling, organizations should consider elevation of risk if they operate multi-tenant WASM environments or run untrusted code.

Frequently asked questions

Does this vulnerability affect all Wasmtime users?

No. Only users who (1) run vulnerable Wasmtime versions, (2) enable or expose the native WASIp1 implementation, (3) allow guest modules to call fd_renumber, and (4) permit file descriptor access are affected. Organizations that restrict file access to guests or use alternative WASI backends are not vulnerable. This is why patch versions and the security model of your deployment matter.

What happens if a guest exhausts file descriptors via fd_renumber?

The host's file descriptor table becomes saturated, preventing legitimate system calls from acquiring new descriptors. This degrades or halts other services sharing the host, including other Wasmtime Stores and the runtime itself. The impact is denial of service. No code execution, data exfiltration, or privilege escalation is possible via this vulnerability alone.

Is there a workaround if I cannot patch immediately?

Yes. Implement resource limits on Wasmtime processes or containers using OS-level mechanisms (Linux cgroups, ulimit, systemd resource controls). Additionally, audit your guest modules to verify which ones truly require file descriptor access, and restrict that capability where possible. Disable fd_renumber in your WASIp1 configuration if your workloads do not require it. These mitigations reduce attack surface while you prepare to patch.

How do I know if my deployment has been exploited?

Look for unexplained spikes in open file descriptor counts on the host system (use lsof or /proc/sys/fs/file-nr on Linux). Check system logs and Wasmtime instrumentation for repeated fd_renumber calls or resource exhaustion warnings. If a guest module is crashing the host or degrading performance without an obvious reason, investigate file descriptor usage patterns. Performance profiling before and after patching will also reveal resource leaks.

This analysis is provided for educational and remediation planning purposes. All vulnerability details, affected versions, and patch information are based on official Bytecode Alliance disclosures. Organizations are responsible for assessing the applicability of this vulnerability to their specific Wasmtime deployments and testing all patches before production deployment. No warranty is offered regarding the completeness or accuracy of this analysis. For authoritative guidance, consult the official Bytecode Alliance security advisory and release notes. Source: NVD (public-domain), retrieved 2026-08-10. Analysis generated by SEC.co (claude-haiku-4-5).