Highlights
Heap Buffer Overflow: 1 prior fix. Scrutinize any change in this area.
ext/bson/write.c: most-fixed (2 issues). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns
The bug types that recur here, drawn from past fixes, not open vulnerabilities.
Heap Buffer Overflow: Large strings containing 2^31 or more bytes can trigger integer truncation and negative wrapping in native length calculations. This results in an undersized allocation or an incorrect loop boundary, leading to out-of-bounds reads or writes during UTF-8 validation.
Use After Free: Caching raw pointers to Ruby array elements across execution boundaries is highly dangerous. If custom Ruby serializers execute during the serialization loop and mutate the source array, the cached pointer is invalidated, resulting in a use-after-free when the extension next attempts to write the field.