Install this simple plugin on any version of WordPress to block bad queries like that:
It could easily be expanded to also look at $_POST data which is another form of attack you'll never see in your logs.
It could easily be expanded to also look at $_POST data which is another form of attack you'll never see in your logs.