下载5.0.2的版本来分析

5.0.2的war包地址 http://archive.apache.org/dist/roller/roller-5/v5.0.2/bin/roller-weblogger-5.0.2-for-javaee.zip

从web.xml入手分析,可以看到如下servlet映射

    <servlet>
<servlet-name>XmlRpcServlet</servlet-name>
<servlet-class>org.apache.xmlrpc.webserver.XmlRpcServlet</servlet-class>
<init-param>
<description>
Sets, whether the servlet supports vendor extensions for XML-RPC.
</description>
<param-name>enabledForExtensions</param-name>
<param-value>true</param-value>
</init-param>
</servlet>

指向org.apache.xmlrpc.webserver.XmlRpcServlet的类。

从doPost看起

    public void doPost(HttpServletRequest pRequest, HttpServletResponse pResponse) throws IOException, ServletException {
        private XmlRpcServletServer server;
        server.execute(pRequest, pResponse);
}

指向org.apache.xmlrpc.webserver.XmlRpcServletServer

	public void execute(HttpServletRequest pRequest, HttpServletResponse pResponse)
throws ServletException, IOException {
XmlRpcHttpRequestConfigImpl config = getConfig(pRequest);
ServletStreamConnection ssc = newStreamConnection(pRequest, pResponse);
try {
super.execute(config, ssc);
} catch (XmlRpcException e) {
throw new ServletException(e);
}
}

  

看到super.execute(config, ssc); 这行指向父类的execute方法

public class XmlRpcServletServer extends XmlRpcHttpServer

  父类为XmlRpcHttpServer,在父类中没找到execute方法,继续向上调用XmlRpcStreamServer类

public abstract class XmlRpcHttpServer extends XmlRpcStreamServer

  

在XmlRpcStreamServer类存在execute方法

	public void execute(XmlRpcStreamRequestConfig pConfig,
ServerStreamConnection pConnection)
throws XmlRpcException {
log.debug("execute: ->");
try {
Object result;
Throwable error;
InputStream istream = null;
try {
istream = getInputStream(pConfig, pConnection);
XmlRpcRequest request = getRequest(pConfig, istream);
result = execute(request);
istream.close();
istream = null;
error = null;
log.debug("execute: Request performed successfully");
} catch (Throwable t) {
logError(t);
result = null;
error = t;
} finally {
if (istream != null) { try { istream.close(); } catch (Throwable ignore) {} }
}
      .......//省略后面无关代码
      }

  

看到其中的 XmlRpcRequest request = getRequest(pConfig, istream); ,调用当前类的getRequest方法。

	protected XmlRpcRequest getRequest(final XmlRpcStreamRequestConfig pConfig,
InputStream pStream) throws XmlRpcException {
final XmlRpcRequestParser parser = new XmlRpcRequestParser(pConfig, getTypeFactory());
final XMLReader xr = SAXParsers.newXMLReader();
xr.setContentHandler(parser);
.....//省略后面无关代码
}

  

在getRequest()方法中有这么一句:XMLReader xr = SAXParsers.newXMLReader();

public class SAXParsers {
private static final SAXParserFactory spf;
static {
spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(false);
} /** Creates a new instance of {@link XMLReader}.
*/
public static XMLReader newXMLReader() throws XmlRpcException {
try {
return spf.newSAXParser().getXMLReader();
} catch (ParserConfigurationException e) {
throw new XmlRpcException("Unable to create XML parser: " + e.getMessage(), e);
} catch (SAXException e) {
throw new XmlRpcException("Unable to create XML parser: " + e.getMessage(), e);
}
}
}

  其中:

		spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(false);

  

直接引用xml文档,没做访问限制,所有造成了xxe漏洞

修复方式:

Apache Roller 5.0.3 XXE漏洞分析的更多相关文章

  1. Apache Log4j 反序列化代码执行(CVE-2019-17571) 漏洞分析

    Apache Log4j 漏洞分析 仅用于研究漏洞原理,禁止用于非法用途,后果自负!!! CVE-2019-17571 漏洞描述 Log4j是美国阿帕奇(Apache)软件基金会的一款基于Java的开 ...

  2. Beescms_v4.0 sql注入漏洞分析

    Beescms_v4.0 sql注入漏洞分析 一.漏洞描述 Beescms v4.0由于后台登录验证码设计缺陷以及代码防护缺陷导致存在bypass全局防护的SQL注入. 二.漏洞环境搭建 1.官方下载 ...

  3. 从0开始fastjson漏洞分析2

    从0开始fastjson漏洞分析https://www.cnblogs.com/piaomiaohongchen/p/14777856.html 有了前文铺垫,可以说对fastjson内部机制和fas ...

  4. PHPCMS V9.6.0 SQL注入漏洞分析

    0x01 此SQL注入漏洞与metinfo v6.2.0版本以下SQL盲注漏洞个人认为较为相似.且较为有趣,故在此分析并附上exp. 0x02 首先复现漏洞,环境为: PHP:5.4.45 + Apa ...

  5. 从0开始fastjson漏洞分析

    关于fastjson漏洞利用参考:https://www.cnblogs.com/piaomiaohongchen/p/10799466.html fastjson这个漏洞出来了很久,一直没时间分析, ...

  6. xxe漏洞分析

    xxe漏洞总结 xxe漏洞就是xml外部实体注入攻击,所以一定是针对xml编写的服务. xxe漏洞是把参数经过php输入流或者$HTTP_RAW_POST_DATA直接读入xml实体当中,参数可控且没 ...

  7. ECShop 2.x 3.0代码执行漏洞分析

    0×00 前言 ECShop是一款B2C独立网店系统,适合企业及个人快速构建个性化网上商店.2.x版本跟3.0版本存在代码执行漏洞. 0×01 漏洞原理 ECShop 没有对 $GLOBAL[‘_SE ...

  8. 最新phpcms v9.6.0 sql注入漏洞分析

    昨天爆出来的,但其实在此之前就i记得在某群看见有大牛在群里装逼了.一直也没肯告诉.现在爆出来了.就来分析一下.官方现在也还没给出修复.该文不给出任何利用的EXP. 该文只做安全研究,不做任何恶意攻击! ...

  9. ThinkPHP 5.x远程命令执行漏洞分析与复现

    0x00 前言 ThinkPHP官方2018年12月9日发布重要的安全更新,修复了一个严重的远程代码执行漏洞.该更新主要涉及一个安全更新,由于框架对控制器名没有进行足够的检测会导致在没有开启强制路由的 ...

随机推荐

  1. JVM 中知识

    1.栈:(stack) 存放的都是方法中的局部变量 方法的运行一定要在栈当中 局部变量:方法参数,方法{}内部的变量 作用域:一旦超出作用域,立刻从栈中消失 2.堆:(heap) 凡是new出来的东西 ...

  2. Eclipse使用Git管理项目

    参考来源:https://www.cnblogs.com/wdh1995/p/7004384.html 常见问题: 1. 解决方案:http://www.360doc.com/content/18/0 ...

  3. 2018.10.26 poj3421X-factor Chains(数论+排列组合)

    传送门 排列组合入门题. 令X=p1a1p2a2..pkakX=p_1^{a_1}p_2^{a_2}..p_k^{a_k}X=p1a1​​p2a2​​..pkak​​ 那么答案1就等于∑i=1kai\ ...

  4. 使用express框架和mongoose在MongoDB新增数据

    1.安装 express npm i express --save 2.安装 mongoDB npm i mongodb --save 3.安装mongoose npm i mongoose --sa ...

  5. 从模板驱动文件ins生成cls文件

    在当前目录下,启动cmd程序,输入以下指令: latex acmart.ins

  6. PHP上传文件参考配置大文件上传

    PHP用超级全局变量数组$_FILES来记录文件上传相关信息的. 1.file_uploads=on/off 是否允许通过http方式上传文件 2.max_execution_time=30 允许脚本 ...

  7. Servlet组件之 jsp 技术

    JSP 简称java服务器页面(java server page),jsp和servlet实现了我们的开发需求.对于jsp技术我们首先需要知道他的组成    HTML+java+jsp内置对象=jsp ...

  8. Shell编程-10-Shell中的数组

    目录 数组基础 数组示例 数组总结     如果大家有其他语言的基础或经验,就很快能明白数组了.简单来说,数组就某一种相同类型的元素组合,而后通过下标对其进行访问各元素. 数组基础 基础语法 第一种形 ...

  9. OpenGL中的常用绘图的命令与效果(经验设置)

    1. 剔除多边形表面 在三维空间中,一个多边形虽然有两个面,但我们无法看见背面的那些多边形,而一些多边形虽然是正面的,但被其他多边形所遮挡.如果将无法看见的多边形和可见的多边形同等对待,无疑会降低我们 ...

  10. html5 datalist

    教程:http://www.w3school.com.cn/html5/html5_datalist.asp 提供自动完成的文本框