Executive brief
MLX is a machine learning framework used for training and deploying AI models. A vulnerability in how it processes NumPy data files allows a specially crafted file to cause the application to crash or potentially leak small amounts of memory. This could disrupt AI services or expose internal technical details if an attacker can convince a user or system to load a malicious data file.
Technical details
A heap buffer overflow exists in `mlx::core::load()` within `mlx/io/load.cpp`. The vulnerability is caused by two primary issues: first, the parser initializes a `std::string` from a buffer using a constructor that stops at the first null byte, resulting in a string shorter than the actual 118-byte header; second, the code subsequently attempts to access index 34 of this string without performing a bounds check. An attacker can provide a malicious `.npy` file with a null byte early in the header to trigger a 13-byte out-of-bounds read. This can result in an application crash (DoS) or a limited heap memory leak. The issue is fixed in version 0.29.4.
Affected products
- ml-explore mlx <= 0.29.3
Timeline
- 2025-11-21: advisory: GitHub Advisory published
- 2025-11-21: disclosed
- 2025-11-21: other: NVD published