Vulnerabilities in pkg:pypi/micropython-string
PACKAGECVE-2024-8946 is a MODERATE (CVSS 7.3) heap-based buffer overflow vulnerability (CWE-122: Heap-based Buffer Overflow) affecting Micropython copy libraries in the PyPI ecosystem. The issue involves heap-based buffer overflow in micropython. Remediation is available in the latest vendor maintenance releases.
pkg:pypi/micropython-string
Vulnerability advisories affecting package pkg:pypi/micropython-string. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-74qm-4v7r-jw2f | CVE-2024-8946 | MODERATE | Heap-based Buffer Overflow in MicroPython |
CVE-2024-8946 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2024-8946
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
pip install micropython-os-path>=Latest secure release
pip install micropython-string>=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-8946, 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-122: Heap-based Buffer Overflow, where a heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc(). 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-8946 Affected Micropython copy Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
micropython-copy
|
PyPI |
≤ 3.3.3.post3
|
|
|
micropython-io
|
PyPI |
≤ 0.1
|
|
|
micropython-os-path
|
PyPI |
≤ 0.1.3
|
|
|
micropython-string
|
PyPI |
≤ 0.1
|
|
References
Frequently Asked Questions
What is CVE-2024-8946?
Which Micropython copy versions are affected?
What version fixes CVE-2024-8946?
Is micropython-copy affected?
Is micropython-io affected?
What is the CVSS score of CVE-2024-8946?
What CWE is associated with CVE-2024-8946?
How can I check PyPI dependencies for CVE-2024-8946?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-74qm-4v7r-jw2f",
"modified" : "2024-09-25T18:23:41Z",
"published" : "2024-09-17T21:30:33Z",
"aliases" : [ "CVE-2024-8946" ],
"summary" : "Heap-based Buffer Overflow in MicroPython",
"details" : "A vulnerability was found in MicroPython 1.23.0. It has been classified as critical. Affected is the function mp_vfs_umount of the file extmod/vfs.c of the component VFS Unmount Handler. The manipulation leads to heap-based buffer overflow. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used. The name of the patch is 29943546343c92334e8518695a11fc0e2ceea68b. It is recommended to apply a patch to fix this issue. In the VFS unmount process, the comparison between the mounted path string and the unmount requested string is based solely on the length of the unmount string, which can lead to a heap buffer overflow read.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/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"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "micropython-os-path"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "micropython-string"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-8946"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/issues/13006"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/issues/13006#issuecomment-1820309455"
}, {
"type" : "WEB",
"url" : "https://github.com/micropython/micropython/commit/29943546343c92334e8518695a11fc0e2ceea68b"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-copy/PYSEC-2024-91.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-io/PYSEC-2024-93.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-os-path/PYSEC-2024-95.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/micropython-string/PYSEC-2024-96.yaml"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.277764"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.277764"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?submit.409312"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-122", "CWE-787" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-25T18:23:41Z",
"nvd_published_at" : "2024-09-17T19:15:29Z"
}
}