3 ms·
EDIT: HN formatting isn't letting me write "asterix dot asterix", it shows up as "." :( My reading of this is that it requires either mysql root or `GRANT FILE
by terom 10y ago
EDIT: HN formatting isn't letting me write "asterix dot asterix", it shows up as "." :(
My reading of this is that it requires either mysql root or `GRANT FILE ON . TO ...` privileges? AFAICT this requires an explicit `GRANT FILE ON . TO ...`; just plain `GRANT ALL ON db.* TO ...` does NOT grant any FILE privileges. I assume an install that doesn't give any users FILE privileges is safe?
mysql> SELECT host, user, File_priv FROM mysql.user WHERE File_priv='Y';
AFAICT exploit chain:
* `GRANT FILE ON . TO ...`
* `SELECT unhex("%s") INTO DUMPFILE '%s'`
* ... clever tricks ...
* mysql root
* ... clever tricks ...
* service mysql restart
* system root
The mysql security model for FILE privileges described here seems ridiculous. Your security model relies on creating dumpfiles with `chmod 666` permissions, and rejecting config files that are world-writeable? "I fixed the security issue with world-writable dump files" "You just broken our security model!"
Never grant FILE privileges on a production mysql server?
- deleted 10y ago[deleted]
- ptaipale 10y agoHint: try it as a text after a blank line with two spaces preceding it. https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc Then you can write GRANT FILE ON *.* TO (How to find out? Google.)