SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Even though Netsparker believes that there is a SQL Injection in here it could not confirm it. There can be numerous reasons for Netsparker not being able to confirm this. We strongly recommend investigating the issue manually to ensure that it is an SQL Injection and that it needs to be addressed. You can also consider sending the details of this issue to us, in order that we can address this issue for the next time and give you a more precise result.
Impact
Depending on the backend database, database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
Reading, Updating and Deleting arbitrary data from the database
Executing commands on the underlying operating system
Reading, Updating and Deleting arbitrary tables from the database
Actions to Take
See the remedy for solution.
If you are not using a database access layer (DAL) within the architecture consider its benefits and implement if appropriate. As a minimum the use of s DAL will help centralize the issue and its resolution. You can also use an ORM (object relational mapping). Most ORM systems use parameterized queries and this can solve many if not all SQL Injection based problems.
Locate all of the dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM, change all legacy code to use these new libraries)
Monitor and review weblogs and application logs in order to uncover active or previous exploitation attempts.
Remedy
A very robust method for mitigating the threat of SQL Injection based vulnerabilities is to use parameterized queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.
Required Skills for Successful Exploitation
There are numerous freely available tools to test for SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them. SQL Injection is one of the most common web application vulnerabilities.
<font face="Arial" size=2><p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%27' at line 1</font><p><font face="Arial" size=2>/123/Visitor/vInclude.asp</font><font face="Arial" size=2>, line 813</font>
if (window.XMLHttpRequest){ XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject){ XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp"); }
<script language="javascript"> function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; }
function getWindowWidth() { var windowWidth = 0; if (typeof(window.innerWidth) == 'number') { windowWidth = window.innerWidth; } else { if (document.documentElement && document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { if (document.body && document.body.clientWidth) { windowWidth = document.body.clientWidth; } } } return windowWidth; }
function setDivSizeOnload(divname) {
var htmlcode_bottom_h = document.getElementById('htmlcode_bottom').offsetHeight; var htmlcode_left_w = document.getElementById('htmlcode_left').offsetWidth; var htmlcode_right_w = document.getElementById('htmlcode_right').offsetWidth;
var gutter_padding_left = 10; var gutter_padding_right = 10; var gutter_padding_bottom = 0;
var logo_h = document.getElementById('logo_div').offsetHeight;
var offset_width = 5; var offset_height = 5;
var framecontent_obj = document.getElementById(divname);
</script> <font face="Arial" size=2><p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+' at line 1</font><p><font face="Arial" size=2>/475/operator/guest/gInclude/gInclude_OfflineFrame.asp</font><font face="Arial" size=2>, line 450</font>
if (window.XMLHttpRequest){ XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject){ XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp"); }
<script language="javascript"> function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') { windowHeight = window.innerHeight; } else { if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else { if (document.body && document.body.clientHeight) { windowHeight = document.body.clientHeight; } } } return windowHeight; }
function getWindowWidth() { var windowWidth = 0; if (typeof(window.innerWidth) == 'number') { windowWidth = window.innerWidth; } else { if (document.documentElement && document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else { if (document.body && document.body.clientWidth) { windowWidth = document.body.clientWidth; } } } return windowWidth; }
function setDivSizeOnload(divname) {
var htmlcode_bottom_h = document.getElementById('htmlcode_bottom').offsetHeight; var htmlcode_left_w = document.getElementById('htmlcode_left').offsetWidth; var htmlcode_right_w = document.getElementById('htmlcode_right').offsetWidth;
var gutter_padding_left = 10; var gutter_padding_right = 10; var gutter_padding_bottom = 0;
var logo_h = document.getElementById('logo_div').offsetHeight;
var offset_width = 5; var offset_height = 5;
var framecontent_obj = document.getElementById(divname);
</script> <font face="Arial" size=2><p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+' at line 1</font><p><font face="Arial" size=2>/475/operator/guest/gInclude/gInclude_OfflineFrame.asp</font><font face="Arial" size=2>, line 450</font>
XSS (Cross-site Scripting) allows an attacker to execute a dynamic script (Javascript, VbScript) in the context of the application. This allows several different attack opportunities, mostly hijacking the current session of the user or changing the look of the page by changing the HTML on the fly to steal the user's credentials. This happens because the input entered by a user has been interpreted as HTML/Javascript/VbScript by the browser.
XSS targets the users of the application instead of the server. Although this is a limitation, since it allows attackers to hijack other users' session, an attacker might attack an administrator to gain full control over the application.
Impact
There are many different attacks that can be leveraged through the use of XSS, including:
Hi-jacking users' active session
Changing the look of the page within the victims browser.
Mounting a successful phishing attack.
Intercept data and perform man-in-the-middle attacks.
Remedy
The issue occurs because the browser interprets the input as active HTML, Javascript or VbScript. To avoid this, all input and output from the application should be filtered. Output should be filtered according to the output format and location. Typically the output location is HTML. Where the output is HTML ensure that all active content is removed prior to its presentation to the server.
Prior to sanitizing user input, ensure you have a pre-defined list of both expected and acceptable characters with which you populate a white-list. This list needs only be defined once and should be used to sanitize and validate all subsequent input.
There are a number of pre-defined, well structured white-list libraries available for many different environments, good examples of these include, OWASP Reform and Microsoft Anti Cross-site Scripting libraries are good examples.
if ('' != '0'){ //if there is a departmentid in the parameter, always use that one. embed_departmentid = ''; //drawback, user might want 0, but there is a embed_departmentid set. so, not sure what to do. }
if (! document.getElementById('wsa_embed_closeimg')){ //only do this if icon appears initially. create the divs, but dont src the iframe for chat router
//show bottom div with icon var minimize_div_html = '<div onclick="maximize_embed();" style="border:0px solid white;width:'+iwidth+'px; height:'+iheight+'px;"></div>';
//if you max after initial tab is shown on page. it loads the chat.
if (document.getElementById('wsa_embed_iframe').src == '' ){
var url_chatstart = 'http://a4.websitealive.com/669/rRouter.asp?iniframe=embedded&groupid=669&departmentid='+embed_departmentid+'&websiteid=0&loginname=&loginquestion=';
A Cookie was not marked as secure and transmitted over HTTPS. This means the cookie could potentially be stolen by an attacker who can successfully intercept and decrypt the traffic or following a successful MITM (Man in the middle) attack.
Impact
This cookie will be transmitted over a HTTP connection, therefore if this cookie is important (such as a session cookie) an attacker might intercept it and hijack a victim's session. If the attacker can carry out a MITM attack, he/she can force victim to make a HTTP request to steal the cookie.
Actions to Take
See the remedy for solution.
Mark all cookies used within the application as secure. (If the cookie is not related to authentication or does not carry any personal information you do not have to mark it as secure.))
Remedy
Mark all cookies used within the application as secure.
Required Skills for Successful Exploitation
To exploit this issue, the attacker needs to be able to intercept traffic. This generally requires local access to the web server or victim's network. Attackers need to be understand layer 2, have physical access to systems either as way points for the traffic, or locally (have gained access to) to a system between the victim and the web server.
The Server responded with an HTTP status 500. This indicates that there is a server-side error. Reasons may vary. The behavior should be analysed carefully. If Netsparker is able to find a security issue in the same resource it will report this as a separate vulnerability.
Impact
The impact may vary depending on the condition. Generally this indicates poor coding practices, not enough error checking, sanitization and whitelisting. However there might be a bigger issue such as SQL Injection. If that's the case Netsparker will check for other possible issues and report them separately.
Remedy
Analyse this issue and review the application code in order to handle unexpected errors, this should be a generic practice which does not disclose further information upon an error. All errors should be handled server side only.
<font face="Arial" size=2><p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1</font><p><font face="Arial" size=2>/205/Include/adInclude.asp</font><font face="Arial" size=2>, line 955</font>
Cookie was not marked as HTTPOnly. HTTPOnly cookies can not be read by client-side scripts therefore marking a cookie as HTTPOnly can provide an additional layer of protection against Cross-site Scripting attacks..
Impact
During a Cross-site Scripting attack an attacker might easily access cookies and hijack the victim's session.
Actions to Take
See the remedy for solution
Consider marking all of the cookies used by the application as HTTPOnly (After these changes javascript code will not able to read cookies.
Remedy
Mark the cookie as HTTPOnly. This will be an extra layer of defence against XSS. However this is not a silver bullet and will not protect the system against Cross-site Scripting attacks. An attacker can use a tool such as XSS Tunnel to bypass HTTPOnly protection.
// keep on page function URLEncode(plaintext) { // The Javascript escape and unescape functions do not correspond // with what browsers actually do... var SAFECHARS = "0123456789" + // Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()"; // RFC2396 Mark characters var HEX = "0123456789ABCDEF";
//var plaintext = document.URLForm.F1.value; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "%20"; // x-www-urlencoded, rather than %20 } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += "%20"; } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for
//---------------------------------------------------------------- // keep on page
function callServer(url) {
var sRn=Math.random();
var wsa_head_obj = document.getElementsByTagName('head').item(0); var old = document.getElementById('vtracker'); if (old){ if (old.readyState=="loading"){ //let the old script complete return; } wsa_head_obj.removeChild(old); } try{
var s = document.createElement('script'); url = url + '&random=' + sRn;
// keep on page function pollVisitor() { var url = "http://a4.websitealive.com/669/visitor/vTrackerSrc_v2.asp?action=poll&groupid=669&websiteid=0&departmentid=0&sessionid_=17319321424374" + urlstr; callServer(url); }
//This function gets the sessiontimeout set by admin. If visitor has left page open longer then sessiontimeout, then they will stop pinging the server. // keep on page function checkProcess(landingTime) {
var sessiontimeout = 1800;
var newTime = new Date(); var tDiff = (newTime - landingTime) / 1000; // diff in seconds
//alert(tDiff); if ((sessiontimeout == 0) || (sessiontimeout > tDiff)) //if no timeout or still active { pollVisitor(); //keep processing; }else{ //do nothing }
// asp code free - ON PAGE ON PAGE, loads if there is a div_embed id, calls the createWsaEmbedDiv() function // this fires up only if you have a button there. var wsa_embed_html = ''; var wsa_embed_x; var wsa_embed_y; var wsa_embed_position; var wsa_embed_zIndex;
function start_embed(){
var wsa_embed_obj = document.getElementById('wsa_embed');
if (wsa_embed_obj){
//if there is element on page by user, dont do nothing. save the text in variable wsa_embed_html wsa_embed_html = wsa_embed_obj.innerHTML;
The error message may disclose sensitive information and this information can be used by an attacker to mount new attacks or to enlarge the attack surface. In rare conditions this may be a clue for an SQL Injection vulnerability. Most of the time Netsparker will detect and report that problem separately.
Remedy
Do not provide any error messages on production environments. Save error messages with a reference number to a backend storage such as a text file or database, then show this number and a static user-friendly error message to the user.
<font face="Arial" size=2><p>Microsoft OLE DB Provider for ODBC Drivers</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1</font><p><font face="Arial" size=2>/205/Include/adInclude.asp</font><font face="Arial" size=2>, line 955</font>
Netsparker identified a programming error message.
Impact
The error message may disclose sensitive information and this information can be used by an attacker to mount new attacks or to enlarge the attack surface. Source code, stack trace, etc. type data may be disclosed. Most of these issues will be identified and reported separately by Netsparker.
Remedy
Do not provide error messages on production environments. Save error messages with a reference number to a backend storage such as a log, text file or database then show this number and a static user-friendly error message to the user.
<html><head><title>Error</title></head><body><head><title>Directory Listing Denied</title></head><body><h1>Directory Listing Denied</h1>This Virtual Directory does not allow contents to be listed.</body></body></html>
Netsparker identified that the target web server is disclosing the web server's version in the HTTP response. This information can help an attacker to gain a greater understanding of the system in use and potentially develop further attacks targeted at the specific web server version.
Impact
An attacker can look for specific security vulnerabilities for the version identified through the SERVER header information.
Remediation
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.