CVE-2024-8947
High · 8.1CVSS
8.1
EPSS
1.0%
Published
Sep 17, 2024
CISA due date
—
Cloudanix analysis
A flaw in the MicroPython programming language can let attackers remotely crash devices or run their own code on equipment that uses it, so updating to the newest version is required.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- High
- Impact
- Other
- Component
- Library
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free condition in py/objarray.c triggered when a bytes object is resized while being copied into itself, allowing reference to previously freed memory.
Why it matters to the business
Attackers may crash devices or execute arbitrary code on systems running vulnerable MicroPython versions, disrupting IoT, embedded, and automation deployments that rely on the interpreter.
How an attack unfolds
An attacker supplies input that causes a bytes object to be resized during an in-place copy operation, resulting in a dangling reference to freed memory that can be leveraged for memory corruption and potential code execution.
How to fix it
Upgrade MicroPython to version 1.23.0 or apply commit 4bed614e707c0644c06e117f848fa12605c711cd. Rebuild and redeploy all affected firmware images.
How to confirm the fix worked
Verify the installed MicroPython version is 1.23.0 or newer; confirm the patch commit is present in the source tree; run regression tests covering objarray resize and copy scenarios.
Typical attack path
- Identify a remotely reachable MicroPython instance accepting untrusted input that triggers objarray operations.
- Craft input causing a bytes object to be resized while copied into itself.
- Trigger the use-after-free condition to corrupt memory.
- Leverage the corruption to achieve code execution or denial of service.
How to detect it
Review application logs and crash dumps for unexpected memory faults or interpreter aborts during bytes or array operations; inspect network traffic for inputs that manipulate object sizes.
What your security team should do
- Prioritize upgrade of all production MicroPython deployments to 1.23.0 within the next maintenance window.
- Scan source repositories and build pipelines for the vulnerable commit and block merges until patched.
- Monitor upstream MicroPython releases and ecosystem packages for any additional downstream fixes.
The record
A vulnerability was found in MicroPython 1.22.2. It has been declared as critical. Affected by this vulnerability is an unknown functionality of the file py/objarray.c. The manipulation leads to use after free. The attack can be launched remotely. The complexity of an attack is rather high. The exploitation appears to be difficult. Upgrading to version 1.23.0 is able to address this issue. The identifier of the patch is 4bed614e707c0644c06e117f848fa12605c711cd. It is recommended to upgrade the affected component. In micropython objarray component, when a bytes object is resized and copied into itself, it may reference memory that has already been freed.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | micropython-copy | 0 | No fix |
| PyPI | micropython-io | 0 | No fix |
| Debian:13 | micropython | 0 | No fix |
| Debian:14 | micropython | 0 | 1.24.0+ds-1 |
| Ubuntu:20.04:LTS | micropython | 0 | No fix |
| Ubuntu:22.04:LTS | micropython | 0 | No fix |
| Ubuntu:24.04:LTS | micropython | 0 | No fix |
| Ubuntu:24.10 | micropython | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | micropython | 0 | 1.12-1ubuntu0.1~esm1 |
| Ubuntu:Pro:22.04:LTS | micropython | 0 | 1.17+ds-1.1ubuntu2+esm1 |
| Ubuntu:Pro:24.04:LTS | micropython | 0 | 1.22.1+ds-1ubuntu0.24.04.1~esm1 |
| openSUSE:Tumbleweed | micropython | 0 | 1.28.0-2.1 |
Related vulnerabilities
- CVE-2024-8946 A vulnerability was found in MicroPython 1.23.0. Also affects micropython-copy
- CVE-2024-8948 heap-buffer-overflow in MicroPython Also affects micropython-copy
- CVE-2026-1998 A flaw has been found in micropython up to 1.27.0. Also affects micropython
- CVE-2023-7158 A vulnerability was found in MicroPython up to 1.21.0. Also affects micropython