An unauthenticated remote attacker can execute arbitrary Python bytecode (via jython) on the JBoss Operations Network server. Testing was performed against JBoss ON 3.3.0.GA Update 05 on Ubuntu 16.04 using OpenJDK 188.8.131.52. The ON server, in this case, is installed in the user’s base directory (i.e.
For the annotated version of this issue, read below. For a really detailed explanation of how the issue was found, along with all of the sorcery and magic used to figure it out, check out Jacob's blog on this vulnerability!
Red Hat notified the community of a deserialization vulnerability in Operations Network (ON) in early May. The vulnerability was assigned CVE-2016-3737. A comment in the associated Bugzilla entry specifically mentions the Apache Commons Collections library. While investigating this vulnerability to write a Nessus remote plugin, we noted that this bug was patched in the most recent set of ON patches (released in February) by updating the Commons Collections library to the most recent version that disables serialization of the various transform objects.
Jython and Serialization
Jython is “an implementation of the python language for the Java platform.” according to the Jython FAQ. Alvaro Munoz and Christian Schneider contributed “
Jython1” to ysoserial in March of 2016. Their serialization attack leverages Jython to execute Python bytecode that writes a file to disk. Specifically, their Jython1 module writes a webpage to a location provided by the attacker so that an attacker can then navigate to that webpage and execute arbitrary commands.
As noted by CVE-2016-3737, the ON agent and server communicate via serialized objects. Specifically, the agent sends HTTP POST requests to “
/jboss-remoting-servlet-invoker/ServerInvokerServlet/?generalizeSocketException=true” with a payload of an
org.jboss.remoting.InvocationRequest object. The way CVE-2016-3737 was fixed (updating Commons Collections) does not solve any other potential problems that deserializing untrusted network data may introduce. Looking through the code base for new or known serialization gadgets we came across Jython repackaged in a JAR called “
rhq-scripting-python-4.12.0.JON330GA.jar”. This library can be found in the shared libraries under
modules/org/rhq/server-startup/main/deployments/rq.ear/lib/. Tenable created two exploits to demonstrate this for Red Hat, but not will be sharing them publicly. We're selfish like that.