2

Struts1 では、 CVE-2014-0114によるクラスローダの脆弱性の問題があると聞きました。しかし、この点を私のプロジェクトで再現することはできません。この問題を再現する方法を教えてください。私はグーグルで検索しましたが、再現の手順はありません。

Web プロジェクトに、 、 、 struts-1.1Jboss -4.2.3.GAApache 2.2.0使用MySql 5.0.37し て います。JKModJDK 1.6.0_12Ant 1.7.0

4

5 に答える 5

11

Struts アクションにマップされた URL の呼び出しを試みます (アクション フォームによってサポートされます)。フレームワークは、クエリ パラメータからフォーム Bean を設定しようとします。したがって、 のようなクエリ パラメータがある場合は?class.classLoader.defaultAssertionStatus=true、 に変換されformBean.getClass().getClassLoader().setDefaultAssertionStatus(true)ます。

デバッグ ログを有効にしている場合は、次のメッセージが表示されます。

2014-05-05 12:57:50,238 DEBUG [org.apache.struts.action.RequestProcessor]  Populating bean properties from this request
2014-05-05 12:57:50,238 DEBUG [org.apache.commons.beanutils.BeanUtils] BeanUtils.populate(com.xxx.struts.demo.web.form.SimpleForm@71909bc, {class.classLoader.defaultAssertionStatus=[Ljava.lang.String;@a6b23fd4})
2014-05-05 12:57:50,238 DEBUG [org.apache.commons.beanutils.BeanUtils]   setProperty(com.xxx.struts.demo.web.form.SimpleForm@71909bc, class.classLoader.defaultAssertionStatus, [true])
2014-05-05 12:57:50,246 DEBUG [org.apache.commons.beanutils.BeanUtils]     Target bean = com.ibm.ws.classloading.internal.AppClassLoader@3ac10955
2014-05-05 12:57:50,246 DEBUG [org.apache.commons.beanutils.BeanUtils]     Target name = defaultAssertionStatus
2014-05-05 12:57:50,250 DEBUG [org.apache.commons.beanutils.ConvertUtils] Convert string 'true' to class 'boolean'
2014-05-05 12:57:50,250 DEBUG [org.apache.commons.beanutils.ConvertUtils]   Using converter org.apache.commons.beanutils.converters.BooleanConverter@de2943ef
2014-05-05 12:57:50,250 DEBUG [org.apache.commons.beanutils.PropertyUtils] setSimpleProperty: Invoking method public void java.lang.ClassLoader.setDefaultAssertionStatus(boolean) with value true (class java.lang.Boolean)
于 2014-05-05T07:35:25.193 に答える
0

defaultAssertionStatus = enabled;上記の解決策に加えて、 ClassLoader の行にブレークポイントを追加setDefaultAssertionStatusし、行 private boolean にウォッチャーを追加することdefaultAssertionStatus = false;は、上記の url の変更が機能しているかどうかを確認する優れた方法であること?class.classLoader.defaultAssertionStatu‌​s=trueを指摘したいと思います。

お役に立てれば!

于 2015-12-14T13:49:52.267 に答える
0

このようなものはテストするために機能します(少なくともコードでは)

      try {
        PropertyUtils.getNestedProperty(this, "class");
        Logger.error(this, "SECURITY ISSUE- `class` attribute NOT DISABLED for BeanUtil introspection, See: CVE-2014-0114 ");
      } catch (java.lang.NoSuchMethodException nse) {
        Logger.info(this, "`class` is disabled as a property for introspection in struts for security");
      } catch (Exception e) {
        Logger.warn(this, e.getMessage(), e);
      }
于 2018-09-11T14:38:39.163 に答える