MongoDB C Driver
Out-of-bounds read and write via undersized BSON buffer reservation in MongoDB C Driver
The BSON buffer-reservation API in the MongoDB C Driver can record a length smaller than the five-byte BSON minimum. Later append or comparison operations can underflow unsigned length calculations and read or write outside the document buffer. An actor who can influence the length supplied by an embedding application can cause the application to terminate or read or corrupt adjacent process memory. Reaching this issue requires the application to pass an undersized value to bson_reserve_buffer and then perform an affected operation.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 1.4.0, < 1.30.13
- >= 2.0.0, < 2.5.6
Fixed in 1.30.13, 2.5.6
Mitigation
Upgrade C Driver to 1.30.13 or 2.5.6 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.