# CVE-2021-39226: Grafana Authentication Bypass

> Attackers can bypass authentication to view and delete Grafana snapshots, leading to data exposure and loss.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 25 Aug 2022 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Oct 2021
- **Updated:** 21 Oct 2025
- **Also known as:** BIT-grafana-2021-39226, GHSA-69j6-29vr-p3j9, RHSA-2021:3769, RHSA-2021:3770, RHSA-2021:3771, RLSA-2021:3771, UBUNTU-CVE-2021-39226, openSUSE-SU-2024:11651-1

## What is CVE-2021-39226?

CVE-2021-39226 is a critical authentication bypass vulnerability in Fedoraproject Fedora, published on 5 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Grafana is an open source data visualization platform. In affected versions unauthenticated and authenticated users are able to view the snapshot with the lowest database key by accessing the literal paths: /dashboard/snapshot/:key, or /api/snapshots/:key. If the snapshot "public_mode" configuration setting is set to true (vs default of false), unauthenticated users are able to delete the snapshot with the lowest database key by accessing the literal path: /api/snapshots-delete/:deleteKey. Regardless of the snapshot "public_mode" setting, authenticated users are able to delete the snapshot with the lowest database key by accessing the literal paths: /api/snapshots/:key, or /api/snapshots-delete/:deleteKey. The combination of deletion and viewing enables a complete walk through all snapshot data while resulting in complete snapshot data loss. This issue has been resolved in versions 8.1.6 and 7.5.11. If for some reason you cannot upgrade you can use a reverse proxy or similar to 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.

Weakness: CWE-862 (Missing Authorization), CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2021-39226?

5 open source packages ship an affected version, including github.com/grafana/grafana and grafana. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/grafana/grafana` | Go | All versions | 7.5.11 |
| `github.com/grafana/grafana` | Go | All versions | 7.5.11 |
| `github.com/grafana/grafana` | Go | From 8.0.0 | 8.1.6 |
| `github.com/grafana/grafana` | Go | From 8.0.0 | 8.1.6 |
| `grafana` | Bitnami | All versions | 7.5.11, 8.1.6 |
| `grafana` | Red Hat:enterprise_linux:8::appstream | All versions | 0:7.3.6-3.el8_4 |
| `grafana-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:7.3.6-3.el8_4 |
| `grafana` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-azure-monitor` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-cloudwatch` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-debuginfo` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-elasticsearch` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-graphite` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-influxdb` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-loki` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-mssql` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-mysql` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-opentsdb` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-postgres` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-prometheus` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana-stackdriver` | Red Hat:rhel_eus:8.1::appstream | All versions | 0:6.2.2-7.el8_1 |
| `grafana` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-azure-monitor` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-cloudwatch` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-debuginfo` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-elasticsearch` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-graphite` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-influxdb` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-loki` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-mssql` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-mysql` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-opentsdb` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-postgres` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-prometheus` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana-stackdriver` | Red Hat:rhel_eus:8.2::appstream | All versions | 0:6.3.6-3.el8_2 |
| `grafana` | Rocky Linux:8 | All versions | 0:7.3.6-3.el8_4 |
| `grafana` | openSUSE:Tumbleweed | All versions | 7.5.11-3.1 |

Products: Fedoraproject Fedora, Grafana Grafana.

## How do I fix CVE-2021-39226?

Upgrade github.com/grafana/grafana to a fixed version for your release line: 7.5.11 or 8.1.6. US federal agencies must fix it by 15 Sep 2022.

## Is CVE-2021-39226 being exploited?

Yes. Attackers have exploited CVE-2021-39226 in the wild since at least 25 Aug 2022.

Public exploit code:

- Grafana Snapshot - Authentication Bypass (nuclei): http/cves/2021/CVE-2021-39226.yaml

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)
- [CVE-2022-3075](https://insights.sbomify.com/CVE-2022-3075/): Google Chromium Mojo Insufficient Data Validation (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-39226 and fix it if it is affected.

What it is: CVE-2021-39226 is a critical authentication bypass vulnerability in Fedoraproject Fedora, published on 5 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2021-39226 in the wild since at least 25 Aug 2022.

Affected packages and fixed versions:
- github.com/grafana/grafana (Go): affected all versions; fixed in 7.5.11
- github.com/grafana/grafana (Go): affected all versions; fixed in 7.5.11
- github.com/grafana/grafana (Go): affected from 8.0.0; fixed in 8.1.6
- github.com/grafana/grafana (Go): affected from 8.0.0; fixed in 8.1.6
- grafana (Bitnami): affected all versions; fixed in 7.5.11, 8.1.6

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-39226/ (Markdown: https://insights.sbomify.com/CVE-2021-39226/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-39226
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-39226
- OSV: https://osv.dev/vulnerability/CVE-2021-39226

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-39226/
Summaries are generated and may contain mistakes; the official description above is the record.
