Hi folks, I don't know if this is a problem with the Troll module or Drupal at large, but I installed Troll and I was trying it out. I entered two values in the search string like 'foo' and 'bar' and I received the following in the logs:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'princi' 'traveler'%' AND u.uid != 0' at line 1 query: SELECT COUNT(*) FROM users u LEFT JOIN troll_ip_track t ON u.uid = t.uid WHERE u.uid != 0 AND LOWER(u.name) LIKE '%'princi' 'traveler'%' AND u.uid != 0 in /home/dir/public_html/includes/database.mysql.inc on line 121.

looks like a SQL injection is possible. I haven't checked.

Thanks.

CommentFileSizeAuthor
#1 troll.module.129534.patch4.27 KBjaydub

Comments

jaydub’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new4.27 KB

I've cut a patch that allows Drupal to take care of preventing SQL injection.

Also included in this patch are:

- few SQL changes for PostgreSQL compatibility.
- fixes in http://drupal.org/node/184779 (with slight changes)
- small fix to the $form['details'] fieldset title in troll_search_user_detail()

jaydub’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.