博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
更新struts2到2.3.32
阅读量:551 次
发布时间:2019-03-09

本文共 1502 字,大约阅读时间需要 5 分钟。

背景:

struts2近日被曝存在远程代码执行的严重漏洞。目前Struts2官方已经确认漏洞

(漏洞编号
S2-045
,CVE编号:
cve-2017-5638
),并定级为高危。

由于该漏洞影响范围极广(Struts2.3.5 - Struts 2.3.31, Struts 2.5 - Struts 2.5.10),

漏洞危害程度极为严重,可直接获取应用系统所在服务器的控制权限。

漏洞相关信息请参考:http://www.myhack58.com/Article/html/3/62/2017/84040.htm


如果你当前的项目使用了
Struts2.3.5至 Struts 2.3.31版本
或者
Struts 2.5至Struts 2.5.10版本

必须替换的jar包:

1.
xwork-core-2.3.32.jar

2.
struts2-json-plugin-2.3.32.jar

3.
struts2-core-2.3.32.jar

可能需要替换或增加的jar包:

1.
struts2-spring-plugin-2.3.32.jar

2.
ognl-3.0.19.jar

3.
javassist-3.11.0.GA.jar

4.
freemarker-2.3.22.jar


可能需要增加的文件

1. struts-tags.tld (如果页面中有使用到struts标签的话,需要放置在WEB-INF文件夹下)

jar下载地址:

http://mvnrepository.com

https://.oschina/liufile/tools/attach_files

notes: 如果更新版本之后报如下错误:

Exception sending context initialized event to listener instance of class org.apache.struts2.tiles.StrutsTilesListener: java.lang.Nul

lPointerException
        at org.apache.tiles.util.URLUtil.getBaseTilesDefinitionURLs(URLUtil.java:54) [tiles-core-2.2.2.jar:2.2.2]
        at org.apache.struts2.tiles.StrutsTilesContainerFactory.getSourceURLs(StrutsTilesContainerFactory.java:229) [struts2-tiles-plugin-2
.3.32.jar:2.3.32]

可能是某些tiles文件找不到, 因为web.xml里默认的配置是

<context-param>

    <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
    <param-value>/tiles/tiles-common.xml,/tiles/tiles-auth.xml,/tiles/tiles-developer.xml,/tiles/tiles-seller.xml,/tiles/tiles-guest.xml,/tiles/tiles-admin.xml</param-value>
  </context-param>

看看这些tiles文件你本地是不是都有,如果没有并且没用就把web.xml里配置的对应tiles删除。

转载地址:http://urhiz.baihongyu.com/

你可能感兴趣的文章