views:

52

answers:

1

Hi,

how would I disable the mysql benchmark function, thus not being subject to blind sql injection attacks such as "select if( user() like 'root@%', benchmark(100000,sha1('test')), 'false' );"

select * from func does not show up a function benchmark.

Kind Regards Charles

A: 

The best practice advise is to escape data before passing to the query or create prepared statements. Unfortunately not only benchmark function is that dangerous, so you would need to disable others ...

Igor
Hi folks, I know there may be other ways, but I explicitly want to know how to disable benchmark. Thanks, Charles
Charles
@Charles: But why? If you're using parametrized queries properly, adding this extra protection is like putting a picket fence around your concrete bunker (just in case there's people who have no problem doing through a concrete bunker but who are morbidly afraid of picket fences)
Matti Virkkunen
@Matti because I need to make a workshop where parametrized queries might be the answer :) And also I care for this. Of course backup option is alway to look at the source, but I hoped for some simple DISABLE BENCHMARK option.
Charles
@Charles: What's a "workshop" in this context?
Matti Virkkunen
@Matti a workshop of security basics. (Input Filter, Output Sanitizing, and some Aha Examples for the practical guys, including some countermeasures)
Charles