Skip to content

Security: Index.get returns uninitialized memory for non-existent keys using python bindings #663

Closed

Description

@titusz

Describe the bug

See: #494
Created a new issue here due to potential security implications.

Steps to reproduce

from usearch.index import Index
import numpy as np

index = Index(ndim=3)
index.add(1, np.array([0.1, 0.2, 0.3]))

print(f"Existent Key 1: {index.get(1)}")      # Works
print(f"Non-Existent Key 999: {index.get(999)}")  # Bug: returns garbage instead of None

Expected behavior

Return None for non-existent keys

USearch version

v2.21.0

Operating System

Windows 10

Hardware architecture

x86

Which interface are you using?

Python bindings

Contact Details

[email protected]

Are you open to being tagged as a contributor?

  • I am open to being mentioned in the project .git history as a contributor

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug
    on Sep 14, 2025
  2. added
    v3
    and removed
    v3
    on Apr 19, 2026
  3. added a commit that references this issue on Apr 19, 2026
    22f76d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions