This analysis compose of the active module checking derived from AJAX based applications.This vulnerability
or bad programming practise makes the web application vulnerable to XSS scripting and other Javascript
injections. The issue have been encountered when I was undertaking the security and weaknesses of AJAX
applications. The stress of this analysis is to explain the infection vector and how the vector is
intensified.In this very generic LaodTab Modules are analysed which are used very often in onr or other way.
A brief overview.
Accessing Web Server Realm:
The XMLHttpRequest object provides two properties that provide access to the server response.The first property,
responseText, simply provides the response as a string. The second property,responseXML, provides the response as
an XML object. Retrieving the response as simple text is fine for simple use cases, such as when the response is
displayed in an alert box or the response is a simple one-word phrase indicating success or failure.The overall
concept we know.Lets start directly with analysis.

First of all I would like to present the designed Load Tab
module.Lets have a look.
function loadTab(tabID,contentID,divIDPrefix) {
if(divIDPrefix!=null) divID = divIDPrefix + "_tabDiv";
else divID = "tabDiv";
// Tab Classes
document.getElementById(tabRegistered[divIDPrefix]).className = 'light_tab';
document.getElementById(tabRegistered[divIDPrefix] + '_A').className = '';
tabRegistered[divIDPrefix] = divIDPrefix + "_" + tabID;
document.getElementById(divIDPrefix + "_" + tabID).className = 'dark_tab';
document.getElementById(divIDPrefix + "_" + tabID + '_A').className = 'white';
// Loading
document.getElementById(divID).innerHTML = "";
divRegistered = divID;
if (window.XMLHttpRequest) {
loadTabResponse = new XMLHttpRequest();
}
if (window.ActiveXObject) {
loadTabResponse = new ActiveXObject('Microsoft.XMLHTTP');
}
loadTabResponse.onreadystatechange = loadTab_processChange;
loadTabResponse.open('GET',"[URL]?ajaxRequest=true[]loadTab="+tabID+ "[]id="+contentID);
loadTabResponse.send(null);
}
function loadTab_processChange() {
if (loadTabResponse.readyState == 4) document.getElementById(divRegistered).innerHTML = loadTabResponse.responseText;
}
The [] Corresponds to ampersand symbol in above code.
The basic points:
<?php
$a = explode('[]', $QUERY_STRING);
$i = 0;
while ($i < count($a)) {
$b = split('=', $a[$i]);
echo 'Value for parameter ', htmlspecialchars(urldecode($b[0])),
' is ', htmlspecialchars(urldecode($b[1])), "<br />\n";
$i++;
}
?>
The [] Corresponds to ampersand symbol in above code.
The above defined code is the standard code for URLdecode function.Now just have a look into
the URLEncode Function.
<?php
$query_string = 'foo=' . urlencode($foo) . '[]bar=' . urlencode($bar);
echo '<a href="mycgi?' . htmlentities($query_string) . '">';
?>
The [] Corresponds to ampersand symbol in above code.
The above modules clear the picture of URL encoding and decoding.
1. ''<>
Encoded as: id=''%3C%3E
2.''<a href="http://www.google.com">>GOOGLE</a>
Encoded as:id=''%3Ca%20href=http://www.google.com%3EGOOGLE%3C/a%3E
The output that I got:

1. I was amazed because of the fact that a single injection is diversified over whole of the PHP web
application and links are injected at every new object on the web page. 

function loadTab(tabID,contentID,divIDPrefix) {
if(divIDPrefix!=null) divID = divIDPrefix + "_tabDiv";
else divID = "tabDiv";
// Tab Classes
document.getElementById(tabRegistered[divIDPrefix]).className = 'light_tab';
document.getElementById(tabRegistered[divIDPrefix] + '_A').className = '';
tabRegistered[divIDPrefix] = divIDPrefix + "_" + tabID;
document.getElementById(divIDPrefix + "_" + tabID).className = 'dark_tab';
document.getElementById(divIDPrefix + "_" + tabID + '_A').className = 'white';
// Loading
document.getElementById(divID).innerHTML = "";
divRegistered = divID;
