CVE-2024-8947: Micropython copy Use After Free Vulnerability
MODERATECVE-2024-8947 is a MODERATE (CVSS 5.6) use after free vulnerability (CWE-416: Use After Free) affecting Micropython copy libraries in the PyPI ecosystem. The issue involves use after free in micropython. Remediation is available in the latest vendor maintenance releases.
CVE-2024-8947 at a Glance
Security Impact
CVSS: 5.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2024-8947
To remediate this vulnerability, upgrade all affected Micropython copy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install micropython-copy>=Latest secure release
pip install micropython-io>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show micropython-copy
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-8947, inspect your installed packages using pip:
pip show micropython-copy
Analyze the terminal output to locate any version of Micropython copy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show micropython-copy command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Micropython copy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-8947 Affected Micropython copy Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
micropython-copy
|
PyPI |
≤ 3.3.3.post3
|
|
|
micropython-io
|
PyPI |
≤ 0.1
|
|
References
Frequently Asked Questions
What is CVE-2024-8947?
Which Micropython copy versions are affected?
What version fixes CVE-2024-8947?
Is micropython-copy affected?
Is micropython-io affected?
What is the CVSS score of CVE-2024-8947?
What CWE is associated with CVE-2024-8947?
How can I check PyPI dependencies for CVE-2024-8947?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pwwp-3q7j-9mx8",
"modified" : "2024-09-25T18:18:16Z",
"published" : "2024-09-17T21:30:32Z",
"aliases" : [ "CVE-2024-8947" ],
"summary" : "Use After Free in MicroPython",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "micropython-copy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.3.3.post3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "micropython-io"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-8947"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/issues/13283"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/issues/13283#issuecomment-1918479709"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/commit/4bed614e707c0644c06e117f848fa12605c711cd"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/releases/tag/v1.23.0"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-copy/PYSEC-2024-92.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-io/PYSEC-2024-94.yaml"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.277765"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.277765"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?submit.409316"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-25T18:18:16Z",
"nvd_published_at" : "2024-09-17T19:15:29Z"
}
}