Wordpress Incore Errors : Coding Modifications and Misconfigurations

View Specific



zeroknock [at] secniche.org


For Education Purposes Only!


Analytical View.

This analysis directly or indirectly revolves around the coding of wordpress.In this the stress is being laid on the modification of .php pages present in the wordpress.This issues comes relevant when the user changes some of the content of base pages to render it according to its own needs. I have been enumerating this issue for long time and finds it a good talk. When the proper manipualtion in the code or rather say proper changes are not undertaken in the code , results in information leverage and crashing of web applications. This vector is a apoint of talk because the direct use of wordpress CMS system is not undertaken directly but rather modified to some extent acording to ones usage.The coders or developers of website make some critical mistakes in modification of pages. This analysis not only make the user to understand where the actual fault occurs that disrupts the functioning of web applications.In the case of wordpress the error generated mainlt in two ways:

[1] Internal Errors : These are the errors termed to be as static errors tat remain in the code prior to testing.This proliferates as usual when ever the word press page is loaded and specific module is called.

[2] Dynamic Errors : These type of errors occur on due to dynamic injection of code.In this error handling mechanism is either bypassed or modules are infected with rogue inputs to generate run time errors.

This the two generic ways that leads to an infection outcome.To get in touch with wordpress functioning and to have a brief eye on its working , lets look into the working model of it. This makes our analysis more generic and information prone.



So this is how actually the general working of wordpress is encountered.My point of talk revolves around the infections that can ocur in the wordpress pages or the coding flaws that lead to attack base.Basically what type of errors are generated and whats the actual cause of it.

I simple chose wp-trackback.php to cross analyze the wordpress.I found very stringent errors due to bad coding or modification of code.I enumerate the functionality of other defined pages of this wordpress CMS. The issues are overall integrated to this talk.It will encomapass all error generated and various infections comprised of it.Lets begin with the issues.

A Trackback is an acknowledgment. This acknowledgment is sent via a network signal (ping) from the originating site to the receiving site. The receptor often publishes a link back to the originator indicating its worthiness. Trackback requires both sites to be Trackback enabled in order to establish this communication. Trackback does not require the originating site to physically link to the receiving site.Trackbacks are used primarily to facilitate communication between blogs; if a blogger writes a new entry commenting on, or referring to, an entry found at another blog, and both blogging tools support the TrackBack protocol, then the commenting blogger can notify the other blog with a "TrackBack ping"; the receiving blog will typically display summaries of, and links to, all the commenting entries below the original entry


[1] Database Infection Realm
This is overall layout.As the wordpress core is based on the the database at the backend.I have noticed that some of the users try to adjust the functionality of the database according to the ones usage.This not only inherits the infection vector if a single element of bad code persists.Sometimes even the injection of parameters do the trick for this. The errors occurs due to bad table name , mismatched query, wrong input parameters etc. The problem is , this anatomy leads to lowering of web applications ie wordpress in this case.The database manipulation and tempering is always the main cause either it is undertaken by injecting parameters or coding flaws.This needs to be encountered in a right way otherwise flexibility of modules are reduced.

Example:




[2] Functional Encoding Layout
The wordpress supports encoding mechanism. During my session of enumeration I have found that wrong set of coding schemes are passed to the the defined modules which make the application to react in a stringent way.This happens because the encoding checks are not properly implemented or applied by the user generically.This not only sets the realm of modular infection but makes the wordpress pages vulnerable to errors and hence lot of information is leveraged from this.What happens actually the wordpress modules are unbble to resolve the encoding object passed as argument there by generating errors in the application.

Example:




Lets look into another mal functional layout.

Example:




As the error response generates the encoding mal functining.I try to look back at the code that is provided defaultly with the wordpress.This makes our analysis more clear and proof prone.Lets look into it.

 	if ($charset)
		$charset = strtoupper( trim($charset) );
	else
		$charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS';
	
	if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
		$title     = mb_convert_encoding($title, get_option('blog_charset'), $charset);
		$excerpt   = mb_convert_encoding($excerpt, get_option('blog_charset'), $charset);
		$blog_name = mb_convert_encoding($blog_name, get_option('blog_charset'), $charset);
	}
	
	// Now that mb_convert_encoding() has been given a swing, we need to escape these three
	$title     = $wpdb->escape($title);
	$excerpt   = $wpdb->escape($excerpt);
	$blog_name = $wpdb->escape($blog_name);
	
So you can look clearly that in the code exactly encoding is not supported and still in many cases variant of different encoding schemes are passed which automatically gets rendered and are not handled by the wordpress directly.This in turn affect the working pace of applications.




[3] Inclusion Path Problems.
The path is always summed up to be as the most reliable entity in web coding.This is because an inclusion of path between various application sets a realm of cross functioning between various web pages.This is possible by including a path that particular object on the server to that part of web application where it is necessary.The problem flourishes when ever wrong reference is passed to that module where objects from other entity is required.This is very common mistake undertaken because it disrupts the working approach of application.This not only makes the wordpress pages to go haywhile if modifications are done in a wrong manner.A single inclusion of wrong element makes the infection vector to traverse in depth.

Example:


Example:

So above provided example makes it clear that wrong inclusion of an object dethroen the working of web applications.The wordpress relates to this aspect too.




[4] Response Extraction.
The response is all what we want from the inputs.The same case works well with the Wordpress realm too. In this if a required input is passed then a response is always awaited.A major functionality depends on the request-response on the web.The issues is undertaken because I have observed the response modules are not defined in a flawless manner.This means the application finds it hard to handle the response and trace back it to the client.If this happens and the handle is passed in a wrong perspective , the web application can get a jerk.As this analysis is based on the specific trackback page of the wordpress.For better understanding lets have a look at the response module.
	function trackback_response($error = 0, $error_message = '') {
		header('Content-Type: text/xml; charset=' . get_option('blog_charset') );
		if ($error) {
			echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
			echo "<response>\n";
			echo "<error>1</error>\n";
			echo "<message>$error_message</message>\n";
			echo "</response>";
			die();
		} else {
			echo '<?xml version="1.0" encoding="utf-8"?'.">\n";
			echo "<response>\n";
			echo "<error>0</error>\n";
			echo "</response>";
		}
	}
	
	
Lets see what happens if a flaw occurs in this:

Example:



[5] Calling Undefined Functions. | Untamed Modular Calls
I have noticed one specific ingreee flaw in which an error occurred while callling of undefined module.When I enumerated this issue , i"ve found that this type of error is stringent and often undertaken in wordpress based web applications. This is code specific because an undefined reference is made to the modular object that not even exist.This makes the wordpress to get stuck with errors.

Example:

So a definitive output is shown based on the talk.The function is not defined and the call is subjected to it which makes the wordpress inefficient to handle the request.

There is another class of errors which occure due to inability to load modules.

Example:


I looked at the code to have touch with the error function.
	if (empty($wp)) {
		require_once('wp-config.php');
		wp('tb=1');
	}
	
So overall the issue is to check the modular functionality of defined and including procedures.