Reply to Re: if I allow anyone on the web to run SQL queries against my database, what are the obvious attacks hackers will try?

Your name:

Reply:


Posted by Gordon Burditt on 04/16/06 17:55

>> MySQL has good permissions, you could connect to the db as a different
>> user and with only a limited set of permissions.
>
>I like that idea. Do you have suggestions of what would constitute a
>minimal set of permissions that would still enable outsiders to make
>queries that I can think of?

For read-only access to tables, a user needs SELECT (probably on
one database only) and possibly CREATE TEMPORARY TABLES (which is
sometimes needed implicitly for ORDER BY). This presumes that
you supply the tables and the data, created by an account that has
more privileges. This doesn't prevent running your database out
of disk space with temporary tables.

If you want to allow the user to alter data, but not the tables,
SELECT, INSERT, UPDATE, and DELETE privilege on one database, along
with CREATE TEMPORARY TABLES is probably sufficient. This does allow
them to wipe out any sample data and run your database out of disk
space.

This does not prevent hammering the db with queries (there are some
rate-limiting features for that) or loading down the server with
joins that create huge numbers of rows in the result.

>> What about functions?
>>
>> select LOAD_FILE('/etc/passwd');'

This requires FILE privilege to read files on the server.
This is a privilege you shouldn't hand out lightly.

Gordon L. Burditt

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация