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>

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 4.5 Desired
    • Fix Version/s: None
    • Component/s: IDL
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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.

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: