Is the dragonbyte-tech website down? I have not been able to access it for 2 days. I had a bug to report, but when I tried to submit, the site went down, and has not been back up since. The bug is as follows:
---
When the config dbtech_dbseo_filter_nonlatin_chars is not 1, conversions of character groups such as eu or ss can lead to database errors if a slash is placed before the group. It may also be able to craft a request that will trigger a similar error if the setting is 1, but I think it is harder.
Here is an example database error I received in my email:
Code:
Invalid SQL:
SELECT tagtext AS id FROM forum_tag WHERE tagtext REGEXP "^(&[\#\da-z]*;|[^a-z\d])*(&[\#\da-z]*;|[^a-z\d])*[(&[\#\da-z]*;|[^a-z\d])*[i?ŒÍ?ŽÏì?+îï]m/[e?ˆ?‰?Š?‹èéêë]([u?™?š?›?œùúûüµ]|u|?†|æ)rg](&[\#\da-z]*;|[^a-z\d])*(&[\#\da-z]*;|[^a-z\d])*$" ORDER BY LENGTH(tagtext) LIMIT 1;
MySQL Error : Got error 'unmatched parentheses at offset 63' from regexp
Error Number : 1139
Request Date : Tuesday, April 4th 2017 @ 02:32:37 PM
Error Date : Tuesday, April 4th 2017 @ 02:32:37 PM
Script : http://www.vaultwiki.org/tags/[-im/eurg]/
Referrer :
IP Address : [redacted]
Username : N/A
Classname : vBulletinDatabase_MySQLi
MySQL Version :
Server : ::ffff:199.167.148.228
User Agent :
Stack Trace:
#0 DBSEO_Database->halt() called in [path]/dbtech/dbseo/includes/class_db.php on line 910
#1 DBSEO_Database_MySQLi->execute_query() called in [path]/dbtech/dbseo/includes/class_db.php on line 304
#2 DBSEO_Database->query_read_slave() called in [path]/dbtech/dbseo/includes/class_db.php on line 779
#3 DBSEO_Database->generalQuery() called in [path]/dbtech/dbseo/includes/filter.php on line 958
#4 DBSEO_Filter::reverseObject() called in [path]/dbtech/dbseo/includes/rewrite/tag/single.php on line 27
#5 DBSEO_Rewrite_Tag_Single::resolveUrl() called in [path]/dbtech/dbseo/includes/url.php on line 967
#6 DBSEO_Url::resolve() called in [path]/dbtech/dbseo/includes/url.php on line 579
#7 DBSEO_Url::lookup() called in [path]/dbseo.php on line 159
The URL doesn't point to a valid tag, but the expected behavior here is no database error. I was able to resolve these errors on my site by making sure the regular expression is tested before it goes through MySQL. In
dbtech/dbseo/includes/filter.php find:
Code:
$title3 = self::unFilterText(htmlspecialchars(self::$config['dbtech_dbseo_rewrite_separator'] . str_replace(' ', self::$config['dbtech_dbseo_rewrite_separator'], $title) . self::$config['dbtech_dbseo_rewrite_separator']), true);
After it, add:
Code:
if (!@preg_match('/' . $title2 . '/', $title, $m) OR !@preg_match('/' . $title3 . '/', $title, $m))
{
return false;
}
Basically this code change means that if we were not able to generate a valid regex or the regex does not actually match what it was intended to match, the reverse lookup should fail.