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.
/* toolbar functions */ var fileSpeedStats = {}; var flashPres = true; var Playing = 0; var PlayingID = ''; var CurrentArtist =''; var CurrentTitle = ''; var CurrentAlbum = '';
/** * Displays the music player. */
// controls when to update music player var mpUpdate = false;
/** * Similar in function to the uploader, this method updates the music player * every second to repaint. */
function mpStateChange(state) { switch (state) { case 'close' : document.flashMp3Player.stopTrack(); Cookie.set('musicplayerState','minimized'); mpUpdate = false; break; case 'minimize' : Cookie.set('musicplayerState','minimized'); mpUpdate = false; // stop the updater loop break; } }
/** * Renders the currently playing track and the playlist queue. */ function updateTBMP() { if(!flashPres) { if($('tbMPCurrentTrack'))$('tbMPCurrentTrack').innerHTML='<span>Install Flash to play Music</span>'; return; } try { currentTrackStr = document.flashMp3Player.getJSCurrentTrack();
s = n.toString(); if (s.length < len) { s = ('0000000000' + n.toString()).slice(-len); }
return s; }
/** * Ran after the document has loaded to register the ability to drag files onto the music * player. */ document.observe("dom:loaded", function() { try { if(!Plugin.isInstalled('Flash')) { flashPres=false; } else { flashPres=true; }
function queueTrack() { var id = "'"--></style></script><script>netsparker(0x0001F9)</script>"; var url = ""; var name = ""; self.opener.fd.QueueSingleMp3(id, url, name); clearInterval(startupinterval); } var startupinterval = setInterval(queueTrack,500);
Netsparker identified that password data is sent over HTTP.
Impact
If an attacker can intercept network traffic he/she can steal users credentials.
Actions to Take
See the remedy for solution.
Move all of your critical forms and pages to HTTPS and do not serve them over HTTP.
Remedy
All sensitive data should be transferred over HTTPS rather than HTTP. Forms should be served over HTTPS. All aspects of the application that accept user input starting from the login process should only be served over HTTPS.
Netsparker identified Open Policy Crossdomain.xml file.
Impact
Open Policy Crossdomain.xml file allows other SWF files to make HTTP requests to your web server and see its response. This can be used for accessing one time tokens and CSRF nonces to bypass CSRF restrictions.
Remedy
Configure your Crossdomain.xml to prevent access from everywhere to your domain.
<head><title>Document Moved</title></head><body><h1>Object Moved</h1>This document may be found <a HREF="http://www.netsparker.com?incorrectlogin">here</a></body>
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.
"Auto Complete" was enabled in one or more of the form fields. These were either "password" fields or important fields such as "Credit Card".
Impact
Data entered in these fields will be cached by the browser. An attacker who can access the victim's browser could steal this information. This is especially important if the application is commonly used in shared computers such as cyber cafes or airport terminals.
Remedy
Add the attribute autocomplete="off" to the form tag or to individual "input" fields.
Actions to Take
See the remedy for the solution.
Find all instances of inputs which store private data and disable autocomplete. Fields which contain data such as "Credit Card" or "CCV" type data should not be cached. You can allow the application to cache usernames and remember passwords, however, in most cases this is not recommended.
Re-scan the application after addressing the identified issues to ensure that all of the fixes have been applied properly.
Required Skills for Successful Exploitation
Dumping all data from a browser can be fairly easy and there exist a number of automated tools to undertake this. Where the attacker cannot dump the data, he/she could still browse the recently visited websites and activate the auto-complete feature to see previously entered values.
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.
<head><title>Document Moved</title></head><body><h1>Object Moved</h1>This document may be found <a HREF="http://www.livedrive.com/portal/">here</a></body>
Netsparker identified that the target web server is disclosing ASP.NET version in the HTTP response. This information can help an attacker to develop further attacks and also the system can become an easier target for automated attacks. It was leaked from X-AspNet-Version banner of HTTP response or default ASP.NET error page.
Impact
An attacker can use disclosed information to harvest specific security vulnerabilities for the version identified. The attacker can also use this information in conjunction with the other vulnerabilities in the application or web server.
Remedy
Apply the following changes on your web.config file to prevent information leakage by using custom error pages and removing X-AspNet-Version from HTTP responses.
Netsparker identified that the target web server is disclosing the PHP version in use through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of PHP.
Impact
An attacker can look for specific security vulnerabilities for the version identified. Also the attacker can use this information in conjunction with the other vulnerabilities in the application or the web server.
This page allows users to upload files to the web server. Upload forms are generally dangerous unless they are coded with a great deal of care. This issue is reported for information only. If there is any other vulnerability identified regarding this resource Netsparker will report it as a separate issue.
Netsparker found e-mail addresses on the web site.
Impact
E-mail addresses discovered within the application can be used by both spam email engines and also brute force tools. Furthermore valid email addresses may lead to social engineering attacks .
Remedy
Use generic email addresses such as contact@ or info@ for general communications, remove user/people specific e-mail addresses from the web site, should this be required use submission forms for this purpose.
GET /portal/js.php?file=combine&group=prototype&lang=en HTTP/1.1 Referer: http://files.livedrive.com/portal/resetpassword User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: files.livedrive.com Cookie: PHPSESSID=bmtmpe9ri5esp6rama1ots7jp7 Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Cache-Control: private, max-age=10800, pre-check=10800 Pragma: private Content-Type: text/javascript Content-Encoding: Expires: Fri, 24 Jun 11 05:55:11 +0100 Vary: Accept-Encoding Server: Microsoft-IIS/7.5 X-Powered-By: PHP/5.3.5,ASP.NET X-Served-By: 101 Date: Fri, 24 Jun 2011 01:55:11 GMT Connection: close Content-Length: 68840
// Server: files.livedrive.com // Domain: livedrive.com // Memcached // Generated: June 23, 2011, 9:38 pm function localize(phrase) { var localizedStrings={ 'Product Name':'{#ProductName#}', 'Briefcase':'{#BriefcaseProduct#}', 'Backup':'{#BackupProduct#}', 'Open':'Open', 'Rename':'Rename', 'Play':'Play', 'Delete':'Delete', 'Undelete':'Undelete', 'Properties':'Properties', 'Download':'Download', 'Rename Item':'Rename Item', 'Share':'Share', 'New folder':'New folder', 'Download Files':'Download Files', 'Any in progress downloads will be aborted':'Any in progress downloads will be aborted', 'Slideshow':'Slideshow', 'Share Item':'Share Item', 'Share properties for':'Share properties for', 'Properties':'Properties', 'Add Album':'Add Album', 'First':'First', 'Last':'Last', 'No files found':'No files found', 'Name':'Name', 'Type':'Type', 'Path':'Path', 'Date':'Date', 'Recycle bin is empty':'Recycle bin is empty', 'Search returned no results':'Search returned no results', 'No files found':'No files found', 'These items have been added to your livedrive':'These items have been added to your {#ProductName#}', 'This item has been added to your livedrive':'This item has been added to your {#ProductName#}', 'Could not queue file at this time':'Could not queue file at this time', 'A file with the name':'A file with the name', 'already exists in this folder. Please try a different name.':'already exists in this folder. Please try a different name.', 'If you change a file name extension, the file may become unusable':'If you change a file name extension, the file may become unusable.\n\nAre you sure you want to change it?', 'Your file name is too long. Please enter a maximum of 256 characters':'Your file name is too long. Please enter a maximum of 256 characters', 'has been changed on another computer, please refresh':'has been changed on another computer, please refresh', 'The filename that you entered contains invalid characters. Please enter a new name.':'The filename that you entered contains invalid characters. Please enter a new name', 'Please select a file to upload':'Please select a file to upload', 'Do you want to overwrite':'Do you want to overwrite', 'Cannot upload this item, a folder with the same name already exists':'Cannot upload this item, a folder with the same name already exists', 'Sending images':'Sending images', 'Getting images':'Getting images', 'The file with name':'The file with name', 'Invalid parent, please refresh and try again':'Invalid parent, please refresh and try again', 'File type not supported':'File type not supported', 'We can not complete this move':'We can not complete this move', 'Are you sure you want to delete this item?':'Are you sure you want to delete this item?', 'Are you sure you want to delete the selected items?':'Are you sure you want to delete the selected items?', 'Warning: Removing this computer will permanently delete the files from your Livedrive account':'Warning: Removing this computer will permanently delete the files from your {#ProductName#} account. You will not be able to undo this action.\r\n\r\nRemoving this computer will have no affect on the files on your local PC. However if you do still plan to run {#ProductName#} {#BackupProduct#} on this PC then {#ProductName#} recommend you run an integrity check.\r\n\r\nAre you sure you want to remove the computer?', 'Are you sure you want to undelete selected item?':'Are you sure you want to undelete selected item?', 'items were renamed':'items were renamed', 'An error occured, please refresh and try again':'An error occured, please refresh and try again', 'Are you sure you want to empty your recycle bin, files will be permanently deleted?':'Are you sure you want to empty your recycle bin, files will be permanently deleted?', 'This version is the same as the current version':'This version is the same as the current version', 'Created':'Created', 'Last Modified':'Last Modified', 'This file is not yet uploaded':'This file is not yet uploaded', 'items selected':'items selected', 'items':'items', 'Already sharing with this user':'Already sharing with this user', '« Previous':'« Previous', 'Next »':'Next »', 'Loading...':'Loading...', 'OK':'OK', 'Yes':'Yes', 'No':'No', 'Browser not supported.':'Browser not supported.', 'Sending images to Facebook':'Sending images to Facebook', 'Sending images to Flickr':'Sending images to Flickr', 'Getting images from Facebook':'Getting images from Facebook', 'Getting images from Flickr':'Getting images from Flickr', 'No Songs':'No Songs', 'Preparing upload of':'Preparing upload of', 'Queued File Upload':'Queued File Upload', 'Successful Uploads':'Successful Uploads', 'Failed Uploads':'Failed Uploads', 'No Uploads in progress':'No Uploads in progress', 'Applications':'Applications', 'Recycle':'Recycle', 'Artist':'Artist', 'Album':'Album', 'Year':'Year', 'Genre':'Genre', 'Restore':'Restore', 'Team Folder':'Team Folder', 'already exists in the destination folder.':'already exists in the destination folder.', 'cannot be copied to a read only folder.':'cannot be copied to a read only folder.', 'Remove':'Remove', 'Business Sharing':'Business Sharing', 'New Team Folder':'New Team Folder', 'First Name':'First Name', 'Last Name':'Last Name', 'Email Address':'Email Address', 'Copy to briefcase':'Copy to {#BriefcaseProduct#}', 'You cannot move this item to the selected location. Please select a different location and try again.':'You cannot move this item to the selected location. Please select a different location and try again.', 'You cannot copy this item to the selected location. Please select a different location and try again.':'You cannot copy this item to the selected location. Please select a different location and try again.', 'We can not complete this copy':'We can not complete this copy'
};
return(brandify(localizedStrings[phrase]));
} function brandify(phrase) { if(phrase == undefined) return ''; phrase=phrase.replace(/{#ProductName#}/g,'Livedrive'); phrase=phrase.replace(/{#BriefcaseProduct#}/g,'Briefcase'); phrase=phrase.replace(/{#BackupProduct#}/g,'Backup'); return phrase }/* Prototype JavaScript framework, version 1.6.0.3 * (c) 2005-2008 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/
if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false;
/* Based on Alex Arnell's inheritance implementation. */ var Class = { create: function() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift();
function klass() { this.initialize.apply(this, arguments); }
Object.extend = function(destination, source) { for (var property in source) destination[property] = source[property]; return destination; };
Object.extend(Object, { inspect: function(object) { try { if (Object.isUndefined(object)) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } },
toJSON: function(object) { var type = typeof object; switch (type) { case 'undefined': case 'function': case 'unknown': return; case 'boolean': return object.toString(); }
if (object === null) return 'null'; if (object.toJSON) return object.toJSON(); if (Object.isElement(object)) return;
var results = []; for (var property in object) { var value = Object.toJSON(object[property]); if (!Object.isUndefined(value)) results.push(property.toJSON() + ': ' + value); }
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.
Netsparker identified that the response from the page returned an HTTP Redirect Status but output more information than usual. This generally indicates that after redirect, page did not finish the response as it was supposed to.
Impact
This can lead serious issues such authentication bypass in authentication required pages, in other pages it generally indicates a programming error.
Remedy
Finish the HTTP Response after you redirect the user.
In ASP.NET use Response.Redirect("redirected-page.aspx", true); instead of Response.Redirect("redirected-page.aspx", false);
In PHP applications call exit(); after you redirect the user.
if (singleFractional) { unit = baseNumber; unitLabel = unitLabels.length >= unitDivisors.length ? unitLabels[unitDivisors.length - 1] : ""; for (i = 0; i < unitDivisors.length; i++) { if (baseNumber >= unitDivisors[i]) { unit = (baseNumber / unitDivisors[i]).toFixed(dp); unitLabel = unitLabels.length >= i ? " " + unitLabels[i] : ""; break; } }
return unit + unitLabel; } else { var formattedStrings = []; var remainder = baseNumber;
for (i = 0; i < unitDivisors.length; i++) { unitDivisor = unitDivisors[i]; unitLabel = unitLabels.length > i ? " " + unitLabels[i] : "";
unit = remainder / unitDivisor; if (i < unitDivisors.length -1) { unit = Math.floor(unit); } else { unit = unit.toFixed(dp); } if (unit > 0) { remainder = remainder % unitDivisor;
formattedStrings.push(unit + unitLabel); } }
return formattedStrings.join(" "); } };
/** * Ripped from the swfupload.speed.js file, used to calculate a moving average over a collection of * download speeds. * * Use this rolling average to smooth out the time remaining on the download. */ calculateMovingAverage = function (history) { var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0; var i; var mSum = 0, mCount = 0;
size = history.length;
// Check for sufficient data if (size >= 8) { // Clone the array and Calculate sum of the values for (i = 0; i < size; i++) { vals[i] = history[i]; sum += vals[i]; }
mean = sum / size;
// Calculate variance for the set for (i = 0; i < size; i++) { varianceTemp += Math.pow((vals[i] - mean), 2); }
// We have the upload file object if(fileInfoStr!="" && fileInfoStr!="[]"&& fileInfoStr!=undefined ) { var onlyErrors=true;
$('tbULValue').innerHTML=fileInfoStr;
// APC: Added this enum to aid understanding the different states a file upload passes through. // It should be kept in sync with the Java Uploader Applet. /* var uploadStatusEnum = { QUEUED : -1, INPROGRESS : -2, ERROR : -3, SUCCESS : -4, CANCELLED : -5, HASHING : -7, CONFLICT : -8, SKIPPED : -9 }; */
// Build the queue of all files pending upload, not sure why it's placed into an element first. var fileInfo = $('tbULValue').innerHTML.evalJSON(); //console.log(fileInfo); fileInfo.each(function(file, index) {
// Sets the main progress panel for the current upload. if(file.Status==-2) { onlyErrors=false; $('tbULCurrentUploadImage').src= getFileTypeImage(file.Name,true); $('tbULCurrentUploadName').innerHTML= getShortenedFileName(file.Name, 30); $('tbULCurrentUploadName').title = file.Name; $('tbULCurrentUploadProg').setStyle({width:Math.floor((file.BytesSent/file.Size)*248)+'px'});
// BUG/APC: Very fast uploads do not appear to update the display // What about the case where the file upload is in progress, however no data has yet been submitted?
function getFileTypeImage(filename, isLargeIcon) {
var thumbnail = '/portal/static/images/filetypes/' + (isLargeIcon ? '32x32' : '16x16') + '/'; var fileParts = filename.split(".");
if (fileParts.length == 0) return thumbnail + 'unknown.png';
var fileType = fileParts[fileParts.length-1].toLowerCase(); var fileTypeIndex = FileTypes.indexOf(fileType); // All known file types. if (fileTypeIndex == -1) return thumbnail + 'unknow..