【发布时间】:2016-03-03 13:44:22
【问题描述】:
我使用 Acunetix Vulnerability Scanner 对我的 Web 应用程序进行了审核,开发人员报告告诉我:
/referentiels-web/j_spring_cas_security_check
Details
URL encoded GET input ticket was set to ST-1664-V7HlBALHdSMeqYmAjHL9-passeport01.brgm-rec.fr'"()&%<acx><ScRiPt>qvVq(9803)</ScRiPt>
>qvVq(9803)</ScRiPt>
GET /referentiels-web/authfailed.jsp;jsessionid=83A16DB68D05ECF865408DAC009A0DAF HTTP/1.1
Referer: https://myapp.com:443/referentiels-web/
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.21 (KHTML, like Gecko)
Chrome/41.0.2228.0 Safari/537.21
Accept: */*
Host: Rgf-ref.brgm-rec.fr
但是当 当我尝试重现这个 xss 漏洞时, 我无法重现,为什么..?
我的测试网址:
https://myapp.com:443/referentiels-web/authfailed.jsp;jsessionid=83A16DB68D05ECF865408DAC009A0DAF?<sc ript>alert('test')</sc ript>
authfailed.jsp:
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.web.WebAttributes" %>
<html>
<head>
<title>Login to CAS failed!</title>
</head>
<body>
<h2>Login to CAS failed!</h2>
<font color="red">
Your CAS credentials were rejected.<br/><br/>
Reason: <%= ((AuthenticationException) session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION)).getMessage() %>
</font>
</body>
</html>
【问题讨论】:
-
好吧,让我们从如何您尝试复制开始
-
@cricket_007 我已经这样做了
https://myapp.com:443/referentiels-web/authfailed.jsp;jsessionid=83A16DB68D05ECF865408DAC009A0DAF?<sc ript>alert('test')</sc ript> -
你在网址栏中输入了那个?我认为这不是 XSS,因为您的网站没有评估脚本标签
-
@cricket_007 是的,我在我的网址栏中输入了它
-
长话短说,向用户显示堆栈跟踪是个坏主意,请不要这样做。这对用户体验不利(它使您的网站看起来笨拙和损坏),它对用户没有帮助(用户不阅读错误消息),并且在安全方面,它揭示了有关您的系统的不必要的细节,在这种情况下,它容易受到 XSS 攻击,因为您回显了一条异常消息,其中可能包含一些未经处理的用户输入。