Intel

AIKIDO-2026-344675

numpy is vulnerable to Out-of-bounds Read

Out-of-bounds Read Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Yesterday

59

Medium Risk

This Affects:

PYTHONnumpy
2.0.0 - 2.5.2
Fixed in 2.5.3
Are you affected? Scan for Free

TL;DR

Casting a fixed-width byte string array (np.bytes_) to NumPy's StringDType copies the raw bytes into the string buffer after only trimming trailing null bytes, without checking that the remaining bytes are valid UTF-8. Later string operations on that StringDType array assume well-formed UTF-8 and index the stored bytes by codepoint, so malformed sequences from an untrusted byte array can drive those operations out of bounds or into a hang. The patch adds bounds-checked UTF-8 validation to the bytes to string cast and hardens related StringDType bounds handling so invalid input is rejected with a TypeError at cast time.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you cast a np.bytes_ array containing data you do not fully control into StringDType and then perform string operations on it.

Background info

numpy is vulnerable to Out-of-bounds Read in versions 2.0.0 - 2.5.2.

How to fix this

Upgrade the numpy library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform