MicroPython objint.c mpz_as_bytes heap-based overflow
MicroPython
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| micropython-copy PyPI |
| No fix yet |
| micropython-io PyPI |
| No fix yet |
| micropython-os PyPI |
MicroPython
| Product | Affected | Fixed in |
|---|---|---|
| micropython-copy PyPI |
| No fix yet |
| micropython-io PyPI |
| No fix yet |
| micropython-os PyPI |
≤ 0.8all versions| No fix yet |
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.
From the CVE record · VulDB
In MicroPython 1.23.0, converting zero from an integer to bytes can cause a heap buffer overflow in mpz_as_bytes. An attacker may be able to trigger the issue remotely; the input does not specify authentication or user-interaction requirements.
Teams running MicroPython 1.23.0 or using PyPI micropython-copy (through 3.3.3.post3), micropython-io (through 0.1), or micropython-os (through 0.8) should check their exposure.