Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49334

IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type>

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.5 Desired
    • Component/s: IDL
    • None
    • ALL
    • Hide
      1. Define an attribute of an object in *.idl file like below.
         
        cursors:
            description: "An array of cursor IDs to be killed."
            type: array<cursorId>
            cpp_name: cursorIds
            optional: false
        
      2. Pass an array-like object as a value of the field:
        cursors:{
         '0': 10000,
         '1': 20000
        }
        
      3. The object is successfully parsed.
      Show
      Define an attribute of an object in *.idl file like below. cursors: description: "An array of cursor IDs to be killed." type: array<cursorId> cpp_name: cursorIds optional: false Pass an array-like object as a value of the field: cursors:{ '0' : 10000, '1' : 20000 } The object is successfully parsed.

      IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type>. The parsers do accept both - BSON arrays and objects with array layout (please see Steps To Reproduce for an example). Expected behavior is that only BSON arrays are accepted.

            Assignee:
            garaudy.etienne@mongodb.com Garaudy Etienne
            Reporter:
            mindaugas.malinauskas@mongodb.com Mindaugas Malinauskas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: