{"id":"CVE-2021-43790","aliases":["EUVD-2021-2355","GHSA-hf79-8hjp-rrvq","RUSTSEC-2021-0155"],"status":"published","title":"Use After Free in lucet","description":"Lucet is a native WebAssembly compiler and runtime. There is a bug in the main branch of `lucet-runtime` affecting all versions published to crates.io 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. Users should upgrade to the main branch of the Lucet repository. Lucet no longer provides versioned releases on crates.io. There is no way to remediate this vulnerability without upgrading.","severity":{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01617,"percentile":0.76353,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-416"],"published":"2021-11-29T23:55:10Z","modified":"2026-10-20T10:55:03Z","affected":[{"source":"ghsa","ecosystem":"crates.io","package":"lucet-runtime","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.6.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"lucet-runtime","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.6.1"}]}]},{"source":"osv","ecosystem":"crates.io","package":"lucet-runtime","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}]}],"products":[{"vendor":"bytecodealliance","product":"lucet"}],"references":[{"url":"https://github.com/bytecodealliance/lucet/security/advisories/GHSA-hf79-8hjp-rrvq","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://github.com/bytecodealliance/lucet/commit/7c7757c772fb709c61b1442bcc1e1fbee97bf4a8","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://crates.io/crates/lucet-runtime","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","advisory","web","package"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-43790","tags":["advisory"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2021-0155.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-hf79-8hjp-rrvq"},{"url":"https://github.com/bytecodealliance/lucet","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-43790","title":"Use After Free in lucet","description":"Lucet is a native WebAssembly compiler and runtime. There is a bug in the main branch of `lucet-runtime` affecting all versions published to crates.io 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. Users should upgrade to the main branch of the Lucet repository. Lucet no longer provides versioned releases on crates.io. There is no way to remediate this vulnerability without upgrading.","status":"published","published":"2021-11-29T23:55:10Z","modified":"2024-08-04T04:03:08.681Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:32:56.689433Z"}],"euvd":[{"id":"EUVD-2021-2355","description":"Lucet is a native WebAssembly compiler and runtime. There is a bug in the main branch of `lucet-runtime` affecting all versions published to crates.io 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. Users should upgrade to the main branch of the Lucet repository. Lucet no longer provides versioned releases on crates.io. There is no way to remediate this vulnerability without upgrading.","status":"published","published":"2021-11-29T23:55:10Z","modified":"2024-08-04T04:03:08Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-03T03:24:13.772922Z"}],"ghsa":[{"id":"GHSA-hf79-8hjp-rrvq","title":"Use After Free in lucet","description":"### Impact\nThere 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.\n\n### Patches\nUsers should upgrade to the `main` branch of the Lucet repository. Lucet does not provide versioned releases on crates.io.\n\n### Workarounds\nThere is no way to remediate this vulnerability without upgrading.\n\n### Description\nLucet 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.\n\nWhen 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.\n\nThe bug was corrected by changing how the `InstanceHandle` destructor operates to ensure that the memory backing an Instance is only returned to the pool once the `Instance` has been completely destroyed.\n\nThis security advisory has been assigned CVE-2021-43790.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [lucet repository](https://github.com/bytecodealliance/lucet)\n* Email [the lucet team](mailto:lucet@fastly.com)\n* See the [Bytecode Alliance security policy](https://bytecodealliance.org/security)","status":"published","published":"2021-11-30T22:20:36Z","modified":"2026-01-20T19:01:17Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:39:18.564331Z"}],"nvd":[{"id":"CVE-2021-43790","description":"Lucet is a native WebAssembly compiler and runtime. There is a bug in the main branch of `lucet-runtime` affecting all versions published to crates.io 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. Users should upgrade to the main branch of the Lucet repository. Lucet no longer provides versioned releases on crates.io. There is no way to remediate this vulnerability without upgrading.","status":"published","published":"2021-11-30T00:15:07.357Z","modified":"2026-06-17T04:11:26.707Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T14:07:01.811115Z"}],"osv":[{"id":"CVE-2021-43790","description":"Lucet is a native WebAssembly compiler and runtime. There is a bug in the main branch of `lucet-runtime` affecting all versions published to crates.io 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. Users should upgrade to the main branch of the Lucet repository. Lucet no longer provides versioned releases on crates.io. There is no way to remediate this vulnerability without upgrading.","status":"published","published":"2021-11-30T00:15:07.357Z","modified":"2026-10-20T10:55:03.872578344Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:44:21.877444Z"},{"id":"GHSA-hf79-8hjp-rrvq","title":"Use After Free in lucet","description":"### Impact\nThere 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.\n\n### Patches\nUsers should upgrade to the `main` branch of the Lucet repository. Lucet does not provide versioned releases on crates.io.\n\n### Workarounds\nThere is no way to remediate this vulnerability without upgrading.\n\n### Description\nLucet 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.\n\nWhen 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.\n\nThe bug was corrected by changing how the `InstanceHandle` destructor operates to ensure that the memory backing an Instance is only returned to the pool once the `Instance` has been completely destroyed.\n\nThis security advisory has been assigned CVE-2021-43790.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [lucet repository](https://github.com/bytecodealliance/lucet)\n* Email [the lucet team](mailto:lucet@fastly.com)\n* See the [Bytecode Alliance security policy](https://bytecodealliance.org/security)","status":"published","published":"2021-11-30T22:20:36Z","modified":"2026-07-08T06:29:00.32492352Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-416"],"updated_at":"2026-11-02T15:46:48.920784Z"},{"id":"RUSTSEC-2021-0155","title":"Use After Free in lucet-runtime","description":"There is a bug in the main branch of Lucet's lucet-runtime\nthat allows a use-after-free in an Instance object that could\nresult in memory corruption, data race, or other related\nissues. This bug was introduced early in the development\nof Lucet and is present in all releases. As a result of\nthis bug, and dependent on the memory backing for the\nInstance objects, it is possible to trigger a\nuse-after-free when the Instance is dropped.\n\n## Patches\n\nUsers should upgrade to the main branch of the Lucet\nrepository. Lucet does not provide versioned releases on\ncrates.io.\n\n## Workarounds\n\nThere is no way to remediate this vulnerability without\nupgrading.\n\n## Description\n\nLucet uses a \"pool\" allocator for new WebAssembly\ninstances that are created. This pool allocator manages\neverything from the linear memory of the wasm instance,\nthe runtime stack for async switching, as well as the\nmemory behind the Instance itself. Instances are referred\nto via an InstanceHandle type which will, on drop,\nrelease the memory backing the Instance back to the pool.\n\nWhen an Instance is dropped, the fields of the Instance\nare destructed top-to-bottom, however when the alloc:\nAlloc field is destructed, the memory backing the\nInstance is released back to the pool before the\ndestructors of the remaining fields are run. If another\nthread allocates the same memory from the pool while\nthese destructors are still running, a race condition\noccurs that can lead to use-after-free errors.\n\nThe bug was corrected by changing how the InstanceHandle\ndestructor operates to ensure that the memory backing an\nInstance is only returned to the pool once the Instance\nhas been completely destroyed.","status":"published","published":"2021-11-30T12:00:00Z","modified":"2026-10-12T18:00:04.412539855Z","cvss":[{"version":"3.1","score":8.5,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:53:39.971022Z"}]}}
