1 / 7

Struts1.x の脆弱性( CVE-2014-0114 ) に対する SDE の対処:推奨タイプ (サンプルソースコードの公開)

Struts1.x の脆弱性( CVE-2014-0114 ) に対する SDE の対処:推奨タイプ (サンプルソースコードの公開). 日本電気株式会社 2014 年 6 月 17 日. 対処内容の概要. BeanUtils を利用した変数コピー処理に対して、拡張機能( override )を利用して操作 して いるメソッド( populate )内でチェック 処理を追加し、問題のあるパラメータを 排除します。 ※ 監視 のために排除時 に双方式ともエラーログ を 出力します。. w eb.xml ServletContextListener.

viet
Download Presentation

Struts1.x の脆弱性( CVE-2014-0114 ) に対する SDE の対処:推奨タイプ (サンプルソースコードの公開)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Struts1.xの脆弱性(CVE-2014-0114)に対するSDEの対処:推奨タイプ(サンプルソースコードの公開)Struts1.xの脆弱性(CVE-2014-0114)に対するSDEの対処:推奨タイプ(サンプルソースコードの公開) 日本電気株式会社 2014年6月17日

  2. 対処内容の概要 • BeanUtilsを利用した変数コピー処理に対して、拡張機能(override)を利用して操作しているメソッド(populate)内でチェック処理を追加し、問題のあるパラメータを排除します。 ※監視のために排除時に双方式ともエラーログを出力します。 web.xml • ServletContextListener ServletContextListener Inner ClassSampleBeanUtilsBean ブラウザ StrutsV1.x  パラメータ排除 setAbc(“123”) getClass().getClassLoader().setXxx(“yyy”) リクエスト リクエスト abc=123class.ClassLoader.xxx=yyy abc=123class.ClassLoader.xxx=yyy エラーログを出力 BeanUtils呼び出し処理 通常のリクエスト「abc=123」 以外に 「class.ClassLoader.xxx=yyy」 を付加して送信 setAbc(“123”) getClass().getClassLoader().setXxx(“yyy”) populate() BeanUtilsBean.populate setAbc(“123”) Formクラス Public void setAbc(String abc){ this.abc = abc; }

  3. 適用要件および注意事項(1/2) • 本対処を適用した場合、リクエストパラメータの属性名(一部を含む)に対して「class」あるいは「Class」という単語を含むことができなくなります。該当の属性名を使用している場合は、属性名の見直しをお願いします。 • チェック対象となる文字列例を下記に記載いたします。 • チェック対象外の文字列 • classic • FirstClass • チェック対象の文字列 • .Class.

  4. 適用要件および注意事項(2/2) • 以下のメソッドの動作が変更されるために、該当メソッドに依存する機能がある場合は影響調査する必要があります。org.apache.commons.beanutils.BeanUtils#populate(Object bean, Map properties)具体的には、引数properties中に“class”または“Class”が含まれるキー属性のエントリーは引数beanに対して移送処理が行われなくなります。本条件に該当しない場合、本回避策による影響はございません。

  5. 適用手順 ① 本対処を実現したソースコードを実装する ※実装サンプルは下記にて公開しています。★http://jpn.nec.com/SystemDirectorEnterprise/dl/notice/SampleServletContextListener.java ② web.xml の web-app.listener要素にServletコンテキストリスナの設定を追記する ③ ビルド・デプロイを実施する

  6. テスト実施手順 GETメソッドの場合 • 正常動作する画面のURLに「?class.ClassLoader.xxx=yyy」を付加して実行例:正常に動作するURL「http://localhost/Sample/TestAction.do」の場合「http://localhost/Sample/TestAction.do?class.ClassLoader.xxx=yyy」をブラウザで表示 • 上記URLを実行した場合に正常に画面が表示され、ログファイルに以下の文字列が出力されるかを確認「malicious access detected, key = class.ClassLoader.xxx value = yyy」 POSTメソッドの場合 • 正常動作する画面に以下のhidden項目を追加<input type=“hidden” name=“class.ClassLoader.xxx” value=“yyy”> • 上記画面を実行した場合に正常に画面が表示され、ログファイルに以下の文字列が出力されるかを確認「malicious access detected, key = class.ClassLoader.xxxvalue = yyy」

More Related