簡單的重復造一個輪子,漏洞危害蠻大的
影響版本:Struts 2.3.5 - Struts 2.3.31,Struts 2.5 - Struts 2.5.10
僅供學習測試使用,嚴禁非法操作!
修復建議:
1.很官方的解釋 升級struts2版本
2.做過濾器
獲取Content-Type的值,如果包含了某些特征進行過濾pass(治標不治本,有被繞過的可能) //當時寫的也被證實了,確實存在繞過S2-046,所以大家盡量升級。
類似:(網上隨意找,僅供參考思路)
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,FilterChain chain) throws ServletException, IOException { String contentType=request.getContentType(); if(contentType!=null&&contentType.indexOf("ognl")!=-1){ //特征字符 System.out.println(contentType); return; }else{ chain.doFilter(request, response); } }