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.
GET /Affiliate/login.aspx?__EVENTARGUMENT=3&__EVENTTARGET=3&__EVENTVALIDATION=%2fwEWBQLamuiTCALM2PtaAqrXg84MAsqE5dYOArK44tQL9uq0HQMjsgiMOe0UEfKSghKS%2fKE%3d&__VIEWSTATE=%2fwEPDwUKMTAzOTU2MDUyMA9kFgICAw9kFgICAw9kFgJmD2QWAmYPZBYCZg8PFgIeB1Zpc2libGVoZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFDWNoa1N0b3JlTG9naW51%2fYNyCGjdzADuCcmVFEYPcdK9%2bQ%3d%3d&chkStoreLogin=3&LoginName=%00%27%22--%3E%3C%2Fstyle%3E%3C%2Fscript%3E%3Cscript%3Enetsparker(0x00005D)%3C%2Fscript%3E&LoginPassword=3&SubmitButton=Login HTTP/1.1 Referer: http://publisher.mediapass.com/Affiliate/login.aspx User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: publisher.mediapass.com Cookie: ASP.NET_SessionId=01qqfv55fire0c55mpyuxu45 Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Cache-Control: private Content-Length: 572 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:57:54 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x00005D)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x00005D)</script>') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x00005D)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x00005D)</script>') And LoginPassword=N'3'
GET /Affiliate/login.aspx?__EVENTARGUMENT=3&__EVENTTARGET=3&__EVENTVALIDATION=%2fwEWBQLamuiTCALM2PtaAqrXg84MAsqE5dYOArK44tQL9uq0HQMjsgiMOe0UEfKSghKS%2fKE%3d&__VIEWSTATE=%2fwEPDwUKMTAzOTU2MDUyMA9kFgICAw9kFgICAw9kFgJmD2QWAmYPZBYCZg8PFgIeB1Zpc2libGVoZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFDWNoa1N0b3JlTG9naW51%2fYNyCGjdzADuCcmVFEYPcdK9%2bQ%3d%3d&chkStoreLogin=3&LoginName=Ronald%20Smith&LoginPassword=%00%27%22--%3E%3C%2Fstyle%3E%3C%2Fscript%3E%3Cscript%3Enetsparker(0x000079)%3C%2Fscript%3E&SubmitButton=Login HTTP/1.1 Referer: http://publisher.mediapass.com/Affiliate/login.aspx User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: publisher.mediapass.com Cookie: ASP.NET_SessionId=01qqfv55fire0c55mpyuxu45 Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:58:11 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x000079)</script>'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x000079)</script>'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 572 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:58:37 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0000F2)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0000F2)</script>') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0000F2)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0000F2)</script>') And LoginPassword=N'3'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:58:41 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x000110)</script>'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x000110)</script>'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 572 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:58:47 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x00011A)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x00011A)</script>') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x00011A)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x00011A)</script>') And LoginPassword=N'3'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:58:52 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x00012D)</script>'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x00012D)</script>'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 572 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:59:24 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0001C5)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0001C5)</script>') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0001C5)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0001C5)</script>') And LoginPassword=N'3'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 572 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:59:27 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0001CC)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0001CC)</script>') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N' ''"--></style></script><script>netsparker(0x0001CC)</script>' Or Email=N' ''"--></style></script><script>netsparker(0x0001CC)</script>') And LoginPassword=N'3'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:59:28 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x0001D5)</script>'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x0001D5)</script>'
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:59:31 GMT
Incorrect syntax near ''. Unclosed quotation mark after the character string ''.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x0001DB)</script>'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'Ronald Smith' Or Email=N'Ronald Smith') And LoginPassword=N' ''"--></style></script><script>netsparker(0x0001DB)</script>'
Password Transmitted Over HTTP
Password Transmitted Over HTTP
1
TOTAL
IMPORTANT
CONFIRMED
1
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.
"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.
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.
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.
GET /Affiliate/login.aspx?__EVENTARGUMENT=3&__EVENTTARGET=3&__EVENTVALIDATION=%2fwEWBQLamuiTCALM2PtaAqrXg84MAsqE5dYOArK44tQL9uq0HQMjsgiMOe0UEfKSghKS%2fKE%3d&__VIEWSTATE=%2fwEPDwUKMTAzOTU2MDUyMA9kFgICAw9kFgICAw9kFgJmD2QWAmYPZBYCZg8PFgIeB1Zpc2libGVoZGQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFDWNoa1N0b3JlTG9naW51%2fYNyCGjdzADuCcmVFEYPcdK9%2bQ%3d%3d&chkStoreLogin=3&LoginName=http://netsparker.com/n?%00.aspx&LoginPassword=3&SubmitButton=Login HTTP/1.1 Referer: http://publisher.mediapass.com/Affiliate/login.aspx User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: publisher.mediapass.com Cookie: ASP.NET_SessionId=3dblco45rajq5xaqa1uovnzy Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Cache-Control: private Content-Length: 496 Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/7.0 X-AspNet-Version: 2.0.50727 P3P: CP="NOI DSP COR NID ADMa OPTa OUR NOR" X-Powered-By: ASP.NET Date: Fri, 18 Mar 2011 21:57:23 GMT
Incorrect syntax near 'http://netsparker.com/n?'. Unclosed quotation mark after the character string 'http://netsparker.com/n?'.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'http://netsparker.com/n? .aspx' Or Email=N'http://netsparker.com/n? .aspx') And LoginPassword=N'3'Thread was being aborted.<p>SELECT AffiliateID From tblaff_Affiliates (NOLOCK) Where (LoginName=N'http://netsparker.com/n? .aspx' Or Email=N'http://netsparker.com/n? .aspx') And LoginPassword=N'3'
ViewState is not Encrypted
ViewState is not Encrypted
1
TOTAL
LOW
Netsparker identified that the target web application doesn't use encryption on ViewState data.
Impact
An attacker can study the application's state management logic for possible vulnerabilities and if your application stores application-critical information in the ViewState; it will also be revealed.
Remedy
ASP.NET provides encryption for ViewState parameters.
For page based protection, place the following directive at the top of affected page.
<%@Page ViewStateEncryptionMode="Always" %>
You can also set this option for the whole application by using web.config files. Apply the following configuration for your application's web.config file.
/Affiliate/login.aspx application debugging not enabled.
IIS Version Disclosure
IIS Version Disclosure
1
TOTAL
INFORMATION
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.