Struts1 では、 CVE-2014-0114によるクラスローダの脆弱性の問題があると聞きました。しかし、この点を私のプロジェクトで再現することはできません。この問題を再現する方法を教えてください。私はグーグルで検索しましたが、再現の手順はありません。
Web プロジェクトに、 、 、 struts-1.1
、Jboss -4.2.3.GA
をApache 2.2.0
使用MySql 5.0.37
し て います。JKMod
JDK 1.6.0_12
Ant 1.7.0
Struts1 では、 CVE-2014-0114によるクラスローダの脆弱性の問題があると聞きました。しかし、この点を私のプロジェクトで再現することはできません。この問題を再現する方法を教えてください。私はグーグルで検索しましたが、再現の手順はありません。
Web プロジェクトに、 、 、 struts-1.1
、Jboss -4.2.3.GA
をApache 2.2.0
使用MySql 5.0.37
し て います。JKMod
JDK 1.6.0_12
Ant 1.7.0
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)
Metasploit ベースのエクスプロイトは、GitHub ( https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/struts_code_exec_classloader.rb)およびhttp://downloads.securityfocus で入手できます。 com/vulnerabilities/exploits/65999.rb . 参照については、 http://www.rapid7.com/db/modules/exploit/multi/http/struts_code_exec_classloaderを参照してください。
defaultAssertionStatus = enabled;
上記の解決策に加えて、 ClassLoader の行にブレークポイントを追加setDefaultAssertionStatus
し、行 private boolean にウォッチャーを追加することdefaultAssertionStatus = false;
は、上記の url の変更が機能しているかどうかを確認する優れた方法であること?class.classLoader.defaultAssertionStatus=true
を指摘したいと思います。
お役に立てれば!
このようなものはテストするために機能します(少なくともコードでは)
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);
}