[DRIVERS-133] Drivers should not allow sending _ids with a key starting with $ Created: 11/Jan/14  Updated: 15/Apr/19  Resolved: 22/Jun/16

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Barrie Segal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CXX-518 Write a test for and ensure we don't ... Closed
Related
is related to SERVER-12209 _id with $prefix field causes replica... Closed
is related to PYTHON-623 Python driver should not allow sendin... Closed
Driver Compliance:
Key Status/Resolution FixVersion
CXX-518 Done legacy-1.0.1
PERL-547 Won't Fix

 Description   

Raised this in as PYTHON-623 first, but after discussion with jesse this should probably be a more general discussion amongst all drivers.

See also related SERVER-12209 ticket where this issue came up.

Sending a document with _id of extended JSON form to a primary will succeed but crash all secondaries immediately upon replication.

{'_id': {'$oid': "52d0b971b3ba219fdeb4170e" } }

Some drivers seem to validate for such cases (key starts with $ in nested sub-document) and reject the write, while others (I only tested with Python so far) don't. The behavior should be consistent.

Another discussion point is whether these validations should happen on the driver or server side. Currently --objcheck seems not to protect the server from such _ids.


Generated at Thu Feb 08 08:20:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.