【发布时间】:2014-02-24 16:43:51
【问题描述】:
我们使用自动安全探测,它揭示了一个漏洞,该漏洞导致 500 响应返回默认错误。 JRun返回错误的信息泄漏被认为是漏洞。这个 500 错误发生在 JRun 中的 CF 上方,无法由 CF 处理。
这是一个测试代码sn-p导致内部JRun错误:
<cfhttp url="https://www.domain.com/FormController.cfc" method="post" result="r"><cfhttpparam type="header" name="Accept" value="text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" />
<cfhttpparam type="header" name="Accept-Charset" value="ISO-8859-1,utf-8;q=0.7,*;q=0.7" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip;q=1.0, x-gzip;q=0.9, x-bzip2;q=0.9, deflate;q=0.8, identity;q=0.5, base64;q=0.1, quoted-printable;q=0.1, compress;q=0, *;q=0" />
<cfhttpparam type="header" name="Accept-Language" value="en-us,en;q=0.5" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1 WhiteHat Security" />
<cfhttpparam type="header" name="Content-Length" value="158" />
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="body" value="Method=%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216%u002e%u002e%u2216boot%u002eini%00">
</cfhttp>
<cfdump var="#r#">
<cfoutput>#r.filecontent#</cfoutput>
我使用了此处提供的信息: Handling 500 JRun servlet in ColdFusion 将自定义处理程序添加到 JRun 以处理 500 错误,如下所示:
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/error-pages/500error.jsp</location>
</error-page>
500error.jsp 文件仅输出一些基本信息,例如“Opps an error occurred...”以及状态码和消息,但不输出堆栈跟踪。
这在我使用 CF9 Developer 版本的 MBP 开发中运行良好。当我昨晚将它投入生产时(在 CF9 Standard / Win2k 服务器上),我希望它能够正常工作。当我再次使用请求运行测试 sn-p 时,它没有返回自定义错误,而是返回了标准错误 servlet 错误。我仔细检查了路径,并认为jsp中可能有错误。我改成纯html还是默认错误。
出于纯粹的随机性,我尝试了http://www.domain.com/error-pages/500error.jsp。除了 404 之外,我没有任何事情会发生,但我实际上得到了这个:
500
A License exception has occurred: You tried to access a restricted feature for the Standard edition: JSP
coldfusion.license.LicenseManager$LicenseIllegalAccessException: A License exception has occurred: You tried to access a restricted feature for the Standard edition: JSP
at coldfusion.license.LicenseManager.byte(Unknown Source)
at coldfusion.license.LicenseManager.checkJSP(Unknown Source)
at coldfusion.license.JspLicenseServlet.service(Unknown Source)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
那么,jsp似乎不是标准版的功能?所以我然后尝试将 500error.jsp 更改为 500error.html。更改文件名,使其成为静态 html,更新 web.xml,重新启动,现在我在 POST 和点击 http://www.domain.com/error-pages/500error.html 时收到 403 Forbidden。
所以我不确定发生了什么。标准版是否不允许像这样在 JRun 级别进行自定义处理?它适用于开发人员版,因为它基本上不受限制?在文档中找不到答案。除了 JRun 解决方案之外,还有其他方法可以处理这 500 个吗?
谢谢
【问题讨论】:
-
您是否尝试为错误页面提供 .cfm 页面?我很好奇这是否有效?
-
不走运。使用 /WEB-INF/error-pages/500error.cfm 导致标准 CF file not found 错误,即找不到路径下的文件。
-
只是开玩笑,您是否尝试过使用位于其他地方(即
/web-inf/之外)的 html 页面?
标签: jsp coldfusion error-handling jrun