QID 356246

Date Published: 2023-09-28

QID 356246: Amazon Linux Security Advisory for ecs-service-connect-agent : ALASECS-2023-007

wasmtime is a standalone runtime for webassembly.
Prior to versions 6.0.2, 7.0.1, and 8.0.1, wasmtimes implementation of managing per-instance state, such as tables and memories, contains llvm-level undefined behavior.
This undefined behavior was found to cause runtime-level issues when compiled with llvm 16 which causes some writes, which are critical for correctness, to be optimized away.
Vulnerable versions of wasmtime compiled with rust 1.70, which is currently in beta, or later are known to have incorrectly compiled functions.
Versions of wasmtime compiled with the current rust stable release, 1.69, and prior are not known at this time to have any issues, but can theoretically exhibit potential issues. the underlying problem is that wasmtimes runtime state for an instance involves a rust-defined structure called `instance` which has a trailing `vmcontext` structure after it.
This `vmcontext` structure has a runtime-defined layout that is unique per-module.
This representation cannot be expressed with safe code in rust so `unsafe` code is required to maintain this state.
The code doing this, however, has methods which take `&self` as an argument but modify data in the `vmcontext` part of the allocation.
This means that pointers derived from `&self` are mutated.
This is typically not allowed, except in the presence of `unsafecell`, in rust.
When compiled to llvm these functions have `noalias readonly` parameters which means its ub to write through the pointers. wasmtimes internal representation and management of `vmcontext` has been updated to use `&mut self` methods where appropriate.
As a workaround, disable grpc access log or stop listener update. (

Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.

Successful exploitation of this vulnerability could lead to a securitybreach or could affect integrity, availability, and confidentiality.

  • CVSS V3 rated as Critical - 9.8 severity.
  • CVSS V2 rated as Medium - 5.4 severity.
  • Solution
    Please refer to Amazon advisory: ALASECS-2023-007 for affected packages and patching details, or update with your package manager.
    Vendor References
    Software Advisories
    Advisory ID Software Component Link
    ALASECS-2023-007 amazon linux 2 URL Logo alas.aws.amazon.com/AL2/ALASECS-2023-007.html