MicroPython VFS Unmount vfs.c mp_vfs_umount heap-based overflow
Description
A critical heap-buffer-overflow flaw in MicroPython 1.23.0's VFS unmount handler due to incorrect length-based string comparison allows remote arbitrary code execution or denial of service.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A critical heap-buffer-overflow flaw in MicroPython 1.23.0's VFS unmount handler due to incorrect length-based string comparison allows remote arbitrary code execution or denial of service.
Vulnerability
Description CVE-2024-8946 is a critical heap-buffer-overflow vulnerability in MicroPython 1.23.0, specifically in the mp_vfs_umount function within extmod/vfs.c [1]. The root cause is that when comparing the mounted path string with the user-supplied unmount path string, the code uses the length of the unmount string as the comparison boundary. This can lead to reading beyond the bounds of a shorter mounted path buffer, resulting in a heap-based buffer overflow [2].
Exploitation
Scenario An attacker can exploit this vulnerability remotely by sending a specially crafted unmount request that is longer than the actual mounted path [1]. The bug is triggered whenever the unmount string length exceeds the length of the mount string it is compared against [2]. The provided proof of concept (PoC) demonstrates unmounting a path like /lfs with an extremely long unmount string, causing the overflow [2]. No authentication is required, and the attack can be launched over the network if the MicroPython device exposes the VFS unmount interface.
Impact
Successful exploitation could allow an attacker to cause a denial of service (crash) or potentially execute arbitrary code within the context of the MicroPython runtime, depending on heap layout and memory protections [1][2]. The bug is classified as critical with a CVSS v4.0 score reflecting high impact on confidentiality, integrity, and availability [1].
Mitigation
The fix is available in commit 29943546343c92334e8518695a11fc0e2ceea68b within the MicroPython repository [1]. Users are strongly advised to apply the patch or update to a version that includes it [1]. No workaround is documented; the safest mitigation is to update the software.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
micropython-copyPyPI | <= 3.3.3.post3 | — |
micropython-ioPyPI | <= 0.1 | — |
micropython-os-pathPyPI | <= 0.1.3 | — |
micropython-stringPyPI | <= 0.1 | — |
Affected products
5- ghsa-coords4 versionspkg:pypi/micropython-copypkg:pypi/micropython-iopkg:pypi/micropython-os-pathpkg:pypi/micropython-string
<= 3.3.3.post3+ 3 more
- (no CPE)range: <= 3.3.3.post3
- (no CPE)range: <= 0.1
- (no CPE)range: <= 0.1.3
- (no CPE)range: <= 0.1
Patches
129943546343cextmod/vfs: Fix buffer overflow of string comparison in umount.
1 file changed · +1 −1
extmod/vfs.c+1 −1 modified@@ -273,7 +273,7 @@ mp_obj_t mp_vfs_umount(mp_obj_t mnt_in) { mnt_str = mp_obj_str_get_data(mnt_in, &mnt_len); } for (mp_vfs_mount_t **vfsp = &MP_STATE_VM(vfs_mount_table); *vfsp != NULL; vfsp = &(*vfsp)->next) { - if ((mnt_str != NULL && !memcmp(mnt_str, (*vfsp)->str, mnt_len + 1)) || (*vfsp)->obj == mnt_in) { + if ((mnt_str != NULL && mnt_len == (*vfsp)->len && !memcmp(mnt_str, (*vfsp)->str, mnt_len)) || (*vfsp)->obj == mnt_in) { vfs = *vfsp; *vfsp = (*vfsp)->next; break;
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
12- github.com/micropython/micropython/commit/29943546343c92334e8518695a11fc0e2ceea68bghsapatchWEB
- github.com/micropython/micropython/issues/13006ghsaexploitissue-trackingWEB
- github.com/advisories/GHSA-74qm-4v7r-jw2fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-8946ghsaADVISORY
- vuldb.comghsathird-party-advisoryWEB
- github.com/micropython/micropython/issues/13006ghsaissue-trackingWEB
- github.com/pypa/advisory-database/tree/main/vulns/micropython-copy/PYSEC-2024-91.yamlghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/micropython-io/PYSEC-2024-93.yamlghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/micropython-os-path/PYSEC-2024-95.yamlghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/micropython-string/PYSEC-2024-96.yamlghsaWEB
- vuldb.comghsasignaturepermissions-requiredWEB
- vuldb.comghsavdb-entrytechnical-descriptionWEB
News mentions
0No linked articles in our index yet.