Critical Heap-Based Buffer Overflow in MicroPython - CVE-2024-8948

micropython Updated 02 Oct 2025

Summary

17/09/2024
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2024-8948: A vulnerability was found in MicroPython 1.23.0. Affects micropython versions < 1.24.0+ds-1. Fixed in 1.24.0+ds-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

MicroPython is a lean implementation of Python 3 designed for microcontrollers and embedded systems. It allows developers to write Python code to control hardware components, making it a popular choice for IoT projects. The package is lightweight and optimized for performance, but it has been found to have a critical vulnerability that could be exploited remotely.

Vulnerability Detail

A critical vulnerability has been identified in MicroPython version 1.23.0, specifically in the function mpz_as_bytes located in the file py/objint.c. This vulnerability allows for a heap-based buffer overflow, which can be exploited remotely. The issue arises when converting zero from int to bytes, leading to potential unauthorized memory access and manipulation. The exploit has been publicly disclosed, making it imperative for users to address this vulnerability promptly.

How To Fix

Minimum fixed version

1.24.0+ds-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade micropython

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can avoid using the affected function mpz_as_bytes until the package is updated. However, this is not a permanent solution and updating the package is strongly recommended.

Conclusion

The vulnerability CVE-2024-8948 in MicroPython poses a significant risk due to its potential for remote exploitation. Users are strongly advised to update to the patched version 1.24.0+ds-1 to mitigate this risk. Monitoring tools like Vulert can assist in keeping track of such vulnerabilities in the future.

See every vulnerability recorded for micropython →

Share this vulnerability

FAQ

CVE-2024-8948 is a critical vulnerability in MicroPython that allows for a heap-based buffer overflow, potentially leading to unauthorized memory access.

If you are using MicroPython version 1.23.0, you are affected by this vulnerability. Check your version using 'micropython --version'.

Not fixing this vulnerability could allow attackers to exploit the buffer overflow, potentially leading to remote code execution or system compromise.

Yes, tools like Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software without requiring code access.

More information can be found in the official CVE database or by visiting the vulnerability report at https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2024-8948.json.

Related vulnerabilities

Recent vulnerabilities recorded for micropython.

How To Fix

Minimum fixed version

1.24.0+ds-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade micropython

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback