This is more of a browser vulnerability than a website vulnerability in Internet Explorer since 2010 :
Checkmarkx Research Labs has identified a new critical vulnerability in Internet Explorer (other browsers probably display in the same way), which will allow hackers to easily compromise web applications.
This is a violation of the same browser origin policy, and this is not something you should fix in your web application. The reported vulnerability probably refers to the redirect you do based on
request.getSession().getAttribute("sesStrUID")!=null
state. He says that if you redirect the server side based on the sesStrUID session sesStrUID , then the attacker can IFrame on your website, and if he detects that you are redirecting, he can conclude whether sesStrUID null or not.
This is only a problem if your users use a broken browser. If your users use modern browsers, then it is not worth fixing IMO. If you want to be more secure as well as protect against click attacks, you can output X-Frame-Options: DENY HTTP header to prevent cropping. Please note that this will only protect you from the IFrame attack version. For other attack vectors discussed in detail, check out this XSHM paper .
Edit after @adar answer :
Adar's answer is very similar to mine and contains a lot of the same information, except that the poster claims that this is still a problem.
However, XSHM is not a problem if you redirect the server part through the location HTTP header . HTTP 3xx redirects do not increase the value of history.length in modern browsers, so it cannot be used to determine whether a user is logged on to a particular site.
If you send JavaScript code to redirect after
if(request.getSession().getAttribute("sesStrUID")!=null)
then XSHM is a problem if you redirect the server side
<% String redirectURL = "http://example.com/myJSPFile.jsp"; response.sendRedirect(redirectURL); %>
then you are not vulnerable.
Edit after @adar II answer :
@adar is correct: if you try the following attack scenario:
- Open
Login.jsp in an Login.jsp - the history contains Login.jsp . - Open
ShowSecretInfo.jsp - if the server then redirects to Login.jsp using HTTP 3xx, then history.length will remain the same, if the server shows ShowSecretInfo.jsp - history.length will be increased by 1.
Therefore, if history.length increases, you can determine that the user is logged in. I could recreate the above with IE 11 and Firefox 33.1 on Windows 7. Chrome 39 is not vulnerable in this way from my tests, but this is different:
Assuming /ShowSecretInfo.jsp redirected to /Login.jsp (without request) if the user is not logged in.
- Open
/ShowSecretInfo.jsp in an /ShowSecretInfo.jsp - the story contains /ShowSecretInfo.jsp . - Set IFrame src to
/Login.jsp - if history.length does not increase, you know that the user is logged in.
It seems like Chrome is not trying to redirect if src already set to the current URL. I could also recreate this in IE and Firefox.