CVE-2024-8947
Python vulnerability analysis and mitigation

Overview

A critical use-after-free vulnerability was discovered in MicroPython version 1.22.2, identified as CVE-2024-8947. The vulnerability affects the objarray component in the file py/objarray.c, where when a bytes object is resized and copied into itself, it may reference memory that has already been freed. The issue was discovered by researchers Junwha Hong and Wonil Jang from S2Lab in UNIST and was disclosed in December 2023 (GitHub Issue).

Technical details

The vulnerability occurs in the array_subscr function within py/objarray.c when a bytearray object is manipulated to extend from itself. When m_renew causes realloc to move the buffer, it leaves a dangling pointer behind. The issue manifests when the source and destination buffers are the same, and memory reallocation occurs during the operation. The vulnerability has been assigned a CVSS v3.1 base score of 8.1 HIGH (Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) (NVD).

Impact

While the vulnerability is classified as critical, its actual impact in default configurations with GIL (Global Interpreter Lock) is limited. The freed buffer won't be reused while the function is still executing and is no longer referenced after it returns. However, in configurations without GIL protection, this could lead to memory corruption and potential code execution (GitHub Issue).

Mitigation and workarounds

The vulnerability has been fixed in MicroPython version 1.23.0. The fix involves properly handling the source buffer when m_renew causes memory reallocation, ensuring that the source pointer is updated when the destination buffer moves. Users are recommended to upgrade to version 1.23.0 or later to address this issue (GitHub Release).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23949HIGH8.6
  • PythonPython
  • jaraco.context
NoYesJan 20, 2026
CVE-2026-22219HIGH8.3
  • PythonPython
  • chainlit
NoYesJan 20, 2026
CVE-2026-23842HIGH7.5
  • PythonPython
  • chatterbot
NoYesJan 19, 2026
CVE-2026-23877MEDIUM5.3
  • PythonPython
  • swingmusic
NoYesJan 19, 2026
CVE-2026-23833LOW1.7
  • PythonPython
  • esphome
NoYesJan 19, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management