CVE-2024-34252: wasm3 pywasm3 global buffer overflow in PreserveRegisterIfOccupied

CVE-2024-34252 · Severity: critical · CVSS 9.8 · Published 2024-05-06

pywasm3, a Python wrapper for the Wasm3 WebAssembly runtime, is vulnerable to a memory corruption issue. An attacker can provide a specially crafted WebAssembly file that causes the application to crash or potentially execute unauthorized code. This could lead to service disruptions or the compromise of data handled by the application.

Technologies: pywasm3 (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2024-34252 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-34252 being exploited in the wild.
How severe is CVE-2024-34252?
Critical severity, with a CVSS score of 9.8, published 6 May 2024.
Which products and versions are affected?
pywasm3 (PyPI) <= 0.5.0, ECOSYSTEM:introduced=0,last_affected=0.5.0.
Is there a fix for CVE-2024-34252?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2024-34252 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2024-34252?
Check whether you run pywasm3 (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A global buffer overflow exists in pywasm3 (and the underlying wasm3 runtime) version 0.5.0. The vulnerability is located in the 'PreserveRegisterIfOccupied' function within 'source/m3_compile.c'. It is triggered during the compilation phase of a WebAssembly module. An attacker can exploit this by providing a malicious .wasm file, leading to a buffer overflow that results in a segmentation fault (DoS) or potentially remote code execution. The issue stems from insufficient validation of input buffer sizes during the compilation of block statements. No patch is currently available for version 0.5.0.

Affected products

  • wasm3 pywasm3 <= 0.5.0

Identifiers

  • CVE-2024-34252
  • GHSA-hh39-vjv8-j337
  • PYSEC-2024-309

Timeline

  • 2024-05-06: advisory: GitHub Advisory GHSA-hh39-vjv8-j337 published
  • 2024-05-06: disclosed: NVD published CVE-2024-34252

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.