본문 바로가기

Server

Apache Struts2 원격명령 실행공격에 따른 패치작업


Apache Struts2 원격명령 실행공격에 따른 패치작업

 

톰캣 서버에 대한 Apache Struts2 원격명령 실행공격 권고문이 7월중에 발표되어 있으며,
근래들어 해당 취약점을 이용한 공격이 급증하고 있습니다.
이에 따라, 패치작업을 진행하여야 합니다.

 

## Apache Struts2 원격명령 실행공격  ##
 
- 참조:http://asec.ahnlab.com/957
- 내용
  1) 공격 유형 : 원격 코드 삽입 및 실행
  2) 영향 받는 소프트 웨어  : Struts 2.0.0 ~ Struts 2.3.15
  3) 위험도 : 매우 위험
- 해결책
  1) 업데이트 : Struts 2.3.15 이하 버전은 모두 2.3.15.1로  업데이트
   현재 Struts 2.0.11.1 버전 사용
- 작업범위 :

1. 소스 수정(Java, Jsp파일, 설정파일) 

- org.apache.commons.lang import 변경
  before : import org.apache.commons.lang.StringUtils; 
  after  : import org.apache.commons.lang3.StringUtils;   

 

- web.xml 수정
 before :
    <filter>
     <filter-name>struts2</filter-name>
     <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
  after  :  
    <filter>
     <filter-name>struts2</filter-name>
     <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>

- struts-xxxx.xml 수정
   before :
    <result type="redirect-action">rcvMemoList</result>
  after  :  
    <result type="redirectAction">rcvMemoList</result>


2. Library 수정(7개), 추가(1개)                   

- delete jar version
  commons-fileupload-1.2.1.jar
  commons-io-1.4.jar
  commons-lang-2.4.jar
  commons-logging-1.0.4.jar
  ognl-2.6.11.jar
  struts2-core-2.0.11.1.jar
  struts2-spring-plugin-2.0.11.1.jar
- update jar version
  commons-fileupload-1.3.jar
  commons-io-2.0.1.jar
  commons-lang3-3.1.jar
  commons-logging-1.1.3.jar
  ognl-3.0.6.jar
  struts2-core-2.3.15.1.jar
  struts2-spring-plugin-2.3.15.1.jar
- add jar
  javassist-3.11.0.GA.jar

 

3. 참조사이트

http://blog.visualp.com/181
http://cjb2300.tistory.com/6
http://weblog4j.com/2011/08/23/creating-a-new-struts2-project-in-eclipse-with-struts2-archetype-starter-using-m2eclipse/