[SERVER-16814] Validate array keys in BSON documents Created: 12/Jan/15  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-1618 BasicBSONList doesn't support zero-le... Closed
related to CDRIVER-504 Convenient API to create BSON arrays Closed
is related to SERVER-21946 when sent invalid BSON, server runs o... Backlog
Participants:

 Description   

The BSON specification states that

Array - The document for an array is a normal BSON document with integer values for the keys, starting with 0 and continuing sequentially. For example, the array ['red', 'blue'] would be encoded as the document {'0': 'red', '1': 'blue'}. The keys must be in ascending numerical order

yet the server does not validate that BSON documents conform to this specification.

This has caused compatibility issues between drivers, as evidenced by the linked tickets.



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Karolin Varner [ 03/Aug/17 ]

This breaks dot notation in rare cases; searching for a document

{'foo': ['bar'|}

using

{'foo.0': 'bar'}

will sometimes fail if the document is affected by this issue.

Generated at Thu Feb 08 03:42:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.