You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Dimension Attacks - Zero, negative, and extremely large dimension counts
Memory Exhaustion - Vectors designed to consume excessive memory
Serialization Attacks - Malformed binary data that could crash deserialization
Embedding Injection - Malicious text designed to break embedding generation
Test Structure
[Test][Category("Security")]publicvoidVector_WithNaNValues_HandledSafely(){// ArrangevarmaliciousValues=newfloat[]{float.NaN,float.PositiveInfinity,float.NegativeInfinity,float.MaxValue};// Act & Assert: Should either reject gracefully or handle safelyvardatabase=newVectorDatabase();foreach(varvalueinmaliciousValues){varmaliciousVector=newVector(newfloat[]{value,1.0f,2.0f});// Should not crash the databaseAssert.DoesNotThrow(()=>database.Vectors.Add(maliciousVector));// Search operations should not crashAssert.DoesNotThrow(()=>database.Search(maliciousVector,5,SearchAlgorithm.Linear));}// Database should remain stableAssert.That(database.Count,Is.EqualTo(maliciousValues.Length));}[Test][Category("Security")]publicvoidVector_WithExtremeDimensions_RejectedSafely(){// Test vectors with extreme dimension countsvardatabase=newVectorDatabase();// Zero dimensionsAssert.Throws<ArgumentException>(()=>newVector(newfloat[0]));// Negative dimensions (if possible through unsafe code)// Extremely large dimensions (could cause OutOfMemoryException)Assert.Throws<OutOfMemoryException>(()=>newVector(newfloat[int.MaxValue]));}
Description
Test database security against malicious vector data, extreme values, and input that could cause crashes or unexpected behavior.
Phase
Phase 3: Security and Input Validation
Epic
Related to #202
Acceptance Criteria
Malicious Input Scenarios
Test Structure
Security Validation