Use After Free in lucet-runtime
There is a bug in the main branch of Lucet's lucet-runtime that allows a use-after-free in an Instance object that could result in memory corruption, data race, or other related issues. This bug was introduced early in the development of Lucet and is present in all releases. As a result of this bug, and dependent on the memory backing for the Instance objects, it is possible to trigger a use-after-free when the Instance is dropped. ## Patches Users should upgrade to the main branch of the Lucet repository. Lucet does not provide versioned releases on crates.io. ## Workarounds There is no way to remediate this vulnerability without upgrading. ## Description Lucet uses a "pool" allocator for new WebAssembly instances that are created. This pool allocator manages everything from the linear memory of the wasm instance, the runtime stack for async switching, as well as the memory behind the Instance itself. Instances are referred to via an InstanceHandle type which will, on drop, release the memory backing the Instance back to the pool. When an Instance is dropped, the fields of the Instance are destructed top-to-bottom, however when the alloc: Alloc field is destructed, the memory backing the Instance is released back to the pool before the destructors of the remaining fields are run. If another thread allocates the same memory from the pool while these destructors are still running, a race condition occurs that can lead to use-after-free errors. The bug was corrected by changing
- Products
- lucet-runtime
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-43790
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:42 UTC · Revision 1
Source evidence
There is a bug in the main branch of Lucet's lucet-runtime that allows a use-after-free in an Instance object that could result in memory corruption, data race, or other related issues. This bug was introduced early in the development of Lucet and is present in all releases. As a result of this bug, and dependent on the memory backing for the Instance objects, it is possible to trigger a use-after-free when the Instance is dropped. ## Patches Users should upgrade to the main branch of the Lucet repository. Lucet does not provide versioned releases on crates.io. ## Workarounds There is no way to remediate this vulnerability without upgrading. ## Description Lucet uses a "pool" allocator for new WebAssembly instances that are created. This pool allocator manages everything from the linear memory of the wasm instance, the runtime stack for async switching, as well as the memory behind the Instance itself. Instances are referred to via an InstanceHandle type which will, on drop, release the memory backing the Instance back to the pool. When an Instance is dropped, the fields of the Instance are destructed top-to-bottom, however when the alloc: Alloc field is destructed, the memory backing the Instance is released back to the pool before the destructors of the remaining fields are run. If another thread allocates the same memory from the pool while these destructors are still running, a race condition occurs that can lead to use-after-free errors. The bug was corrected by changing
osv:RUSTSEC-2021-0155
lucet-runtime
Fixed versions: Not specified
Complete source record
{
"id": "7298a9678260eab508ba1a61cb82485524641af56e0d8bea200569cb32123bc2",
"url": "https://osv.dev/vulnerability/RUSTSEC-2021-0155",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Use After Free in lucet-runtime",
"summary": "There is a bug in the main branch of Lucet's lucet-runtime that allows a use-after-free in an Instance object that could result in memory corruption, data race, or other related issues. This bug was introduced early in the development of Lucet and is present in all releases. As a result of this bug, and dependent on the memory backing for the Instance objects, it is possible to trigger a use-after-free when the Instance is dropped. ## Patches Users should upgrade to the main branch of the Lucet repository. Lucet does not provide versioned releases on crates.io. ## Workarounds There is no way to remediate this vulnerability without upgrading. ## Description Lucet uses a \"pool\" allocator for new WebAssembly instances that are created. This pool allocator manages everything from the linear memory of the wasm instance, the runtime stack for async switching, as well as the memory behind the Instance itself. Instances are referred to via an InstanceHandle type which will, on drop, release the memory backing the Instance back to the pool. When an Instance is dropped, the fields of the Instance are destructed top-to-bottom, however when the alloc: Alloc field is destructed, the memory backing the Instance is released back to the pool before the destructors of the remaining fields are run. If another thread allocates the same memory from the pool while these destructors are still running, a race condition occurs that can lead to use-after-free errors. The bug was corrected by changing",
"evidence": "osv:RUSTSEC-2021-0155",
"products": [
{
"name": {
"value": "lucet-runtime",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "RUSTSEC-2021-0155",
"aliases": [
"CVE-2021-43790",
"GHSA-hf79-8hjp-rrvq",
"RUSTSEC-2021-0155"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
}
]
}
],
"package": {
"name": "lucet-runtime",
"purl": "pkg:cargo/lucet-runtime",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H",
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0155.json",
"categories": [],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:04.412539855Z",
"provider": "osv",
"references": [
"https://crates.io/crates/lucet-runtime",
"https://rustsec.org/advisories/RUSTSEC-2021-0155.html",
"https://github.com/bytecodealliance/lucet/commit/7c7757c772fb709c61b1442bcc1e1fbee97bf4a8"
],
"provider_metadata": {
"license": "CC-BY-4.0"
}
},
"related_cves": [
{
"value": "CVE-2021-43790",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 306340,
"published_at": "2021-11-30T12:00:00+00:00"
}