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

applyOps does not validate updates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.4.10, 3.6.2, 3.7.1
    • Fix Version/s: Backlog
    • Component/s: Replication, Write Ops
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      > db.c.insert({_id: 1})
      WriteResult({ "nInserted" : 1 })
      > db.adminCommand({applyOps: [{op: 'u', ns: 'test.c', o: {_id: 1, $bad: 1}, o2: {_id: 1}}]})
      { "applied" : 1, "results" : [ true ], "ok" : 1 }
      > db.c.find()
      { "_id" : 1, "$bad" : 1 }
      

      Show
      > db.c.insert({_id: 1}) WriteResult({ "nInserted" : 1 }) > db.adminCommand({applyOps: [{op: 'u', ns: 'test.c', o: {_id: 1, $bad: 1}, o2: {_id: 1}}]}) { "applied" : 1, "results" : [ true ], "ok" : 1 } > db.c.find() { "_id" : 1, "$bad" : 1 }
    • Linked BF Score:
      18

      Description

      The update command will validate updates for modified immutable fields, $-prefixed fields, BSON depth, etc. When updates are performed through applyOps, this validation is not performed.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-repl Backlog - Replication Team
              Reporter:
              tess.avitabile Tess Avitabile
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated: