Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Java provides several APIs that allow outside external programs to monitor a running Java program. These APIs also permit the Java program to be monitored remotely by programs on distinct hosts. Such features are convenient for debugging the program or fine-tuning its performance. However, if a Java program is deployed in production with remote monitoring enabled, an attacker can connect to the JVM and inspect its behavior and data, including potentially sensitive information. An attacker can also exert some control over the program's behavior. Consequently, remote monitoring must be disabled when running a Java program in production.

...

The JVMTI contains extensive facilities to find out learn about the internals of a running JVM, including facilities to monitor and modify a running Java program. These facilities are rather low level and require the use of the Java Native Interface (JNI) and C Language language programming. However, they provide the opportunity to access fields that would not normally be accessibleinaccessible. Also, there are facilities that can change the behavior of a running Java program (for example, threads can be suspended or stopped). The JVMTI profiling tools can also measure the time that a thread takes to execute, leaving applications vulnerable to timing attacks.

...

Wiki Markup
The Java Platform Debugger Architecture (JPDA) builds on the JVMTI and provides high-level facilities for debugging Java systems while they are running \[[JPDA 2004|AA. Bibliography#JPDA 2004]\]. 

The JDPA JPDA facilities are similar to the reflection API, which is described in rule SEC05-J. Do not use reflection to increase accessibility of classes, methods, or fields. In particular, the JPDA provides methods to get and set field and array values. Access control is not enforced, so that even the values of private fields can be set by a remote process via the JPDA.

...

These facilities can be used either locally (from on the machine that runs the JVM) or remotely. Local monitoring and management is enabled by default when a JVM is started; remote monitoring and management is not. For a JVM to be monitored and managed remotely, it must be started with various system properties set (either on the command line or in a configuration file).

...

There are also provisions to require proper authentication of the remote server. However, users may start a JVM with remote monitoring and management enabled, but with no security, and ; this would leave the JVM open to attack from by outsiders. Although accidently enabling remote monitoring and management is unlikely, users might not realize that starting a JVM so enabled, without any security, could leave their JVM exposed to attack.

...

The JPDA host can serve either as a server or as a client. When the attacker cannot sniff the network to determine the identity of machines that use the JPDA host (for example, through the use of a secure channel), specify the JPDA host as the client and the debugger application as the server by changing the value of the server argument to n.

...

ENV05-EX0: A Java program may be remotely monitored using any of these technologies when if it can be guaranteed that no program outside the local trust boundary can access the program. For example, if the program lives on a local network that is both completely trusted and disconnected from any larger untrusted networks, including the Internet, remote monitoring is permitted.

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ENV05-J

high

probable

low

P18

L1

Automated Detection

Not This rule is not amenable to automated static analysis.

Bibliography

Related Vulnerabilities

CVE-2010-4495 describes a vulnerability in the TIBCO ActiveMatrix product line where a flaw in JMX connection processing allowed remote users to execute arbitrary code, cause denial of service or obtain potentially sensitive information.

Bibliography

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7696a2911e6efc60-f4dd9886-460d4180-bda9b8e2-ff5ceec0eec2fb49a2ce6f8d"><ac:plain-text-body><![CDATA[

[[JMX 2006

AA. Bibliography#JMX 06]]

 

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="847744f738a01d99-dfbf07ac-457f48ea-be0ca1c6-eabfccbff68707244f90d6f9"><ac:plain-text-body><![CDATA[

[[JMXG 2006

AA. Bibliography#JMXG 06]]

 

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8339c85c1780e1ad-f74f0234-4c184a49-b6fe8ab6-d6f7191c8237f43e042aca3c"><ac:plain-text-body><![CDATA[

[[JPDA 2004

AA. Bibliography#JPDA 04]]

 

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a51507c3f55b803e-6b38f15f-4d4d4d46-87db8aa5-3b15d9698b3ef13a19e25418"><ac:plain-text-body><![CDATA[

[[JVMTI 2006

AA. Bibliography#JVMTI 06]]

 

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bab13842fa0114e4-0f17e8f7-46f14fb2-a9aba2a5-edaaeecbcd0c581b66eb9981"><ac:plain-text-body><![CDATA[

[[Long 2005

AA. Bibliography#Long 05]]

Section 2.6, The JVM Tool Interface; Section 2.7, Debugging; Section 2.8, Monitoring and Management

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ae98426f04b7f2ca-a48ecb8b-4dd94701-9f419ca7-4dcfdc52c4530c6c3f760106"><ac:plain-text-body><![CDATA[

[[Reflect 2006

AA. Bibliography#Reflect 06]]

[Reflection

http://java.sun.com/javase/6/docs/technotes/guides/reflection/index.html], Sun Microsystems, Inc. (2006)

]]></ac:plain-text-body></ac:structured-macro>

...