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

resetDbpath() ignores authentication

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Security, Shell
    • Environment:
    • Server Tooling & Methods
    • ALL

      resetDbpath('/path') seems to be a mongo shell test function which is left enabled by default. It recursively removes the specified path (and {{mkdir()}}s a new directory with the same name).

      Since it is run in the shell, it runs without regards to authentication. If the shell user has write access (or is root) to the specified path, all files are removed. Since it's run in the shell and is not a dbcommand, no message is logged to the server.

      Note that startMongodEmpty is similarly destructive.

      Reproduce:

      mongo --eval 'resetDbpath("/data/db")'
      mongo --eval 'startMongodEmpty("--dbpath", "/data/db", "--port" , "9999")'
      

            Assignee:
            backlog-server-stm Backlog - Server Tooling and Methods (STM) (Inactive)
            Reporter:
            epc Ed Costello
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: