CVE-2023-7158
NixOS vulnerability analysis and mitigation

Overview

A critical heap-based buffer overflow vulnerability (CVE-2023-7158) was discovered in MicroPython versions up to 1.21.0. The vulnerability affects the slice_indices function in the objslice.c file, where float values are incorrectly interpreted as integers, leading to potential buffer overflow conditions. The vulnerability was discovered by Junwha Hong and Wonil Jang from S2-Lab, UNIST (GitHub Issue).

Technical details

The vulnerability occurs in the slice_indices function where it attempts to interpret a float value as an integer without proper validation. When a float value is passed as an argument to the indices() method, the function misinterprets it, leading to an invalid memory access. The issue stems from the mp_obj_int_get_checked function attempting to parse the dig field of mpz at an incorrect memory offset, resulting in a heap-buffer-overflow condition. The vulnerability has been assigned a CVSS v3.1 base score of 9.8 CRITICAL (Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) (NVD).

Impact

The vulnerability allows remote attackers to potentially execute arbitrary code through buffer overflow exploitation. The high severity rating indicates that successful exploitation could lead to complete system compromise with high impacts on confidentiality, integrity, and availability of the affected system (NVD).

Mitigation and workarounds

The vulnerability has been fixed in MicroPython version 1.22.0 by adding proper validation that the argument to indices() is an integer. Users are strongly advised to upgrade to version 1.22.0 or later to address this security issue. The fix was implemented through a patch that validates the argument type before processing (GitHub PR, Release Notes).

Community reactions

The vulnerability has been acknowledged and addressed by major Linux distributions including Fedora, which has released security updates to address both CVE-2023-7158 and CVE-2023-7152 in their package updates (Fedora Update).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-22783HIGH8.1
  • NixOSNixOS
  • iris
NoYesJan 12, 2026
CVE-2026-0821MEDIUM6.9
  • NixOSNixOS
  • quickjs
NoNoJan 10, 2026
CVE-2025-68949MEDIUM5.3
  • NixOSNixOS
  • n8n
NoYesJan 13, 2026
CVE-2026-22784LOW2.3
  • NixOSNixOS
  • lychee
NoYesJan 12, 2026
CVE-2026-23497LOW1.3
  • NixOSNixOS
  • learning
NoYesJan 14, 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