# CVE-2024-47763: Wasmtime runtime crash when combining tail calls with trapping imports

> A malicious WebAssembly module can crash the Wasmtime runtime by exploiting a stack-walking error during tail calls, causing a denial of service.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Oct 2024
- **Updated:** 9 Oct 2024
- **Also known as:** DEBIAN-CVE-2024-47763, GHSA-q8hx-mm92-4wvg, PYSEC-2024-312, RUSTSEC-2024-0440, UBUNTU-CVE-2024-47763

## What is CVE-2024-47763?

CVE-2024-47763 is a medium-severity denial of service vulnerability in bytecodealliance wasmtime, published on 9 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Wasmtime is an open source runtime for WebAssembly. Wasmtime's implementation of WebAssembly tail calls combined with stack traces can result in a runtime crash in certain WebAssembly modules. The runtime crash may be undefined behavior if Wasmtime was compiled with Rust 1.80 or prior. The runtime crash is a deterministic process abort when Wasmtime is compiled with Rust 1.81 and later. WebAssembly tail calls are a proposal which relatively recently reached stage 4 in the standardization process. Wasmtime first enabled support for tail calls by default in Wasmtime 21.0.0, although that release contained a bug where it was only on-by-default for some configurations. In Wasmtime 22.0.0 tail calls were enabled by default for all configurations. The specific crash happens when an exported function in a WebAssembly module (or component) performs a `return_call` (or `return_call_indirect` or `return_call_ref`) to an imported host function which captures a stack trace (for example, the host function raises a trap). In this situation, the stack-walking code previously assumed there was always at least one WebAssembly frame on the stack but with tail calls that is no longer true. With the tail-call proposal it's possible to have an entry trampoline appear as if it directly called the exit trampoline. This situation triggers an internal assert in the stack-walking code which raises a Rust `panic!()`. When Wasmtime is compiled with Rust versions 1.80 and prior this means that an `extern "C"` function in Rust is raising a `panic!()`. This is technically undefined behavior and typically manifests as a process abort when the unwinder fails to unwind Cranelift-generated frames. When Wasmtime is compiled with Rust versions 1.81 and later this panic becomes a deterministic process abort. Overall the impact of this issue is that this is a denial-of-service vector where a malicious WebAssembly module or component can cause the host to crash. There is no other impact at this time other than availability of a service as the result of the crash is always a crash and no more. This issue was discovered by routine fuzzing performed by the Wasmtime project via Google's OSS-Fuzz infrastructure. We have no evidence that it has ever been exploited by an attacker in the wild. All versions of Wasmtime which have tail calls enabled by default have been patched: * 21.0.x - patched in 21.0.2 * 22.0.x - patched in 22.0.1 * 23.0.x - patched in 23.0.3  * 24.0.x - patched in 24.0.1 * 25.0.x - patched in 25.0.2. Wasmtime versions from 12.0.x (the first release with experimental tail call support) to 20.0.x (the last release with tail-calls off-by-default) have support for tail calls but the support is disabled by default. These versions are not affected in their default configurations, but users who explicitly enabled tail call support will need to either disable tail call support or upgrade to a patched version of Wasmtime. The main workaround for this issue is to disable tail support for tail calls in Wasmtime, for example with `Config::wasm_tail_call(false)`. Users are otherwise encouraged to upgrade to patched versions.

Weakness: CWE-670 (Always-Incorrect Control Flow Implementation)

## Which versions are affected by CVE-2024-47763?

12 open source packages ship an affected version, including wasmtime and wasmtime-bin. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `wasmtime` | crates.io | From 12.0.0 | 21.0.2 |
| `wasmtime` | crates.io | From 12.0.0 | 21.0.2 |
| `wasmtime` | crates.io | From 21.0.0 | 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2 |
| `wasmtime` | crates.io | From 22.0.0 | 22.0.1 |
| `wasmtime` | crates.io | From 22.0.0 | 22.0.1 |
| `wasmtime` | crates.io | From 23.0.0 | 23.0.3 |
| `wasmtime` | crates.io | From 23.0.0 | 23.0.3 |
| `wasmtime` | crates.io | From 24.0.0 | 24.0.1 |
| `wasmtime` | crates.io | From 24.0.0 | 24.0.1 |
| `wasmtime` | crates.io | From 25.0.0 | 25.0.2 |
| `wasmtime` | crates.io | From 25.0.0 | 25.0.2 |
| `wasmtime-bin` | PyPI | All versions to 21.0.0 | None |

Products: Bytecodealliance Wasmtime.

## How do I fix CVE-2024-47763?

Upgrade wasmtime to a fixed version for your release line: 21.0.2, 22.0.1, 23.0.3 or 24.0.1.

## Is CVE-2024-47763 being exploited?

There is no known exploitation of CVE-2024-47763 in the wild and no public exploit code.

## Other vulnerabilities in bytecodealliance wasmtime

- [CVE-2026-34971](https://insights.sbomify.com/CVE-2026-34971/): Wasmtime miscompiled guest heap access enables sandbox escape on aarch64 Cranelift (critical 9.0)
- [CVE-2026-34987](https://insights.sbomify.com/CVE-2026-34987/): Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access (critical 9.0)
- [CVE-2022-39393](https://insights.sbomify.com/CVE-2022-39393/): Wasmtime vulnerable to data leakage between instances in the pooling allocator (high 8.6)
- [CVE-2022-24791](https://insights.sbomify.com/CVE-2022-24791/): Use after free in Wasmtime (high 8.1)
- [CVE-2026-47261](https://insights.sbomify.com/CVE-2026-47261/): Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-47763 and fix it if it is affected.

What it is: CVE-2024-47763 is a medium-severity denial of service vulnerability in bytecodealliance wasmtime, published on 9 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-47763 in the wild and no public exploit code.

Affected packages and fixed versions:
- wasmtime (crates.io): affected from 12.0.0; fixed in 21.0.2
- wasmtime (crates.io): affected from 12.0.0; fixed in 21.0.2
- wasmtime (crates.io): affected from 21.0.0; fixed in 21.0.2, 22.0.1, 23.0.3, 24.0.1, 25.0.2
- wasmtime (crates.io): affected from 22.0.0; fixed in 22.0.1
- wasmtime (crates.io): affected from 22.0.0; fixed in 22.0.1
- wasmtime (crates.io): affected from 23.0.0; fixed in 23.0.3
- wasmtime (crates.io): affected from 23.0.0; fixed in 23.0.3
- wasmtime (crates.io): affected from 24.0.0; fixed in 24.0.1
- wasmtime (crates.io): affected from 24.0.0; fixed in 24.0.1
- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.2
- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.2
- wasmtime-bin (PyPI): affected all versions up to 21.0.0; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-47763/ (Markdown: https://insights.sbomify.com/CVE-2024-47763/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-47763
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-47763
- OSV: https://osv.dev/vulnerability/CVE-2024-47763

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-47763/
Summaries are generated and may contain mistakes; the official description above is the record.
