resetDbpath() ignores authentication

XMLWordPrintableJSON

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

      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 Tooling and Methods (STM) (Inactive)
            Reporter:
            Ed Costello
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: