Skip to content

GHSA-f984-pcp8-v2p7 CVE-2026-35186 RUSTSEC-2026-0094

Wasmtime has improperly masked return value from `table.grow` with Winch compiler backend

High crates.io
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.21%
Chance of exploitation in the next 30 days. Higher than 11.68% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-789 Memory Allocation with Excessive Size Value
Fix
36.0.7
Upgrade wasmtime to this version or later

Description

Impact

Wasmtime's Winch compiler backend contains a bug where translating the table.grow operator causes the result to be incorrectly typed. For 32-bit tables this means that the result of the operator, internally in Winch, is tagged as a 64-bit value instead of a 32-bit value. This invalid internal representation of Winch's compiler state compounds into further issues depending on how the value is consumed.

One example can be seen when the result of table.grow is used as the address of a load operation. The load operation is tricked into thinking the address is a 64-bit value, not a 32-bit value, which means that the final address to load from is calculated incorrectly. This can lead to a situation where the bytes before the start of linear memory can be loaded/stored to.

The primary consequence of this bug is that bytes in the host's address space can be stored/read from. This is only applicable to the 16 bytes before linear memory, however, as the only significant return value of table.grow that can be misinterpreted is -1. The bytes before linear memory are, by default, unmapped memory. Wasmtime will detect this fault and abort the process, however, because wasm should not be able to access these bytes.

Overall this this bug in Winch represents a DoS vector by crashing the host process, a correctness issue within Winch, and a possible leak of up to 16-bytes before linear memory. Wasmtime's default compiler is Cranelift, not Winch, and Wasmtime's default settings are to place guard pages before linear memory. This means that Wasmtime's default configuration is not affected by this issue, and when explicitly choosing Winch Wasmtime's otherwise default configuration leads to a DoS. Disabling guard pages before linear memory is required to possibly leak up to 16-bytes of host data.

Patches

Wasmtime 43.0.1, 42.0.2, and 36.0.7 have been released with fixes for this issue.

Workaround

There are no workarounds within the Winch compiler backend while using the affected versions. Users of Wasmtime are encouraged either to upgrade to patched versions or, if that is not possible, use the Cranelift compiler backend.

Affected versions

crates.io

PackageVulnerableFixed in
wasmtime
>= 25.0.0, < 36.0.7
36.0.7
wasmtime
>= 37.0.0, < 42.0.2
42.0.2
wasmtime
>= 43.0.0, < 43.0.1
43.0.1
wasmtime
>= 0.0.0-0, < 36.0.7
>= 37.0.0, < 42.0.2
>= 43.0.0, < 43.0.1
36.0.7
42.0.2
43.0.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

wasmtime crates.io → 36.0.7

cargo
cargo update -p wasmtime --precise 36.0.7

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
High
Attack requirements
Present
Privileges required
Low
User interaction
None
Confidentiality (vulnerable system)
Low
Integrity (vulnerable system)
Low
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-789: Memory Allocation with Excessive Size Value

The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.

How to prevent it
  • Implementation, Architecture and Design: Perform adequate input validation against any value that influences the amount of memory that is allocated. Define an appropriate strategy for handling requests that exceed the limit, and consider supporting a configuration option so that the administrator can extend the amount of memory to be used if necessary.
  • Operation: Run your program using system-provided resource limits for memory. This might still cause the program to crash or exit, but the impact to the rest of the system will be minimized.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
RUSTSEC-2026-0424
Unchecked memory usage in transferring borrowed resources between components
Not rated yet Also affects wasmtime
RUSTSEC-2026-0423
Cross-engine type confusion with host-created struct-types-with-supertypes
Not rated yet Also affects wasmtime
RUSTSEC-2026-0422
Typed functions with `i31` or `nullref` arguments may panic due to insufficient type-check
Low Also affects wasmtime
RUSTSEC-2026-0379
Wasmtime: Cranelift backend on aarch64 can jump to incorrect target on large Wasm `br_table` instruction
Critical Also affects wasmtime
GHSA-9pvw-hwfg-92h5
Wasmtime: Panic lowering a host-created component model stream into a guest that expects a different payload type
Medium Also affects wasmtime
GHSA-897f-g5gm-fmxm
Wasmtime: Bit-packing in Cranelift compiler causes silent overflow and miscompilation
Critical Also affects wasmtime
RUSTSEC-2026-0364
Exception tags can cause host data structures to be unaligned
Not rated yet Also affects wasmtime
RUSTSEC-2026-0363
Component-model handle tables are capped only per instance and charged to no limit
Medium Also affects wasmtime
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor