Media

Wrong type for `Linker`-define functions when used across two `Engine`s

  • Publicada: 17.09.2021
  • Actualizado: 11.10.2026 13:19

Impact

As a Rust library the wasmtime crate clearly marks which functions are safe and which are unsafe, guaranteeing that if consumers never use unsafe then it should not be possible to have memory unsafety issues in their embeddings of Wasmtime. An issue was discovered in the safe API of Linker::func_* APIs. These APIs were previously not sound when one Engine was used to create the Linker and then a different Engine was used to create a Store and then the Linker was used to instantiate a module into that Store. Cross-Engine usage of functions is not supported in Wasmtime and this can result in type confusion of function pointers, resulting in being able to safely call a function with the wrong type.

Triggering this bug requires using at least two Engine values in an embedding and then additionally using two different values with a Linker (one at the creation time of the Linker and another when instantiating a module with the Linker).

It's expected that usage of more-than-one Engine in an embedding is relatively rare since an Engine is intended to be a globally shared resource, so the expectation is that the impact of this issue is relatively small.

The fix implemented is to change this behavior to panic!() in Rust instead of silently allowing it. Using different Engine instances with a Linker is a programmer bug that wasmtime catches at runtime.

Patches

This bug has been patched and users should upgrade to Wasmtime version 0.30.0.

Workarounds

If you cannot upgrade Wasmtime and are using more than one Engine in your embedding it's recommended to instead use only one Engine for the entire program if possible. An Engine is designed to be a globally shared resource that is suitable to have only one for the lifetime of an entire process. If using multiple Engines is required then code should be audited to ensure that Linker is only used with one Engine.

For more information

If you have any questions or comments about this advisory:

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) wasmtime < 0.30.0 0.30.0

Referencias

Puntuación CVSS 6.3/10
Vector CVSS
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:H
Debilidad (CWE)
CWE-125, CWE-590, CWE-787, CWE-416, CWE-843
Plataforma
Python (PyPI)
Paquete
wasmtime
Publicada
17.09.2021
Actualizado
11.10.2026 13:19

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2021-320 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-321 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-322 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-4873-36h9-wv49 - CC BY 4.0

OSV / GitHub Advisory Database - GHSA-v4cp-h94r-m7xf - CC BY 4.0

OSV / GitHub Advisory Database - GHSA-q879-9g95-56mx - CC BY 4.0

Historial de vulnerabilidades: wasmtime

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
5
Primera → última
05.2021 04.2026
Sin corrección
3
Explotada en ataques
0

Distribución por gravedad

  • Alta 1
  • Media 3
  • Baja 1

Divulgaciones por año

  1. 2021: 2
  2. 2022: 0
  3. 2023: 0
  4. 2024: 2
  5. 2025: 0
  6. 2026: 1
  1. Baja · 2.9 CVE-2024-47813 <= 19.0.0, <= 19.0.1, <= 19.0.2, <= 20.0.0, <= 20.0.1, <= 20.0.2, <= 21.0.0, <= 21.0.1, <= 22.0.0, <= 23.0.0, <= 23.0.1, <= 23.0.2, <= 24.0.0, <= 25.0.0, <= 25.0.1 sin corrección
  2. Wrong type for `Linker`-define functions when used across two `Engine`s esta entrada
    Media · 6.3 CVE-2021-39216 < 0.30.0 0.30.0
  3. Alta · 7.2 CVE-2021-32629 < 0.27.0 0.27.0

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.