BugZero found this defect 16 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
5/3/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
Currently, we serialize the ObjectId like so here: case TypeTags::ObjectId: { buf.appendBool(true); buf.appendBytes(getObjectIdView(val), sizeof(ObjectIdType)); break; } There is no equivalent CType when deserializing back to ObjectId and it fails here when converting to bson with "Unknown type". When ObjectId is serialized exactly how bsonObjectId is serialized, it properly converts back into an ObjectId. ObjectId and bsonObjectId are treated as the same in some places. Additionally, when mapping to BSON types, the two both map to BSONType::jstOID. We should serialize ObjectId using appendOID.