Thread: Major Additions - [DBTech] DragonByte SEO v2 (vB4)
View Single Post
  #1134  
Old 04-06-2017, 12:10 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01531 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete