Bug 1320038 - hornetq: Client deserialization of untrusted data in HornetQMessage and HornetQObjectMessage
Summary: hornetq: Client deserialization of untrusted data in HornetQMessage and Horne...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1320756 1320758 1320759
Blocks: 1320039
TreeView+ depends on / blocked
 
Reported: 2016-03-22 08:04 UTC by Adam Mariš
Modified: 2021-10-21 00:51 UTC (History)
27 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-10-21 00:51:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Adam Mariš 2016-03-22 08:04:52 UTC
It was reported that HornetQ 2.4.0 and earlier is vulnerable to deserialization of untrusted data allowing possible remote code execution. Method `getBodyInternal(Class<T> c)` in class `org.hornetq.jms.client.HornetQMessage` and method `getObject()` in class `org.hornetq.jms.client.HornetQObjectMessage` are both found to be vulnerable.

Vulnerable code:

`org.hornetq.jms.client.HornetQMessage`:

* @SuppressWarnings("unchecked")
* protected <T> T getBodyInternal(Class<T> c) throws MessageFormatException
* {
* InputStream is = ((MessageInternal)message).getBodyInputStream();
* try
* {
* ObjectInputStream ois = new ObjectInputStream(is); //<-- untrusted
* return (T)ois.readObject();
* }
* catch (Exception e)
* {
* throw new MessageFormatException(e.getMessage());
* }
* }

`org.hornetq.jms.client.HornetQObjectMessage`:

* public Serializable getObject()
* throws JMSException
* {
* if ((data == null) || (data.length == 0))
* {
* return null;
* }
*
* try
* {
* ByteArrayInputStream bais = new ByteArrayInputStream(data);
* ObjectInputStream ois = new ObjectInputStreamWithClassLoader(bais);
* return (Serializable)ois.readObject(); // <-- untrusted
*
* }
* catch (Exception e)
* {
* JMSException je = new JMSException(e.getMessage());
* je.setStackTrace(e.getStackTrace());
* throw je;
* }
* }

Comment 1 Adam Mariš 2016-03-22 08:05:13 UTC
Acknowledgments:

Name: Matthias Kaiser (Code White)

Comment 2 Jason Shepherd 2016-03-24 00:07:03 UTC
Created hornetq tracking bugs for this issue:

Affects: fedora-all [bug 1320756]

Comment 4 Jason Shepherd 2016-03-24 00:47:34 UTC
Tracker for EAP 7: https://issues.jboss.org/browse/JBEAP-3945

Comment 5 Jason Shepherd 2016-03-24 00:53:32 UTC

*** This bug has been marked as a duplicate of bug 1291292 ***


Note You need to log in before you can comment on or make changes to this bug.