前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >VMware更新 | 修复Apache Flex BlazeDS中的漏洞

VMware更新 | 修复Apache Flex BlazeDS中的漏洞

作者头像
FB客服
发布2018-02-07 11:34:45
1.7K0
发布2018-02-07 11:34:45
举报
文章被收录于专栏:FreeBufFreeBufFreeBuf

VMware发布了数个产品的版本更新,目的是修复Apache Flex BlazeDS中的一个漏洞。

据VMware介绍,Flex BlazeDS组件应用在数个公司产品中,但是其上存在XML外部实体(XXE)漏洞,可被攻击者远程利用,发送一条特制的XML请求,服务器便会泄露信息。

FreeBuf百科:BlazeDS

BlazeDS是一个基于服务器的Java远程调用(remoting)和web消息传递(messaging)技术,使得后台的Java应用程序可以和运行在浏览器上的Flex应用程序能够互相通信。

简单来说一个BlazeDS应用包括客户端(Flex或AIR应用程序)和一个服务端(J2EE程序)。BlazeDS在期间起着承上启下的作用,Flex和BlazeDS可以通过RemoteObject,HttpService,WebService三种。

受影响的产品

该漏洞对VMware vCenter Server 5.0、5.1、5.5,vCloud Director 5.5、5.6,Horizon View 5.0、6.0均有影响。

但随着VMware vCenter Server 5.0u3e、5.1u3b、5.5u3,vCloud Director 5.5.3、5.6.4,Horizon View 5.3.4、6.1新版本的更新,问题已被解决。vCenter Server 6.0不受影响。

Apache Flex BlazeDS漏洞(CVE-2015-3269)存在于BlazeDS远程/AMF协议实现中,是Matthias Kaiser于8月份发现,并在其博客中发布了漏洞的细节和利用方法。

漏洞细节

AMF消息包括头部和主体两部分。为了解析AMF主体,需要调用AmfMessageDeserializer的method readBody()。Method可以读取目标URI、响应URI和主体的长度。随后,method readObject()也会被调用。

/* */ public void readBody(MessageBody body, int index) /* */ throws ClassNotFoundException, IOException /* */ { /* 158 */ String targetURI = amfIn.readUTF(); /* 159 */ body.setTargetURI(targetURI); /* 160 */ String responseURI = amfIn.readUTF(); /* 161 */ body.setResponseURI(responseURI); /* */ /* 163 */ amfIn.readInt(); /* */ /* 165 */ amfIn.reset(); /* */ /* */ /* 168 */ if (isDebug) { /* 169 */ debugTrace.startMessage(targetURI, responseURI, index); /* */ } /* */ Object data; /* */ try { /* 173 */ data = readObject(); /* */ } /* */ catch (RecoverableSerializationException ex) /* */ { /* 177 */ ex.setCode("Client.Message.Encoding"); /* 178 */ data = ex; /* */ } /* */ catch (MessageException ex) /* */ { /* 182 */ ex.setCode("Client.Message.Encoding"); /* 183 */ throw ex; /* */ } /* */ /* 186 */ body.setData(data); /* */ /* 188 */ if (isDebug) { /* 189 */ debugTrace.endMessage(); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ public Object readObject() /* */ throws ClassNotFoundException, IOException /* */ { /* 199 */ return amfIn.readObject(); /* */ } /* */ }

Amf0Input例子中,object的type是从下一个字节中读取的。如果type的值是15,下面主体的字节就会以method readXml()解析。

/* */ public Object readObject() /* */ throws ClassNotFoundException, IOException /* */ { /* 91 */ int type = in.readByte(); /* */ /* 93 */ Object value = readObjectValue(type); /* 94 */ return value; /* */ } /* */ /* */ protected Object readObjectValue(int type) throws ClassNotFoundException, IOException /* */ { /* 99 */ Object value = null; /* 100 */ switch (type) /* */ { /* */ case 0: /* 103 */ value = Double.valueOf(readDouble()); /* 104 */ break; /* */ ... /* */ /* */ case 15: /* 147 */ value = readXml(); /* 148 */ break; /* */ .... /* */ protected Object readXml() throws IOException /* */ { /* 511 */ String xml = readLongUTF(); /* */ /* 513 */ if (isDebug) { /* 514 */ trace.write(xml); /* */ } /* 516 */ return stringToDocument(xml); /* */ } /* */

/* */ /* */ public static Document stringToDocument(String xml, boolean nameSpaceAware) /* */ { /* 116 */ ClassUtil.validateCreation(Document.class); /* */ /* 118 */ Document document = null; /* */ try /* */ { /* 121 */ if (xml != null) /* */ { /* 123 */ StringReader reader = new StringReader(xml); /* 124 */ InputSource input = new InputSource(reader); /* 125 */ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); /* 126 */ factory.setNamespaceAware(nameSpaceAware); /* 127 */ factory.setValidating(false); /* 128 */ DocumentBuilder builder = factory.newDocumentBuilder(); /* */ /* 130 */ document = builder.parse(input); /* */ } /* */ } /* */ catch (Exception ex) /* */ { /* 135 */ throw new MessageException("Error deserializing XML type " + ex.getMessage()); /* */ } /* */ /* 138 */ return document; /* */ } /* */ }

利用方法

利用起来非常的简单,只需发送一条XXE向量。

Apache在 Flex BlazeDS 4.7.1版本中修复了该漏洞,在此之前的所有版本均受影响。

* 参考来源securitywee,转载请注明来自FreeBuf黑客与极客(FreeBuf.COM)

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2015-11-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 FreeBuf 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档