详细说明:
测试版本wemall 3.3
下载地址 http://git.oschina.net/einsqing/wemall/repository/archive?ref=master 需要开源中国的账号
可以看到index函数中
$weObj为Wechat类的实例化
而Wechat类从import ( ‘wechat’, APP_PATH . ‘Common’, ‘.class.php’ );导入的
也就是Application/Common/wechat.class.php
重点关注valid()函数
直接使用了simplexml_load_string函数
如何调用代码呢?
访问index.php?g=Admin&m=Wechat&a=index
如何利用参考: http://wooyun.org/bugs/wooyun-2010-098591
下面是poc代码:
访问http://pysandbox.sinaapp.com/kv?act=set&k={key}&v={value} 可以在远程主机设置一个键值对
http://pysandbox.sinaapp.com/kv?act=get&k=刚刚的key 可以查看是否设置了这个键值对
商业版本也应该可以xxe
http://demo.inuoer.com/1/Admin/Wechat/index.html
但是demo有防火墙
漏洞证明:
下面是存在xxe的
http://www.dadodo.wang/index.php?g=Admin&m=Wechat&a=index
http://www.jxbar.com/index.php?g=Admin&m=Wechat&a=index
http://www.liushengjie.com/index.php?g=Admin&m=Wechat&a=index
http://www.wifi-xj.com/index.php?g=Admin&m=Wechat&a=index
http://www.tjguguai.net/index.php?g=Admin&m=Wechat&a=index
http://www.mallonline.com.cn/index.php?g=Admin&m=Wechat&a=index
http://www.mybuy.so/index.php?g=Admin&m=Wechat&a=index
修复方案:
http://wiki.wooyun.org/web:xxe-attack