Description
The loadIndex function in nmslib hnswlib and Spotify Voyager does not verify that the element count in a serialized HNSW index is within the stored capacity used to allocate the heap buffer. An attacker can supply a crafted index file with an element count greater than the stored capacity, causing the loader to write beyond the allocated buffer and potentially crash the application when it loads the file.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Spotify | Voyager | 2.0.7 – ≤ 2.1.1 | — |
| hnswlib | hnswlib | 0.5.0 – ≤ 0.9.0 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | hnswlib | No fix yet | — |
| Debian 13 | hnswlib | No fix yet | — |
| Debian 12 | hnswlib | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | hnswlib | No fix yet | — |
| Ubuntu 26.04 LTS | hnswlib | No fix yet | — |
| Ubuntu 24.04 LTS | hnswlib | No fix yet | — |
| Ubuntu 22.04 LTS | hnswlib | No fix yet | — |