Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

CVE-2014-3518 は JBoss 製品に影響を及ぼしますか?

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
  • Red Hat JBoss BRMS (BRMS)
    • 5.x
  • Red Hat JBoss SOA Platform (SOA-P)
    • 5.x
  • Red Hat JBoss Portal (JPP)
    • 5.x

Issue

  • サポート対象の Red Hat JBoss 5.x 製品と JBoss Application Server 5 には JBoss Remoting が含まれます。これには、JMX リモート設定の仕様である JSR 160 が一部実装されます。

  • この実装は jmx-remoting.sar で提供されます。JBoss Application Server 5.x でサポート対象外であるコミュニティリリースにデフォルトでデプロイされます。この実装では、セキュリティの実装について JSR 160 に準拠していないため、認証または承認制約は適用されません。リモートアタッカーはこれを利用して、脆弱性のあるサーバーで悪意のあるコードを実行することができました。この不具合は CVE-2014-3518 によって特定されました。

  • この問題は JBoss 製品に影響を及ぼしますか?

  • jmx-remoting.sar を Jboss インスタンスにデプロイしていない場合、JBoss Remoting の脆弱性 CVE-2014-3518 は Red Hat JBoss EAP 5 に影響を及ぼしますか?

Resolution

  • デフォルトでは、サポートされるすべての Red Hat JBoss 5.x 製品は影響を受けません。これらの製品は、jboss-as/docs/examples ディレクトリから手動で jmx-remoting.sar をデプロイしたために JMX リモート設定が有効になっている場合に限り脆弱性があります。サポート対象外であるコミュニティリリースの JBoss Application Server 5.x はデフォルトで影響を受けます。また、スタンドアロンの JBoss Remoting プロジェクトのユーザーはすべて影響を受けます。

  • サーバーが影響を受け、アプリケーションで JMX リモート設定が必要でない場合は、jmx-remoting.sar をアンデプロイする必要があります。JMX リモート設定が必要な場合には、保護する必要があります。

ファイルアクセスにパスワードを設定する方法

# Enable the jconsole agent locally
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"

# Tell JBossAS to use the platform MBean server
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

# Make the platform MBean server able to work with JBossAS MBeans
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

# Set the port
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=19988"

# Enable security using user/pass in properties file
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=$JBOSS_HOME/bin/jmxremote.password -Dcom.sun.management.jmxremote.access.file=$JBOSS_HOME/bin/jmxremote.access"
  • パスワードを設定しないと、com.sun.management.jmxremote.access.file$JAVA_HOME/jre/lib/management/jmxremote.access に、そして com.sun.management.jmxremote.password.file$JAVA_HOME/jre/lib/management/jmxremote.password にデフォルトで設定されます。

  • ユーザー名とパスワードは jmxremote.password に定義されます (テンプレートは $JAVA_HOME/jre/lib/management/jmxremote.password.template)。

  • たとえば、以下のように、パスワードが redhat である管理ユーザーと、ユーザー名が monitor でパスワードが jboss であるユーザーを追加します。

admin redhat
monitor jboss
  • ユーザーのロールは jmxremote.access に定義され、readonlyreadwrite の 2 つのロールがあります。したがって、ユーザーに mbeans の読み取り権限を、そして管理者には読み書き権限を設定できます。
admin readwrite
monitor readonly
  • 次に、jmx:rmi:///jndi/rmi://127.0.0.1:19988/jmxrmi で、サービスが接続するかをテストします。
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import java.util.Map;
import java.util.HashMap;

    // this is the port that you configure in $JBOSS_HOME/bin/run.conf
    int portNum = 19988;

    // the hostName should be set to the ip / hostname that the JBoss you want to call is listening upon
    String serviceURL = "service:jmx:rmi:///jndi/rmi://"+ hostName + ":"+ portNum +  "/jmxrmi";

    // Create a JMXServiceURL
    JMXServiceURL u = new JMXServiceURL(serviceURL);

    // If you have authentication enabled, configure the username / password credentials
    Map environment = new HashMap(1);
    String[] credentials = {user, pass};
    environment.put(JMXConnector.CREDENTIALS, credentials);

    // connect to the JMXServiceURL using the given environment properties (If you have authentication disabled, you can remove the environment) 
    JMXConnector c = JMXConnectorFactory.connect(u, environment);

    // Get the MBeanServer connection which has the API to get and call the MBeans
    MBeanServerConnection server = c.getMBeanServerConnection();

    // Test by getting the number of mbeans
    System.out.println("MBean Count:" + server.getMBeanCount());

    // Cleanup 
    if(c != null) {
       c.close();
    }

Diagnostic Steps

  • システムに脆弱性があるがどうかを特定するには、Red Hat access labs detector tool を使用してください。
    jmx-remoting.sar が有効で影響を受けると、以下のようなログが記録されます。
$ java -jar CVE-2014-3518-SAFE.jar -H 127.0.0.1 -r 19988
[CVE-2014-3518] Testing RMI via remote connections ... 
[CVE-2014-3518] Testing with host::127.0.0.1 rmi-port::19988
[CVE-2014-3518] 
[CVE-2014-3518] Testing mail service ... 
[CVE-2014-3518] jboss:service=Mail.getJNDIName returned java:/Mail
[CVE-2014-3518] MailService returned as expected, VULNERABLE
  • JBoss EAP 5.x で jmx-remoting.sar が設定されていない場合 (デフォルト) は、以下のログが記録されます。
$ java -jar CVE-2014-3518-SAFE.jar -H 127.0.0.1 -r 1090
[CVE-2014-3518] Testing RMI via remote connections ... 
[CVE-2014-3518] Testing with host::127.0.0.1 rmi-port::1090
[CVE-2014-3518] RMI Server returned unknown host, poisoning cache to try again ... 
[CVE-2014-3518] Could not make an RMI connection, skipping.Reason:Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException:Connection refused to host:127.0.0.1; nested exception is: 
    java.net.ConnectException:Connection refused]

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments