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

resetDbpath() ignores authentication

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Security, Shell
    • Server Tooling & Methods
    • ALL

    Description

      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")'

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: