Faulty MySQL permissions after a manual migration

Summary

At another hosting company, Manuel Schmitt had discovered that a manitu MySQL account had full access to every database on the server, and published the case anonymously. A representative of the hosting company replied by email that only this one account had been set up by hand, and wrongly, after an old server was shut down. Manuel Schmitt comments on the email and suggests the four-eyes principle for such interventions.

How the error came to light

In the first post, Manuel Schmitt describes what happened: when creating a dump, the database name was missing from the command line. The dump grew to several gigabytes because the account could read every database on the server, even the hosting company's own. The team aborted, deleted the dump and informed the provider, which corrected the permissions.

Global and database-level privileges

MySQL grants privileges at several levels. GRANT ALL ON *.* applies globally to all databases, GRANT ALL ON customer.* only to one. According to a comment by the affected company's chief technology officer, no database was selected by mistake during the manual setup, which resulted in global privileges. Automated provisioning fixes this level, while manual work leaves it to a single click.

The hosting company pointed to backups taken several times a day. A reader countered that backups help against deletion, but not against other people's data being read.

Ideas

  • Manual special migrations easily bypass the safeguards of standardised provisioning.
  • An error can affect a single user and still allow access across customers.
  • Reporting openly to the operator allows a quick fix without public identification.
  • The four-eyes principle reduces the risk of security-critical one-off changes.
  • A forgotten database name in a dump revealed the wrong permissions.

Insights

  • Striving for perfection does not replace controls for rare administrative special cases.
  • Anonymised incident reports reveal structural risks without needlessly exposing those affected.
  • Backups protect against losing data, not against its disclosure.

Quotes

  • Jeder macht Fehler. Wir machen Fehler. (Manuel Schmitt)

Facts

  • The dump was aborted at a few gigabytes and deleted.
  • According to the other hosting company, only this one account had the wrong permissions.
  • The account had been set up outside the normal environment, keeping the old IP address.
  • By its own account, the affected company set up accounts manually rather than automatically.
  • MySQL grants global privileges with ON *.* and database-level privileges with ON database.*.

References

Remarks

  • In the comments, the affected company identified itself; some readers felt the tone of the reply was know-it-all.

Recommendations

  • Check database permissions automatically against the expected customer boundary.
  • Have manual migrations with extended privileges approved by a second person.
  • Check new accounts with SHOW GRANTS for global privileges.
  • Regularly test your own hosting packages from a customer's point of view.

Read the original article on Hostblogger

Search the Web Archive

Found a mistake or have something to add? Get in touch.