LoginSignup
5

More than 5 years have passed since last update.

RedhatのStruts1脆弱性(CVE-2014-0114)対応 Part.2

Posted at

前回に続いて今度はRPMのバイナリを調べてみる。

調査対象

CentOS用にリリースされていたバイナリ。64bit版だけど調べたいのはjarなのでどれでもいいかと思う。

RPMの中身

  • /usr/share/doc/struts-1.2.9/STATUS.txt
  • /usr/share/doc/struts-1.2.9/LICENSE.txt
  • /usr/share/doc/struts-1.2.9/README
  • /usr/share/doc/struts-1.2.9/INSTALL
  • /usr/share/doc/struts-1.2.9/NOTICE.txt
  • /usr/share/java/struts-1.2.9.jar
  • /usr/share/java/struts.jar -> struts-1.2.9.jar
  • /usr/share/struts/struts-nested.tld
  • /usr/share/struts/struts-config_1_1.dtd
  • /usr/share/struts/validator-rules.xml
  • /usr/share/struts/struts-config_1_0.dtd
  • /usr/share/struts/struts-tiles.tld
  • /usr/share/struts/struts-bean.tld
  • /usr/share/struts/struts-config_1_2.dtd
  • /usr/share/struts/struts-logic.tld
  • /usr/share/struts/web-app_2_2.dtd
  • /usr/share/struts/struts-html.tld
  • /usr/share/struts/web-app_2_3.dtd
  • /usr/share/struts/tiles-config_1_1.dtd
  • /usr/lib64/gcj/struts/struts-1.2.9.jar.db
  • /usr/lib64/gcj/struts/struts-1.2.9.jar.so

対応方法

今回はLinuxで実際にインストールして試したわけじゃないけど、 /usr/share/java/struts-1.2.9.jar が脆弱性対応されたモジュール本体である。もちろん、こんな場所にあっても通常は役に立たないので、これを各Webアプリケーションの WEB-INF/lib/ にある strutsXXX.jar と置き換えて配置してやる必要がある。

Windows7 + Java7 + Tomcat8.0.5 の環境で struts-example.war で確認したところ、当然のように出回っている POC は防ぐことができた!
(Redhatの修正は、攻撃を検知しても例外を出すわけでなく 単に無視するだけであることに注意

JARの中身

struts-1.2.9.jar を展開してみた。

META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 4.1.2 20080704 (Red Hat 4.1.2-54) (Free Software Foundatio
n, Inc.)
Extension-Name: Struts Framework
Specification-Title: Struts Framework
Specification-Vendor: The Apache Software Foundation
Specification-Version: 1.2.9
Implementation-Title: Struts Framework
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 1.2.9
Class-Path: commons-beanutils.jar commons-digester.jar commons-fileup
load.jar commons-logging.jar commons-validator.jar jakarta-oro.jar

Create-By: Red Hat となっている。

$ javap -v org/apache/struts/Globals.class | grep version 
minor version: 0
major version: 46

major version: 46 なのでJDK1.2用にコンパイルされていることが分かる。Struts1なのでJavaも古いバージョンを利用しているかもしれないけど、これなら安心か?
さすが、Red Hatさん!抜かり無い(笑)

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5