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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | troll.module.129534.patch | 4.27 KB | jaydub |
Comments
Comment #1
jaydub commentedI'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()
Comment #2
jaydub commentedComment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.