Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3892

Cleartext logging of passwords / workaround (MySQL issue 57220)

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I wrote a small command-line utility to be able to calculate the standard MySQL hashes that are used for logins, without the need for a database connection. This way, plain text passwords need not be sent to the server or be logged in the query log. The utility can generate a hash, generate SQL or "fix" plain text passwords in SQL. Man pages in English and Dutch are included.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Isn't that what mysqladmin is doing? It calculates the hash and sends "SET PASSWORD=calculated_hash" to the server. That is, the plain-text password is not logged anywhere.

            But, as I can see, mysqladmin also tries to set SQL_LOG_OFF=1, and it requires SUPER privilege, as that MySQL bug 57220 says.

            If mysqladmin would ignore errors from SET SQL_LOG_OFF=1, wouldn't that be the more native and integrated solution?

            Show
            serg Sergei Golubchik added a comment - Isn't that what mysqladmin is doing? It calculates the hash and sends "SET PASSWORD=calculated_hash" to the server. That is, the plain-text password is not logged anywhere. But, as I can see, mysqladmin also tries to set SQL_LOG_OFF=1, and it requires SUPER privilege, as that MySQL bug 57220 says. If mysqladmin would ignore errors from SET SQL_LOG_OFF=1, wouldn't that be the more native and integrated solution?
            Hide
            donquichote BitSmid added a comment -

            I encountered this bug when I wanted to create a database on somebody else's server. As a developer, I am used to be in full control of the database server, but the issue here is that I want to create all necessary SQL beforehand (so I can test it locally) and send it to the "little privileged" database in one batch. The database is not necessarily accessible from outside or even through networking (or SSH tunnel to 127.0.0.1). I wrote this utility to be able to define a user without a connection during the preparation. If necessary, I could send the entire SQL by email and still not leak any password.

            Show
            donquichote BitSmid added a comment - I encountered this bug when I wanted to create a database on somebody else's server. As a developer, I am used to be in full control of the database server, but the issue here is that I want to create all necessary SQL beforehand (so I can test it locally) and send it to the "little privileged" database in one batch. The database is not necessarily accessible from outside or even through networking (or SSH tunnel to 127.0.0.1). I wrote this utility to be able to define a user without a connection during the preparation. If necessary, I could send the entire SQL by email and still not leak any password.
            Hide
            serg Sergei Golubchik added a comment -

            Ah, okay. I understand now, thanks.

            Show
            serg Sergei Golubchik added a comment - Ah, okay. I understand now, thanks.

              People

              • Assignee:
                Unassigned
                Reporter:
                donquichote BitSmid
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: