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.
<html><head><!-- analytics for '"--></style></script><script>netsparker(0x0000EB)</script> --><!-- urchin start --><script type="text/javascript">var pageTracker = parent._gat._getTracker("UA-3914470-1");pageTracker._setLocalRemoteServerMode();pageTracker._setDomainName("evite.com");pageTracker._setLocalGifPath("http://utmtrk.evite.com/__utm.gif");pageTracker._setCampNameKey("se");pageTracker._setCampSourceKey("ag");pageTracker._setCampTermKey("kw");pageTracker._setCampMediumKey("md");pageTracker._setCampContentKey("lp")pageTracker._initData();pageTracker._trackPageview();pageTracker._setAllowAnchor(true);</script><!-- urchin end --><!-- Start Quantcast tag --><script type="text/javascript">parent._qacct="p-3e0fIg843QXuA";parent.quantserve();</script><!-- End Quantcast tag --></head><body></body></html>
Internal Server Error
Internal Server Error
1
TOTAL
LOW
CONFIRMED
1
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.
<html> <head> <title>Grails Runtime Exception</title> <style type="text/css"> .message { border: 1px solid black; padding: 5px; background-color:#E9E9E9; } .stack { border: 1px solid black; padding: 5px; overflow:auto; height: 300px; } .snippet { padding: 5px; background-color:white; border:1px solid black; margin:3px; font-family:courier; } </style> </head> <body> <h1>Grails Runtime Exception</h1> <h2>Error Details</h2> <div class="message"> <strong>Error 200:</strong> java.lang.NullPointerException: Cannot invoke method replaceAll() on null object<br/> <strong>Servlet:</strong> grails<br/> <strong>URI:</strong> /neo-services/grails/analytics/getAnalyticsScripts.dispatch<br/> <strong>Exception Message:</strong> Cannot invoke method replaceAll() on null object <br /> <strong>Caused by:</strong> java.lang.NullPointerException: Cannot invoke method replaceAll() on null object <br /> <strong>Class:</strong> AnalyticsService <br /> <strong>At Line:</strong> [56] <br /> <strong>Code Snippet:</strong><br /> <div class="snippet"> </div> </div> <h2>Stack Trace</h2> <div class="stack"> <pre>org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NullPointerException: Cannot invoke method replaceAll() on null object<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)<br/> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)<br/> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)<br/> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at com.evite.monitoring.sam.ProfilingFilter.doFilter(ProfilingFilter.java:53)<br/> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br/> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br/> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br/> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br/> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br/> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br/> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br/> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br/> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br/> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br/> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br/> at java.lang.Thread.run(Thread.java:595)<br/>Caused by: java.lang.NullPointerException: Cannot invoke method replaceAll() on null object<br/> at AnalyticsService.getAnalyticsScripts(AnalyticsService.groovy:56)<br/> at AnalyticsController$_closure1.doCall(AnalyticsController.groovy:7)<br/> at AnalyticsController$_closure1.doCall(AnalyticsController.groovy)<br/> ... 27 more<br/></pre> </div> </body></html>
Cookie Not Marked As HttpOnly
Cookie Not Marked As HttpOnly
1
TOTAL
LOW
CONFIRMED
1
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.
var EviteNeoConfiguration = {"evtLogoutRedirectUrl":"http://www.evite.com/pages/logout.jsp","evtLoginResourceBaseUrl":"","usingDefaultConfigValues":"false","isYmailOnlyDeployment":"true","systemTime":"1297791218841","isNeoStandaloneDeployment":"false","ads.url":"http://ad.doubleclick.net"};
Tomcat Version Disclosure
Tomcat Version Disclosure
1
TOTAL
LOW
Netsparker identified that the target web server is Tomcat. This information was gathered from the HTTP Headers.
Impact
An attacker can look for specific security vulnerabilities for the version disclosed by the SERVER header.
Remedy
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
GET /neo-services/css/ HTTP/1.1 Referer: http://new.evite.com/neo-services/css/main.css User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: new.evite.com Cookie: x-evite-uuid=f99f130e-2be3-44b8-9043-d6ea0f6b3232 Accept-Encoding: gzip, deflate
Response
HTTP/1.1 404 Not Found Server: Apache-Coyote/1.1 Content-Type: text/html;charset=utf-8 Content-Length: 1006 Expires: Tue, 15 Feb 2011 17:33:40 GMT Cache-Control: max-age=0, no-cache, no-store Pragma: no-cache Date: Tue, 15 Feb 2011 17:33:40 GMT Connection: keep-alive
<html><head><title>Apache Tomcat/6.0.18 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /neo-services/css/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/neo-services/css/</u></p><p><b>description</b> <u>The requested resource (/neo-services/css/) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.18</h3></body></html>
Apache Coyote Version Disclosure
Apache Coyote Version Disclosure
1
TOTAL
LOW
Netsparker identified that the target web server is disclosing Apache Coyote version in 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 Apache.
Impact
An attacker can look for specific security vulnerabilities for the version identified in the SERVER header. The attacker can also use this information in conjunction with the other vulnerabilities in the application or the web server.
Remedy
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
var EviteNeoConfiguration = {"evtLogoutRedirectUrl":"http://www.evite.com/pages/logout.jsp","evtLoginResourceBaseUrl":"","usingDefaultConfigValues":"false","isYmailOnlyDeployment":"true","systemTime":"1297791218841","isNeoStandaloneDeployment":"false","ads.url":"http://ad.doubleclick.net"};
Forbidden Resource
Forbidden Resource
1
TOTAL
INFORMATION
CONFIRMED
1
Access to this resource has been denied by the web server. This is generally not a security issue, and is reported here for information purposes.