REDHAT-BUG-2496197: High severity mchange-commons-java vulnerability
mchange-commons-java is a Java library of shared utility classes used by mchange projects like the c3p0 connection pool. Prior to version 0.6.0, its JNDI ObjectFactory implementation (com.mchange.v2.naming.JavaBeanObjectFactory) will construct objects of arbitrary classes and initialize "JavaBean"-style properties, which for certain classes enables JNDI injection and "deserialization gadgets." Such initialization is unsafe for some classes: for example, setting the contentType property of a Swing JEditorPane to text/html and its text property to HTML containing a stylesheet <link> will provoke an HTTP GET on an arbitrary URL, potentially from within a trusted security domain. The problem is aggravated by the library's ReferenceIndirector, through which malicious JNDI Reference objects can be smuggled in for dereferencing wherever an application reads a Java-serialized object. This has been resolved in version 0.6.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mchange-commons-javato a version that resolves this vulnerability.Fixed in 0.6.0
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker needs a path to supply a malicious JNDI Reference to the application's JNDI ObjectFactory, or to have a malicious ReferenceIndirector payload dereferenced where the application reads a Java-serialized object. The unsafe factory can create arbitrary classes and set JavaBean-style properties.
What impact could a successful exploit have?
Impact depends on the class instantiated and properties set. The provided example causes a Swing JEditorPane to make an HTTP GET request to an attacker-chosen URL, potentially from a trusted security domain; the issue can also enable JNDI injection and deserialization-gadget behavior.
Which versions need remediation?
Versions prior to 0.6.0 are affected according to the advisory data. The issue is resolved in version 0.6.0.
How can teams identify potentially exposed application paths?
Review uses of com.mchange.v2.naming.JavaBeanObjectFactory and ReferenceIndirector, especially code that accepts or resolves JNDI Reference objects or reads Java-serialized objects. These are the locations described as capable of processing attacker-smuggled references.