频道栏目
首页 > 资讯 > 安全公告 > 正文

修复Apache Flex BlazeDS中的漏洞

15-11-23        来源:[db:作者]  
收藏   我要投稿

 

 

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版本中修复了该漏洞,在此之前的所有版本均受影响。

相关TAG标签
上一篇:试问哪个企业家不想要一个《金蝉脱壳》里史泰龙那样的外挂?
下一篇:金蝶协作办公系统存在五个高危SQL注入漏洞
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站