Closed (fixed)
Project:
Multisite Search
Version:
6.x-2.3
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
15 Mar 2012 at 00:32 UTC
Updated:
5 Jul 2012 at 15:51 UTC
Jump to comment: Most recent file
A security vulnerability was called to my attention, and because of it the module was marked as "unsupported". The announcement was made here before I could get a fix...
http://drupal.org/node/1471800
The "Add Site" or "Edit Site" admin form opens up a possible SQL injection with the "table prefix" value. Here's a patch that adds a validate function, and only accepts values that are alphanumeric, underscores, and periods.
(TODO: Look into using db_escape_table() to clean up the queries, although I have to account for periods as well.)
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | multisite-search-search-67542-2.patch | 10.55 KB | earthday47 |
| multisite_search-security-67543-1.patch | 1014 bytes | earthday47 |
Comments
Comment #1
gregglesI am following this issue and happy to review patches and, once the code is good and committed, get the project back to full status.
Thanks for working on this.
Comment #2
money2k commented~line: 285
//validate table prefix
if (preg_match('/^[a-zA-Z0-9_\.]*$/', $result['table_prefix'])){
//code goes here that handles datasets, words, counts, etc
}
Comment #3
earthday47Cool, that's the solution I wrote in the patch :)
Comment #4
gregglesI think db_escape_table in every queyr is an important second part of the solution.
Comment #5
earthday47The current implementation allows table_prefix to have periods as well, for the database name, like dbname1.db_table_prefix_
I guess I should change the implementation, but it's a lot of work :(
Comment #6
earthday47Please try the attached patch. (ignores the last patch)
Run update.php after applying.
This patch splits the "db_prefix" and "table_prefix" values into two database columns. Then, wherever possible, both values are run through db_escape_table().
-Wes
Comment #7
gregglesThe sections you fixed look good to me. Thanks for your work.
Comment #8
chales commentedI installed the module and tested to see that there was an issue with the 'table prefix' field as mentioned. I then applied the patch which validates the submitted field data and removes the issue. This seems to have fixed the issue.
Comment #9
greggles@earthday47 - given chales review you can go ahead and commit the patch and create the release. Once that's done comment here and we will update the project page to make it a supported project again.
Comment #10
earthday47\I just committed the patch to 6.x-2.x, and created a 6.x-2.3 release: http://drupal.org/node/1649974
I marked it as a security release.
Thanks for the reviews everyone, looking forward to having this back in business!
-Wes
Comment #11
gregglesAlrighty, the project should be editable by you again and that release is published.
Thanks, Wes.