CSHARP-6166ClosedFixed

BSON output corruption via out-of-range binary subtype bypassing UUID and OldBinary guards

{{BsonBinarySubType}} is an int-backed enum with no range check, so a value like 260 is accepted by{{{}BsonBinaryData{}}} and by {{JsonReader}} ({{{}BinData(){}}}, {{{}HexData(){}}}, legacy {{{}$type{}}}), then truncated to its low byte by {{{}WriteBinarySubType{}}}. The result is a stored binary value whose subtype byte does not match its contents: unreadable documents, silent 4-byte truncation, or a subtype that bypasses application-level checks. Fixes: * {{BsonBinaryData}} constructor re

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
3.13.0
Components
Server components related to this issue

No components specified.

Labels
Tags and classification
aegis-ih